.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to implement handle externl event activity by my code?...

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :WPF
As a programmer, I write some code to practice wwf, and I have implemented the **call external activity** by using reflection. 1. Firstly, define a xml document that contain a plugin detail: <xml version="1.0" encoding="utf-8" > 2.Secondly, call the external method by reflection in some codes: Assembly assembly = Assembly.Load(assemblyName); Type myInterface = assembly.GetType(interfaceName); Type myClassType = null; foreach (Type t in assembly.GetTypes()) { if (myInterface.IsAssignableFrom(t) && t.IsClass) { myClassType = t; break; } } MethodInfo methodInfo = myClassType.GetMethod(method); object instance = Activator.CreateInstance(myClassType); object result = methodInfo.Invoke(instance, userData); But when I implement the handle external event pattern, i can't finish it by using reflection directly, then i want to hookup delegate, still faild. It seems that the mothod **addService(service)** do somethings inside the wf side. Could I still implement it by use reflection? Actualy, I don't know the detail about when the host client raise an event, how wf side can recieve this action. it seemed that this is the key for my question... Thanks ligong

View Complete Post

More Related Resource Links

How to implement delay in code activity


Actually i want to use the delay in async code activity. 

For example, In my async code activity i am trying to check the file presence in a folder, if file is not present i have to wait for some time (consider 30 seconds), after 30 seconds i have to check the file again.

Can any one help me, hwo to implement this in async code activity.


Thanks raj

how implement this code


check this link

and how can i implement on aspx page to get value on textbox


Creating Event Handler in Code behind


Hi, so I have a control that is created in the code behind and generates fine but I can't figure out how to create an event handler for it.  I've found plenty of examples for it in C sharp, but none of them seem to apply to VB.  What I want to do is essentially this:

myDropDownList.SelectedIndexChanged = "Event to do here"

but it doesn't seem to work for me.

Any suggestions are appreciated.

Infopath button click event in custom workflow code.


Hi All,

I have designed the infopath form(Init) and integrated with my state machine workflow. i want to access button click event (designed in Infopath form) in my workflow code.

Can you help me.




how to handle the next event on createuserwizard

down vote favorite   Hi, Does anyone know how to handle the next button on createuserwizard control asp.net? I need to validate some fields before the user can navigate to the next step.

listview with button in item template - how do I handle the click event?

Hello,Using a listview control for the first time... I need a button for each item, and of course I need to handle the click event for the buttons... upon clicking a particular button I of course need to know which item the button is associated with so the appropriate action can be taken...In VS, I can't select the button and see my list of available events in the properties window like is normally done for controls outside of templates like this... what do I need to do?

How to handle differences in HTML code from different browser versions?

First of all I'm still very new to C# so be gentle :p I'm currently trying to make an application that can login to a certain website and search for some numbers and so on that I can put in an overview, just to save some time. The only thing I found that could do this is the WebBrowser control, and I've managed to make it work, but when I gave the program to a friend it failed. I think it has to do with the difference in browser versions (he uses Internet Explorer 7, I use the latest) and if that's the case I'm pretty clueless how to deal with the problem, since I don't even know what the differences in HTML codes are in each version, and it seems like a lot of work to adjust all the html code to check for accordingly. For example it was even so that & changed to &amp; in my application on my PC and that's only by using one browser so I dunno what happens with other browser versions. I assume that the WebBrowser control always uses Internet Explorer, even if for example Firefox is the standard browser, is this true? But to be sure I asked the friend to put his Internet Explorer as the default browser and still no go. So my question is: is there a relatively easy way to make sure that the program works on practically any PC, without me having to make exceptions for like version 1.6.7 or 1.6.8 (I have no idea what versions there are really)?

Infopath Changed Event code triggering in preview but not in web filler.

Hi there, I've written some code for a changed event hookup on a field in infopath 2010. The form is for submission to a sharepoint 2010 forms library. What the code does is fill in a specific value into a field depending on the selected value from a combo-box elsewhere on the form. When i preview this in Infopath 2010 it works perfectly but when i fill out the form through the web interface it simply does nothing. I've got another piece of code which executes on load and this works perfectly in both the preview and the web filler. What it does is just set the value of a field when the form loads. Here is the code, could someone tell me what i'm doing wrong? public void InternalStartup() { EventManager.XmlEvents["/my:myFields/my:service_level"].Changed += new XmlChangedEventHandler(service_level_Changed); EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading); } public void service_level_Changed(object sender, XmlEventArgs e) { // Write your code here to change the main data source. XPathNavigator xroot = MainDataSource.CreateNavigator(); XPathNavigator serviceLevel = xroot.SelectSingleNode("/my:myFields/my:service_level",NamespaceManager); XPathNavigator xest = xroot.SelectSingleNode("/my:myFields/my:est_cost", NamespaceManager); switch (serviceLevel.Value)

