/// <summary> /// Connect the conversation up. /// </summary> /// <param name="byinvite">True if the conversation was initiated by someone on the contact list, false if the user clicked on the name</param> /// <param name="tag">If the conversation was started by someone on the contact list, this is a plugin-defined object</param> /// <param name="opCompleteEvent"></param> public void Connect(bool byinvite, object tag, OperationCompleteEvent opCompleteEvent) { this.conversationServer = new ConversationServer(this.protocol.Server); this.conversationServer.AddListener(this); this.conversationServer.AddListener(log); this.conversation = this.protocol.ClassFactory.CreateConversation( this.protocol.IProtocol, new ConversationControl(this.conversationServer), this.protocol.Settings); opCompleteEvent.RegisterEvent(new OperationCompleteHandler(OnConnectionComplete)); if (byinvite) this.conversation.StartByInvitation(this.originalFriend, opCompleteEvent, tag); else this.conversation.Start(this.originalFriend, opCompleteEvent); this.connectionInProgress = true; }
/// <summary> /// Constructs a ConversationControl. /// </summary> /// <param name="server">ConversationServer to pass events onto</param> public ConversationControl(ConversationServer server) { this.server = server; }