title: the equivalent of protocols and delegates in C#
body: <p>I want to know, the equivalent of protocols and delegates in C#.</p>
  
  <p>So this is my protocol, the interface and the implementation of class that defined the protocol and the implementation of the class that conform with the protocol. I want to know the equivalent of this in c#. please :)</p>
  
  <pre><code>/******************************************/
  // Communicator Protocol
  @class Communicator
  
  @protocol CommunicatorDelegate &lt;NSObject&gt;
  
  @required
  - (void)communicator:(Communicator *)communicator receivedData:(NSData *)data;
  - (void)fetchingFailedWithError:(NSError *)error;
  
  @optional
  - (void)anOptinalMethod;
  
  @end
  
  /******************************************/
  // Communicator Class
  
  @protocol CommunicatorDelegate;
  
  @interface Communicator : NSObject
  
  @property (weak, nonatomic) id&lt;CommunicatorDelegate&gt; delegate;
  
  @end
  
  /******************************************/
  // Communicator Implementation
  
  @implementation
  
  -(void)someMethodThatFail:(NSError *)error;
  {
      [self.delegate fetchingFailedWithError:error];
  }
  
  - (void)someMethodThatGetData:(NSData *)data;
  {
      [self.delegate communicator:self receivedData:data];
  }
  
  @end
  
  /******************************************/
  // Interface of Some Class that conform with the protocol
  
  #import "Communicator.h"
  
  @interface SomeClass : NSObject &lt;CommunicatorDelegate&gt;
  
  @end
  
  /******************************************/
  // Implementation of Some Class that conform with the protocol
  
  - (void)communicator:(Communicator *)communicator receivedData:(NSData *)data;
  {
      // Do something
  }
  
  - (void)fetchingFailedWithError:(NSError *)error;
  {
      // Do something
  }
  </code></pre>