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

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

Can the WorkflowRuntime host handle events raised by a WorkflowInstance?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :WPF

Or basically, can a workflow instance send a message to the host?

I've spent the better part of a week trying to determine if this is even possible. My searching hasn't turned up too many examples of this and the ones I've seen do not seem to work. The few examples I found suggest using a CallExternalMethodActivity to the external data exchange service, which then raises an event that the host is subscribed to (as seen here ).

Below is my simplest attempt at achieving this:

class Program
    static void Main(string[] args)
      using(WorkflowRuntime workflowRuntime = new WorkflowRuntime())
        AutoResetEvent waitHandle = new AutoResetEvent(false);
        workflowRuntime.WorkflowCompleted +=  

View Complete Post

More Related Resource Links

COM: Handle Late-bound Events within Visual Basic Using an ATL Bridge


Since a Visual Basic client doesn't handle events directly from late-bound COM objects, it needs some way to capture all the events and parameters launched by any COM object server instantiated at runtime and not known at design time. This article explains how to build a bridge component that does just that. The bridge component transmits the intercepted event data back to the Visual Basic client using another supporting COM object that is capable of holding event data and attributes. The Visual Basic client receives the notification from the bridge and extracts all the information relative to the event from the supporting object.

Carlo Randone

MSDN Magazine March 2001

For a control which events are raised at design-time, run-time or both?

Hi. I have been getting several different errors on the my windows forms designer. I'm trying to implement an application with some complexity on the screen navigating since it includes several main views as also sub-views in which the sub-views are represented by user controls. I believe that some of my errors are related to the fact that I miss important information related the events that are raised while working in the windows forms designer. Is there any link that includes information about the events of a control that are raised at design-time, run-time or both? For example, if I override the OnLoad() method of a User Control, that method will be executed both at design-time and run-time. Knowing about this information has helped me resolving an issue related to duplication of columns on a customized DataGridView. Not 100% sure if it's possible to obtain what I'm asking for or if this information exists. If this information is not available what could I do in order to understand in more detail the kind of events that are raised in the design-time vs run-time? Can I debug an application in design-time using Visual C# 2008 Express Edition? I found this link that helps identifying the run-time and the design mode: http://dotnetfacts.blogspot.com/2009/01/identifying-run-time-and-design-mode.html This link has been helpful but I still feel that I need more information.

How can I handle the loaded events for all TreeViewItems in a TreeView?

I have a custom control that inherits from the TreeView control. Here's the code I have right now:   public ModdedTreeView() { this.AddHandler(TreeViewItem.LoadedEvent, new RoutedEventHandler(ItemLoaded)); } protected void ItemLoaded(object sender, RoutedEventArgs e) { TreeViewItem item = e.OriginalSource as TreeViewItem; } Unfortunately my handler seems to be handling the TreeView loaded event instead of the TreeViewItem loaded event. The original source is always the TreeView.   What is going wrong?

Question regarding the number of events raised..


While debugging a page I found it strange that page_load and objectdatasource_selecting is fired off twice.

Here's the layout:

A gridview is linked to a formview by the gridview's selectedvalue.

When the gridview is selected this sequence is raised: page_load, ds_selecting, page_load, ds_selecting.

Everything seems fine from the client, but this double raising seems weird. Both the gridview and formview are located in a updatepanel.

On page_load there's the following:

If Not Page.IsPostBack Then

End If

Gridview with LinkButtons to handle events that update AjaxUpdatePanel


I have a Gridview displaying Titles.

I would like those titles to be LinkButtons that would cause event to update an AJAX UpdatePanel containing details about the Projects.

I would not like the Gridview to be in the Ajax UpdatePanel and refresh on every click, rather just refresh the UpdatePanel.

Can someone direct me in a direction to achieve this?

How to handle login control events when using a custom FBA login page?


Thanks to Kirk Evans' blog post that is liberally referenced all over the place, I have managed to get a custom login page working on my SP2010 site and it is pretty great.  The problem that I am having is that there doesn't seem to be anyway to respond to the events that are raised by asp.net login control that is in my page.

The page is inherited from Microsoft.SharePoint.IdentityModel.Pages.FormsSignInPage and as a result will error out when I attempt to reference a code-behind .cs file.  My question is, how do I respond to the events being raised by the login control that is in the page so that I can do things like logging successful user sign-ins?

Joseph Ackerman, MCSD, MCP.Net

WCF Tutorial - Events and Callbacks

we described how to make a very simple client/server application where clients would call functions on the server through a shared interface. In this tutorial, I'm going to expand that application to allow the server to execute functions on the client by using callbacks. Essentially, this is WCF's mechanism to allow events to be raised from the server to it's connected clients.

Delegates and events in c#.net

People often find it difficult to see the difference between events and delegates. C# doesn't help matters by allowing you to declare field-like events which are automatically backed by a delegate variable of the same name. This article aims to clarify the matter for you. Another source of confusion is the overloading of the term "delegate". Sometimes it is used to mean a delegate type, and at other times it can be used to mean an instance of a delegate type. I'll use "delegate type" and "delegate instance" to distinguish between them, and "delegate" when talking about the whole topic in a general sense.

How to listen to events within a listview



I've got a listview and I've put a button control in one of the columns, I'm trying to figure out how I have listen to the button click within a certain row, but can't see the button in the dropdown for the IDs I can generate events for.

I'd like to get the primary key of the row that's been clicked on and then run a sql statement against it.

Any help would be appreciated.

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

Required permissions cannot be acquired when host asp.net 3.5 application in godaddy


I got the following error when click print report button.

Application : asp.net 3.5

Crystal report : 10.5

Host: godaddy

Please help me.


Required permissions cannot be acquired.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

UI Frontiers: Multi-Touch Manipulation Events in WPF


Multi-touch has progressed from being a futuristic prop of sci-fi films to a mainstream means of user interface. We'll show you how support for multi-touch in Windows 7 has filtered down and settled into various areas of the .NET Framework.

Charles Petzold

MSDN Magazine August 2010

Event Tracing For Windows: Core Instrumentation Events in Windows 7, Part 2


In Part 2, the authors cover core OS Event Tracing for Windows (ETW) events as well as present simple scripts to demonstrate a few basic accounting techniques on some of the OS events introduced.

Alex Bendetov, Insung Park

MSDN Magazine October 2009

Event Tracing for Windows: Core Instrumentation Events in Windows 7


In the first article of a two-part series, the authors present a high-level overview of the ETW technology and core OS instrumentation.

Alex Bendetov, Insung Park

MSDN Magazine September 2009

Advanced WPF: Understanding Routed Events And Commands In WPF


See how routed events and routed commands in Windows Presentation Foundation form the basis for communication between the parts of your UI.

Brian Noyes

MSDN Magazine September 2008

Transactions: Build Scalable Systems That Handle Failure Without Losing Data


Systems that handle failure without losing data are elusive. Learn how to achieve systems that are both scalable and robust.

Udi Dahan

MSDN Magazine July 2008

Office Space: Events in SharePoint 2007


Windows SharePoint Services (WSS) 3.0 provides a new and improved infrastructure for handling server-side events. In this installment of Office Space, we look at techniques for hooking up Before Events and After Events using both Features and code.

Ted Pattison

MSDN Magazine November 2007

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