Example #1
0
 public Form1()
 {
     InitializeComponent();
     client               = new FacebookChatClient();
     chatList             = new LinkedList <FacebookDoChat>();
     client.OnLoginResult = success =>
     {
         if (success)
         {
             MessageBox.Show("Connected!!!");
         }
     };
     client.OnLogout = () =>
     {
         // close connections
     };
     client.OnMessageReceived = (msg, user) =>
     {
         startChat(msg, user);
     };
     client.OnUserIsTyping = user =>
     {
         // user is typing. so what?
     };
     client.OnUserAdded = user =>
     {
         // may be added to list when online
         // better to add user to list when getting msg
     };
     client.OnUserRemoved = user =>
     {
         RemoveFromList(user);
     };
 }
Example #2
0
        public Start()
        {
            client               = new FacebookChatClient();
            chatList             = new LinkedList <FacebookDoChat>();
            client.OnLoginResult = success =>
            {
                if (success)
                {
                    MessageBox.Show("Connected!!!");
                }
            };
            client.OnLogout = () =>
            {
                // close connections
            };
            client.OnMessageReceived = (msg, user) =>
            {
                startChat(msg, user);
            };
            client.OnUserIsTyping = user =>
            {
                // user is typing. so what?
            };
            client.OnUserAdded = user =>
            {
                // may be added to list when online
                // better to add user to list when getting msg
            };
            client.OnUserRemoved = user =>
            {
                RemoveFromList(user);
            };

            string nick = "alice.bot.90";
            string pass = "******";

            //string nick = "dimon.mmomm";
            //string pass = "******";
            client.Login(nick, pass);
        }