Add the client debugging function to the Silverlight project RANET. uilibrary. OLAP.

Source: Internet
Author: User

For more information about the RANET. uilibrary. OLAP project, see my other article here.

For whatever reason, sometimes we want to debug on the Silverlight client to view the request parameters sent to the server, so as to better locate the problem. The following method is based on RANET. uilibrary. OLAP project, add a debugging window to its client:

 

Add silverliclient client DEBUG feature in RANET. uilibrary. OLAP:
1. Change file \ RANET-uilibrary-OLAP \ uilibrary. OLAP \ uilibrary. OLAP. mergemodule. samples. SRC \ installdir \ samples \ uitest. web \ silverliteapplication.htm:
ADD? DEBUG = true in line 68 (<Param name = "Source" value = "clientbin/uitest. xap? DEBUG = true ")
2. Change file \ RANET-uilibrary-OLAP \ uilibrary. OLAP \ uilibrary. OLAP. mergemodule. samples. SRC \ installdir \ samples \ uitest. Silverlight \ evmdxdesigner. CS:

Add initdebug (); Method

Code

Void initdebug ()
{
String src = app. Current. Host. Source. tostring ();
Int idx = SRC. indexof ("? ");
If (idx>-1)
{
String [] paramlst = SRC. substring (idx + 1). Split ("&". tochararray ());
For (INT I = 0; I <paramlst. length; I ++)
{
String [] P = paramlst [I]. Split ("=". tochararray ());
Switch (P [0])
{
Case "debug ":
If (P [1] = "true ")
{
Isdebug = true;
// Txtlogger. Visibility = visibility. visible;
Debugrow. Height = new gridlength (100 );
This. effectmdxdesignercontrol. begindataload + = new eventhandler <RANET. agolap. Controls. General. dataloadereventargs> (effectmdxdesignercontrol_begindataload );
}
Break;
Default:
Break;
}
}
}
}

 

Add initdebug (); Method invoke in init method;
Add method into tmdxdesignercontrol_begindataload ();

Code

Void uplotmdxdesignercontrol_begindataload (Object sender, RANET. agolap. Controls. General. dataloadereventargs E)
{
If (isdebug)
{
Txtlogger. Text + = E. userstate;
}
}

 

Add private variable bool isdebug = false;
3. Change file RANET-uilibrary-OLAP \ uilibrary. OLAP \ RANET. agolap \ controls \ pivotmdxdesignercontrol. CS
Add private variable public event eventhandler <dataloadereventargs> begindataload;
Add event register in method initialize (): m_serverexplorer.olapdataloader.begindataload + = This. begindataload;
4. Change file uitest. Silverlight \ page. XAML
Add new Textbox Control txtlogger at proper place

Code

<Grid X: Name = "layoutroot" loaded = "init">
<Grid. columndefinitions>
<Columndefinition/>
</Grid. columndefinitions>
<Grid. rowdefinitions>
<Rowdefinition/>
<Rowdefinition X: Name = "debugrow" Height = "0"/> <! -- Here -->
</Grid. rowdefinitions>
<Samples: mydesigner grid. Row = "0" grid. Column = "0" X: Name = "effectmdxdesignercontrol"/>
<Textbox X: Name = "txtlogger" grid. Row = "1" grid. Column = "0"/> <! -- Here -->
</GRID>

 

 

5. Change file RANET-uilibrary-OLAP \ uilibrary. OLAP \ RANET. agolap \ controls \ General \ olapdataloader. CS
Add method invoke in loaddata (olapactionbase schema, object state): raise_begindataload (New dataloadereventargs (null, null, Service. endpoint. Address. Uri. tostring ()));
Add method raise_begindataload (dataloadereventargs ARGs)

Code

Void raise_begindataload (dataloadereventargs ARGs)
{
Eventhandler <dataloadereventargs> handler = This. begindataload;
If (handler! = NULL)
{
Handler (this, argS );
}
}

 

Add public variable: public event eventhandler <dataloadereventargs> begindataload;
6. Change file RANET-uilibrary-OLAP \ uilibrary. OLAP \ RANET. agolap \ controls \ General \ idataloader. CS
Add variable in interface idataloader: Event eventhandler <dataloadereventargs> begindataload;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.