CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Mar 2012
    Posts
    12

    Delegates and Event

    Hi all

    I am trying to use a code sniplet from a source, but the error CS0079 was prompted, saying that StatusMessageChange should only appear on the left side of += or -+. Can someone kindly help me.
    Code:
    namespace IBIX
    {
    	public class BatchInfo
    	{
    		public delegate void StatusMessageChangeHandle(object tmp, StatusMessageChangeEventArgs e);
    
    
    		public event BatchInfo.StatusMessageChangeHandle StatusMessageChange
    		{
    			add
    			{
    				this.StatusMessageChange = (BatchInfo.StatusMessageChangeHandle)Delegate.Combine(this.StatusMessageChange, value);
    			}
    			remove
    			{
    				this.StatusMessageChange = (BatchInfo.StatusMessageChangeHandle)Delegate.Remove(this.StatusMessageChange, value);
    			}
    		}
    
    }
    }
    Much appreciated.
    Last edited by Cimperiali; March 26th, 2012 at 11:09 AM. Reason: added [code][/code] tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured