What is the difference of using Invoke and without invoke for invoking delegate references .

Lets consider the below example,
1. Invoke the delegate reference with Invoke keyword,
public delegate double returndel(int r);
 private void button1_Click(object sender, EventArgs e)
            returndel ret = CalculateArea;
            double yt = ret.Invoke(4);   
            MessageBox.Show(yt.ToString());
        public double CalculateArea(int r)
            return 3.14 * r * r;
2.  Invoke the delegate reference without Invoke keyword,
public delegate double returndel(int r);
 private void button1_Click(object sender, EventArgs e)
            returndel ret = new returndel(CalculateArea);
            double yt = ret(4);
            MessageBox.Show(yt.ToString());
 public double CalculateArea(int r)
            return 3.14 * r * r;
What is the difference between these two ?
Thanks and Regards
Bijukrishnan.BS

No difference if you just want to call single function.
Try the following:
public delegate void DoMyWork(int i);
static void DoMyWork1(int i)
Console.WriteLine(i);
static void DoMyWork2(int i)
Console.WriteLine(i * i);
static void delegateTest()
DoMyWork work = new DoMyWork(DoMyWork1);
work += new DoMyWork(DoMyWork2);
work.Invoke(4);
The output would be:
4
16

Similar Messages

  • What Is The Difference Between Budget Cost And Regular Cost For Resources?

    What's the difference betwee budget cost and regular cost for resources?
    Here is the explanation which I didn't understand from the book;
    In planning your departmental retreat, suppose you
    have specific budget targets
    for certain cost categories, $2,500
    for travel expenses, $500 for printing,
    and $1,000 for conference room rentals. Using Project’s budget resource
    feature, you can define your budget
    for different categories
    of items. You can then group your resources to
    com-pare your budgeted
    costs to your planned costs. This way, you
    can view your travel budget
    of $2,500 side by side with your planned
    costs of, say, $3,700,
    and immedi- ately see that your next
    goal is to find a way to trim those travel
    costs.

    Hi,
    You have to differenciate the proejct budget from the project cost:
    The project budget is the amount of money which has been allocated to your project by the executive board based on the estimation you provided. This is not meant to be changed unless you go through a change request process, justifying why you need to change
    (increase) the budget, meaning asking more money. Consequently it will not be related in MS Project with the tasks, assignments. It is entered on the project summary and can be meanly used in portfolio reports where you can consolidate yours budgets (you can
    have several different budgets) among a set of projects.
    The project cost is something which lives, changes along the project lifecycle. It is meant to be updated on a weekly or biweekly basis from the team members tasks updates approved by the project manager. Then the PM updates the remaining work thus the project
    cost.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |
    You say that the budget cost is total money which committee gave you for the project.
    But the book refer budget cost for every resource. I don't understand that.
    " In planning your departmental retreat, suppose you
    have specific budget targets
    for certain cost categories, $2,500
    for travel expenses, $500 for printing,
    and $1,000 for conference room rentals. Using Project’s budget resource
    feature, you can define your budget
    for different categories
    of items. You can then group your resources to
    com-pare your budgeted
    costs to your planned costs. This way, you
    can view your travel budget
    of $2,500 side by side with your planned
    costs of, say, $3,700,
    and immedi- ately see that your next
    goal is to find a way to trim those travel
    costs. "
    For example here travel budget cost is 2500 whereas planned cost is 3700. Planned cost of travel expense is created by the project manager. Who does define travel budget cost?
    Let's say an employee's cost is 20 dollars per hour and I write it on the project. So how much is this employee's budget cost, Who does define it, From whom do I learn that data?

  • What is the difference of using JavaBean and regular classes?

    Experts,
    I am new to JavaBean(not EJB), and wondering what is the difference of using JavaBean for JSP page compared with using regular Java class?
    I know there are Bean tags which save some lines, what else?
    What does "serialization" mean compared with "not serializable"?
    thanks very much.

    No.
    A JavaBean is a regular JavaClass that:
    1) implements java.io.Serializable
    2) Its data members are private, and its data is accessed via getters and setters. You must define the getters and setters. Getters retrive the property, and must be in the format:
    public PropertyType getPropertyName()
    for most cases. The exception is when the PropertyType is a boolean, in which case you use:
    public boolean isPropertyName()
    Setters assign values to the property, and are in the form:
    public void setPropertyName(PropertyType propValue)
    3) There is also a PropertyChangeEvent model that needs to be followed.
    A marker interface has no methods you need to implement. It just marks the class as supporting certain operations. In the case of Serializable, it means the class can be written to be an ObjectOutputStream for persistant storage.
    As far as an example of JavaBean persistance, take a search on the java.sun.com site for Serializeable
    Also, take a look at this: http://java.sun.com/developer/onlineTraining/Beans/beans02/
    It concentrates mainly on gui component beans, but not all beans need to be gui parts... There are other pages to look at, but I can't find them at the moment, and I have to run...

  • What's the difference between Application ID and Product ID for WP App?

    Anyone know what's the difference between the Application ID on Marketplace and the
    Product ID in WMAppManifest.xml?  Can I get the Application ID before I sumbit the app to Marketplace? Thank you.

    Hello the ApplicationID is the ProductID on the WMAppManifest.xml, when you create a new project, a generic
    ProductID is assigned to your app, and once you send your app to the store, the generic
    ProductID is replaced with a new one (which will be assigned permanently to your app
    unless you do a new App Submission, which means each update will have that same ID). AFAIK once your app is certified you'll get the ApplicationID, you can send it and publish it manually, so you could
    have the AppID before people start downloading the app.
    (if you need the AppID for testing IAP, you may want to try sending your App as a Beta version)
    I hope it helps
    Yassine,
    Now I think I understand them, thank you!

  • What is the difference between 'command delete' and using 'delete original and all versions'?

    My masters are not referenced and I usually have only one version.  What is the difference between using 'command delete' versus going to the top menu bar and using 'dele

    Good question  .
    When the Version is the only Version based on the Original of that Version, the two commands have the same effect.
    See this User Tip by master Aperturist Frank Caggiano.

  • What's the difference between using and 802.11a and 5GHz only?

    What's the difference between using "802.11n (802.11a compatible)" and "802.11n only (5GHz)" modes on the Airport Extreme?

    802.11a gives you 802.11g speeds but using 5GHz (54mbps
    802.11n gives you 144Mbps (600 peak) at 2.4GHz or 5GHz

  • What is the difference between VI Template and vi that is reenterant​?

    What is the difference between VI Template and vi that is reenterant?
    From what little info I can find about them, they seem to basically do the same thing....
    What are the difference?
    What are the pros and cons of each?
    Thanks alot for the help.....

    Tarek316 wrote:
    I inherited an app that uses .vit for the purpose of having multipe separate instances.
    Thanks,
    OK, here's what happens when you call a VI Template using Call by Reference or using Invoke and Property Nodes.
    Since the VI you are calling is a template, LabVIEW creates a new instance of that VI by creating a copy of it and giving a new name. Notice in the title bar of the instantiated VI the VI name is the same as the template VI plus a number. This is the same thing you see when you open a template from the "New..." menu. So if you call the template VI 3 times, you'd end up with 5 newly instantiated VIs named, "VI Name 1.vi", "VI Name 2.vi" and "VI Name 3.vi". This is how you end up with multiple instances.
    Reentrancy only works on subVIs when they are used as a normal subVI in a top level application. Using Call by Reference or Invoke and Property Nodes to open and run a reentrant VI results in the VI only being opened once because LabVIEW will not automatically give it a new name. The new name is only generated when calling templates. Since LabVIEW can only a have a single instance of VI name in memory at a time, you'll not end up with multiple instances.
    Not sure if I can help with the know issue on OSX. If it's specific to using the Call by Reference function, you could try calling the templates using Invoke and Property nodes.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • What is the difference between sy-uline and uline in sapscripts ?

    hi guys,
    what is the difference bt sy-uline and uline in sap scripts ?
    this is an interview question ?
    also how can we draw a line without using above ?

    Hi ,
    sy-uline is a system field.
    No-difference.  Except that uline is used outside
    the Write Statement
    TO draw a line.
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    OR
    Draw a horizontal line by setting the HEIGHT in a BOX command to 0. Draw a vertical line by setting WIDTH to 0.
    /: BOX FRAME 10 TW WIDTH 0 TW HEIGHT '10' CM
    Vertical line 10 CM long
    /: BOX FRAME 10 TW WIDTH '10' CM HEIGHT 0 TW
    Horizontal line 10 CM long
    ALSO
    You can draw a line by setting the Height or Weidth to 0
    and add a frame. E.g. a horizontal line:
    /: SIZE HEIGHT '0' MM WIDTH '200' MM
    /: BOX FRAME 10 TW XPOS '11.21' MM YPOS '14.81' MM INTENSITY 100
    <i><b>Reward if helpful.</b></i>
    Regards,
    Pritha.
    Message was edited by:
            Pritha Agrawal

  • What is the difference between Topic Keywords and Index File Keywords?

    What is the difference between Topic Keywords and Index File Keywords? Any advantages to using one over the other? Do they appear differently in the generated index?
    RH9.0.2.271
    I'm using Webhelp

    Hi there
    When you create a RoboHelp project you end up with many different ancillary files that are used to store different bits of information. Many of these files bear the name you assigned to the project at the time you created it. The index file has the project name and it ends with a .HHK file extension. (HHK meaning HTML Help Keywords)
    Generally, unless you change RoboHelp's settings, you add keywords to this file and associate topics to the keywords via the Index pod. At the time you compile a CHM or generate other types of output, the file is consulted and the index is built.
    As I said earlier, the default is to add keywords to the Index file until you configure RoboHelp to add the keywords to the topics themselves. Once you change this, any keyword added will become a META tag in the topic code. If your keyword is BOFFO, the META tag would look like this:
    <meta name="MS-HKWD" content="BOFFO" />
    When the help is compiled or generated, the Index (.HHK) file is consulted as normal, but any topics containing keywords added in this manner are also added to the Index you end up with. From the appearance perspective, the end user woudn't know the difference or be able to tell. Heck, if all you ever did was interact with the Index pod, you, as an author wouldn't know either. Well, other than the fact that the icons appear differently.
    Operationally, keywords added to the topics themselves may hold an advantage in that if you were to import these topics into other projects, the Index keywords would already be present.
    Hopefully this helps... Rick

  • What is the difference between HUI emulation and MMC?

    This may help clear up my issues with dm24 & LE. I am trying to have channels 1-24 of the Tascam dm 24
    control volume and pan..etc for tracks 1-24 of LE (AUDIO, Midi and or softsyths, inst), without having to use the mouse to select the LE tracks directly. In other words I need to use the dm24 as a control surface. What is the difference in using mmc to do this versus Control surface. I cannot locate the proper compatible driver or whatever it needs to get this to work in LE.. I even tried using the dm24 macro environment found on tascams site .. all it does is allow me to see the faders move in the environment( bidirectionaly) , but I cannot interact with the actual LE audio, midi and softsyth tracks , unless I actually select the tracks with the mouse, I do not need the dm24 do do this , as this was possible with my KX controller using the volume slider. It appears as if I may have a total lack of understanding of the dm 24 functions regarding using it as a control surface for LE 7.2.3

    Like previously stated, refurbished can mean many things.  Someone may buy a camera and when they get it have buyers remorse and return it unused, but, once Canon gets it back they have to completely check it out to make sure it meets specs and then they sell it as refurbished.  You might get a camera with 0 shutter actuations but you might get one with 1000 or more shutter actuations.  Either way Canon completely rechecks each camera before they sell it.  I have bought 2 refurbished DSLRs from Canon and they have both been great cameras.  You couldn't tell if they had ever been used or not.  Recently Canon started offering a 1 year warranty on refurbished DSLRs but I am not sure if that applies to other models or not.
    Joe

  • What is the difference between Video-out and mirroring?

    What is the difference between Video-out and mirroring? I can't get iPhone 4 video to work on my TV screen
    I have just bought an MD098ZM/A (Apple 30-pin Digital AV Adapter). I am struggling to get it to show a picture on my TV. I know I'm doing something right because the audio is coming out of my TV speakers but no picture on the TV screen.
    I have used the same HDMI channel (on the TV side) with the same cable and my thunderbolt port (MacBook Air) without any trouble - and on the same app (BBC iPlayer download then full-screen mode).
    Now I note that the packaging for the MD098ZM/A says video-out on iPhone 4 but mirroring only on iPhone 4S. I only have an iPhone 4 (not the 4S). Now if the lack of iPhone 4 support for mirroring means that I can't play video material out to my TV, then in what sense is there any video-out capability at all?
    There is only safety and warranty paperwork in the Apple adapter packaging - no help information. And I haven't found further guidance online either.
    I do note somewhere online that it suggests that basic non-mirroring video-out (for this adapter) only works with some external TV sets. Any way of finding out which? I'm using a Sanyo CE32LD90-B LCD TV if it helps.
    So far not doing very well.

    Now found these but have had to give up on this adapter!
    http://manuals.info.apple.com/en_US/iphone_user_guide.pdf
    http://support.apple.com/kb/HT4108

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • What is the difference between document class and normal class

    Hi,
    Please let me know what is the difference between document class and normal class.
    And I have no idea which class should call as document class or call as an object.
    Thanks
    -Actionscript Developer

    the document class is invoked immediately when your swf opens.  the document class must subclass the sprite or movieclip class.
    all other classes are invoked explicitly with code and need not subclass any other class.

  • In OSX Activity Monitor, what's the difference between 'free' memory and 'inactive' memory

    In OS X Activity Monitor, what's the difference between 'free' memory and 'inactive' memory. My daughters 2Gb MacBook Pro is very slow, it probably needs more memory but there is almost 1Gb of 'inactive' memory but no 'free' memory when an application is opened.
    Thanks

    Free RAM is the one that has not been used by any application since you started up your Mac, and inactive RAM is the one that was used by an application and it is not in use anymore.
    1 GB of inactive RAM is a lot, and it may be the cause of the slowness. There are a lot of apps that allows you to turn inactive into free RAM. I use FreeMemory, but have a look at the Mac App Store.
    If you are a developer, you can do that with a command you can type into Terminal:
    sudo purge

  • What is the difference between local printing and remote printing in SAP

    Hello Nation,
    I would like to know what is the difference between local printing and remote printing in SAP and in what scenarios they are used ?
    1.What is local printing in SAP ?
    2.What is Remote Printing in SAP?
    3.what is the difference between local printing and remote printing in SAP ?
    Thank you in Advance.
    Regards,
    -Mohamed Naveen.

    Hi,
    This is SAP Business one system administration forum. Please find correct forum and repost your discussion to get quick response.
    Please close this thread here with helpful answer.
    Thanks & Regards,
    Nagarajan

  • What is the difference between Business System and Business Service?

    Hi
    Please tell me what is the difference between Business System and Business Service...? In real time at what situation we will use Business System and in what situations we will use Business Service..? Please help me
    Best Regards
    Ravi Shankar B

    HI,
    Business system:
    If you want to address a particular business system as the sender or receiver of messages, choose this service type.
    A business system is an actual application system in a system landscape. A business system (service) comprises information about the inbound and outbound interfaces and the software component versions of the business system.
    You usually use business system services when configuring internal company processes.
    Business Service:
    If you want to address an abstract business entity as the sender or receiver of messages, choose this service type.
    Using a business service, you can define the technical or business subunits of the companies involved and then assign them the relevant interfaces.
    You usually use business services when configuring cross-company processes. In this case, you only make your interfaces known to the business partners involved and either do not make any details about your own system landscape available, or only specific details. 
    For example, you can define RosettaNet Partner Interface Processes (PIPs) as business services.
    Regards,
    Sudheer.

Maybe you are looking for