public override void AddCapability(ICapability capability) { base.AddCapability(capability); if (rtChat == null) { rtChat = (RichTextChatCapability)capability; // Hook the ObjectReceived event so we can receive incoming data rtChat.ObjectReceived += new CapabilityObjectReceivedEventHandler(OnObjectReceived); } }
public override void AddCapability(ICapability capability) { base.AddCapability (capability); if(rtChat == null) { rtChat = (RichTextChatCapability)capability; // Hook the ObjectReceived event so we can receive incoming data rtChat.ObjectReceived += new CapabilityObjectReceivedEventHandler(OnObjectReceived); } }
public override bool RemoveCapability(ICapability capability) { bool ret = base.RemoveCapability(capability); if (ret) { // Remove the ObjectReceived event handler. // This form is going away, but the Capability may be replayed in which case we'd receive this event into a disposed form! rtChat.ObjectReceived -= new CapabilityObjectReceivedEventHandler(OnObjectReceived); rtChat = null; } return(ret); }
public override bool RemoveCapability(ICapability capability) { bool ret = base.RemoveCapability (capability); if(ret) { // Remove the ObjectReceived event handler. // This form is going away, but the Capability may be replayed in which case we'd receive this event into a disposed form! rtChat.ObjectReceived -= new CapabilityObjectReceivedEventHandler(OnObjectReceived); rtChat = null; } return ret; }