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

Top 5 Contributors of the Month
Gaurav Pal

Home >> Interview Question >> SharePoint >> Post New Question Subscribe to Interview Questions

What is the difference between method activity and event activity in WorkFlow ?

Posted By :Faizal     Posted Date :August 22, 2010    Points :10   Category :SharePoint 
A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.

You can also find related Interview Question to What is the difference between method activity and event activity in WorkFlow ?  below: 

What is the difference between method activity and event activity in WorkFlow ?


A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring (More...)

Difference Between Event Receiver and Workflow

Event Receiver:
.Can only be created in Microsoft Visual Studio.
.Can be executed post or prior the event.
.Support varieties different events include delete.

.Can be created in SharePoint Designer, Microsoft Office Visio and Microsoft Visual Studio.
.Can only be executed post the event.
.Support manual started, item created and item updated.

the difference between a delegate and an event

the difference between a delegate and an event


Here is the difference between a delegate and an event.


public class VikramDel


public delegate void VikramExampleDelegate(int num1,string str1);

public VikramExampleDelegate VikramDeleageteCallback;



public class VikramEvent


public delegate void VikramExampleEvent(int num1,string str2);

public event VikramExampleEvent VikramEventCallback;


So syntax wise there is only one difference that we have to use the event keyword with the event.

So the question comes why do we have a keyword when the same work can be done without using it. But there is a reason for the existence of the keyword event. Lets take an example how would a client work with this class

VikramDel V = new VikramDel();

V.VikramDeleageteCallback +=new

VikramDel.VikramExampleDelegate (this.VikDelegate);

Here we are adding a new target to the invocation list of the delegate. The same code will work with the other class also without any problem

VikramEvent V = new VikramEvent();

V.VikramEventCallback + =new


But consider a case where by instead of adding a new target to the invocation list of the delegate if I simply set a delegate to a new delegate (The difference is with the + sign being not there).

VikramDel V = new VikramDel();

V.VikramDeleageteCallback =new

VikramDel.VikramExampleDelegate (this.VikDelegate);

This code will work fine here but the same will not work with an event.

So what it means is that if we use the event keyword no client class can set it to null. This is very important. Multiple clients can use the same delegate. After multiple client have added a function to listen to the callback of the delegate. But now one of the client sets the delegate to null or uses the = sign to add a new call back. This means that the previous invocation list will not be used any more. Hence all the previous client will not get any of the callback even if they have registered for the call back.

Hence we can say that the even keyword adds a layer of protection on the instance of the delegate. The protection prevents any client to reset the delegate invocation list. They can only add or remove the target from the invocation list. (More...)

What is the difference between Session.Clear() and Session.RemoveAll() method?

Well, actually there is no difference. Session.RemoveAll() methods internally makes a call to Clear() method only.

Thanks. (More...)

What is difference between TransferRequest and Transfer method?

Transfer: Terminates execution of the current page and starts execution of provided URL.
TransferRequest : Performs an asynchronous execution of the provided URL. (More...)

What is the difference between Page_init and Page_Load event?

Page_init - This is the first event to occur in the lifecycle of ASP.NET. This event fires only the first time the page is loaded and from the next time on a postback Page_init is not fired.

Page_Load - This is the event where most of our work will be done, this event occurs
when all objects/controls on the page are created and will be available for use. (More...)

Main Difference between Method and function?

Method which tied to a class where as function need not to be. In OOPS we can say there is no functions concept because all the method is tied to a class.

Function is available in procedural language, Scripting language that why we say JavaScript function etc. (More...)

what is the main difference between delegate and an event in c#?

Delegates and Events Both are related.

Dalegete is a function pointer which can able to store the address of any function with same prototype.

Event is a function handler which can handles or run the functions in same prototype of its delegate.

For handling events delegate is used. (More...)

What is the difference between an asynchronous and synchronous event receivers?

An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is ItemAdded, and its sister synchronous event is ItemAdding (More...)

What is the difference between Convert.toString and .toString()

Just to give an understanding of what the above question means see the below code :-

int val = 0;

We can convert the integer "val" using "val.ToString()" or "Convert.ToString" so what's the difference.

The basic difference between them is "Convert" function handles NULLS while "val.ToString()"
does not.

It will throw a NULL reference exception error. So as good coding practice using "Convert" is always safe. (More...)

What is the difference between Convert.ToString() and .ToString() method.

Have a look at the following program and its output

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExampleOfString
class Program
static void Main(string[] args)
String UserName = null ;
//Below statement WILL THROW an exception as .ToString() does not handles null values
String strUserId = UserName.ToString();
catch (NullReferenceException ex)
Console.WriteLine("Error:{0}", ex.Message);

//Below statement WILL NOT THROW an exception as convert.tostring handles implicitly
String strUserId = Convert.ToString(UserName);
Console.WriteLine("UserName:{0}", strUserId);
catch (NullReferenceException ex)
Console.WriteLine("Error:{0}", ex.Message);

Below is the output of the console application

Error:Object reference not set to an instance of an object.
Press any key to continue . . .
*/ (More...)

What is the difference between OrderBy() and Sort() method over IList

OrderBy() sorts and gives the view IEnumerable(). But underlying list is sorted or not changed.

Sort() modifies the underlying list. (More...)

Difference between event and delegate?

1) Data member of a type(class/structure)
2)Declared inside a type(class/structure)


1)Datatype(reference type) that holds references of methods with
some signatures.also called as function pointer.
2)It may or may not be declared inside a class.

What is The Difference Between Final variable,method,class IN Java.

Final variable - Like Constant.
Final method - Can't overridden.
Final class - Can't Inherited by Any other Class (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

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