Handle MaxLength changed event for TextBox

Hi, Is it it possible to handle the event when MaxLength property is changed on a TextBox? Thanks, cp

How to catch Save Ribbon event from code-behind for the custom webpart

Hi there, How can a custom web part(sitting on top of PDP) catch the Save Ribbon event from code? I’ve been looking around for solution, but not yet find one…. Thank you, —JoeJoe

Catch Save Ribbon Event from code-behind for webpart control

Hi there, How can a custom web part catch the Save Ribbon event from code-behind? Thank you, —JoeJoe

Catch Save Ribbon Event from code-behind for webpart control

Hi there, How can a custom web part catch the Save Ribbon event from code-behind? Thank you, —JoeJoe

Activity to handle SQL Trigger firing

Hello, Does anyone have a recommended best practice for how a workflow should "watch for" the event of a SQL (2005) trigger's firing -- rather like the FileWatcher sample?  Or better, perhaps a code sample? Thanks in advance for your thoughts. John

Implement Mouse Click event in AxShockWaveFlash

Hi, I want to hide the AxShockWaveFlash control when I clck on it. public class myAxShockwaveFlash: AxShockwaveFlashObjects.AxShockwaveFlash { private const int WM_LBUTTONDOWN = 0x0201; protected override void WndProc(ref Message m) { switch (m.Msg) { case WM_LBUTTONDOWN: { Visible = false; // I also tried SetVisibleCore(false); } break; } base.WndProc(ref m); } } There are no errors while debugging. Unfortunatelly the AxShockWaveFlash doesn't disappear. If I use methods instead that are defined direct in AxShockWaveFlash (like Play(), Stop(),...), the source code will work. Why does it not work?

Event Handle & Declared Message Errors

Hi Experts: There is a missing event Handle that requires a variable found in the button code . Secondly,  there is a Name declared error (i.e., Name 'First' is not declared, Name 'Last' is not declared, Name 'City' is not declared, Name 'State' is not declared) found in the page code. How do we revise the codes to remove the message errors? Go to the following URL link to view 'High Res' screen shots at http://cforedu.com/screen.pdf Here is the page code:<%@ Page Language="VB" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title></title> <script runat="server"> Protected Sub Save(sender As Object, e As EventArgs) Dim First As TextBox = TryCast(Me.fvApplication.FindControl("First"), TextBox) Dim Last As TextBox = TryCast(Me.fvApplication.FindControl("Last"), TextBox) Dim City As TextBox = TryCast(Me.fvApplication.FindControl("City"), TextBox) Dim State As TextBox = TryCast(Me.fvApplication.FindControl("State"), TextBox) End Sub </script> </head> <body> <form id="form1" runat="server"> <div> <asp:FormView runat="server" ID="fvApplicatio

Running code after site definition site creation in a event receiver or feature receiver

Hi guys I've got a site definition which is pretty much based on STS.This is it's own sharepoint project. Let's call this project SiteDefProj. Next in another SharePoint project (same solution though). Let's call this CustomListProject. In this project I've got a feature which provisions a bunch of lists based on custom content types - this feature is a site scoped. Let's call this feature: CustomListInstances. I have added a feature receiver to this feature to execute some custom code on the lists themselves (under feature activated) In my ONET.XML (part of the SiteDefProj) I have CustomListInstances feature ID as part of my <sitefeatures>. When I do a create site I can actually step through the code and see it actually being executed but after the site is created the list instances are created but it's like the code never run or did anything. The weird part is that stepping through the code while creating a site collection using my SiteDefProj the code runs great with no errors. All lists are there and the code runs smooth. If I manually create a STS site and activate my feature everything works and the code does actually run and the effects are visible after the feature is created. Again I can actually step through it in debug. My suspicion is that there's some sort of a race condition in the CREATE SITE functionality where maybe the web or site collection hol

adding onload event from code behind for Google Maps

Im working with Google maps start turoail: http://code.google.com/apis/maps/documentation/javascript/tutorial.html#HelloWorldAs you can see there's a line: <body onload="initialize()">Now since, I want to have Google Maps on page A.aspx within a masterpage main.master, I dont have the <body> tag available to me in the A.aspx page.I preferably DONT want to have the body tag as runat="server", since Google Maps is not relevant for all pages and I dont like a server control when its not needed as they slow things down (even a bit).I tried this in A.aspx.vb, but it didnt work:Dim javaScript As New StringBuilder        javaScript.Append("<script type='text/javascript'>")        javaScript.Append("window.document.body.onload = initialize();")        javaScript.Append("</script>")        Me.Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "BodyLoadUnloadScript", javaScript.ToString())How can I add the onload event from code behind?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend