Esempio n. 1
0
 public void End(OperationCompleteEvent opCompleteEvent)
 {
     if (sbRouter != null)
     {
         sbRouter.SendMessage(Message.ConstructMessage("OUT", string.Empty, string.Empty, false));
         sbRouter.Close();
     }
     opCompleteEvent.Execute(new OperationCompleteArgs());
 }
Esempio n. 2
0
    public void StartByInvitation(Friend friend, OperationCompleteEvent opCompleteEvent, object tag)
    {
        this.friend = friend;
        opCompleteEvent.Execute(new OperationCompleteArgs());
        Message message = (Message)tag;
        this.control.FriendSay(friend, message.GetArgumentString(14));

        this.protocol.conversationTable.Add(friend.Username, this);
    }
Esempio n. 3
0
    public void SendTypingNotification(OperationCompleteEvent opCompleteEvent)
    {
        string body = "MIME-Version: 1.0\r\n"
            + "Content-Type: text/x-msmsgscontrol\r\n"
            + "TypingUser: "******"\r\n\r\n\r\n";

        this.sbRouter.SendMessage( Message.ConstructMessage("MSG", "U " + body.Length, body, true), false );

        opCompleteEvent.Execute(new OperationCompleteArgs());
    }
Esempio n. 4
0
    public void StartByInvitation(Friend friend, OperationCompleteEvent opCompleteEvent, object tag)
    {
        object[] objs = (object[])tag;
        string sbIP = (string)objs[0];
        int sbPort = (int)objs[1];
        string hash = (string)objs[2];
        string sessionID = (string)objs[3];

        try
        {
            Proxy.IConnection conn = this.control.CreateConnection();
            conn.Connect("", 0, sbIP, sbPort, Proxy.ConnectionType.Tcp);
            sbRouter = new MessageRouter(this.protocol, conn, null, null);

            RegisterCodeEvents();

            sbRouter.SendMessage(Message.ConstructMessage("ANS",
                this.settings.Username + " " + hash + " " + sessionID),
                new ResponseReceivedHandler(OnAnswerResponse), opCompleteEvent);
        }
        catch
        {
            opCompleteEvent.Execute(new OperationCompleteArgs("Could not connect", true));
        }
    }
Esempio n. 5
0
 public void SendFile(IO.Stream stream, OperationCompleteEvent opCompleteEvent)
 {
     opCompleteEvent.Execute(new OperationCompleteArgs());
 }
Esempio n. 6
0
 public void Start(Friend friend, OperationCompleteEvent opCompleteEvent)
 {
     this.friend = friend;
     this.protocol.conversationTable.Add(friend.Username, this);
     opCompleteEvent.Execute(new OperationCompleteArgs());
 }
Esempio n. 7
0
 public void InviteFriend(Friend friend, OperationCompleteEvent opCompleteEvent)
 {
     opCompleteEvent.Execute(new OperationCompleteArgs());
 }
Esempio n. 8
0
 public void End(OperationCompleteEvent opCompleteEvent)
 {
     this.protocol.conversationTable.Remove(friend.Username);
     opCompleteEvent.Execute(new OperationCompleteArgs());
 }