예제 #1
0
 private void inviteToTradeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         if (friends_list.SelectedItem != null)
         {
             ulong sid = Convert.ToUInt64(column_sid.GetValue(friends_list.SelectedItem.RowObject));
             string selected = bot.SteamFriends.GetFriendPersonaName(sid);
             if (!chat_opened)
             {
                 chat = new Chat(bot);
                 chat.AddChat(selected, sid);
                 chat.Show();
                 chat.Focus();
                 chat_opened = true;
                 chat.chatTab.tradeClicked();
             }
             else
             {
                 bool found = false;
                 foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
                 {
                     if (tab.Text == selected)
                     {
                         found = true;
                         tab.Invoke((Action)(() =>
                         {
                             foreach (var item in tab.Controls)
                             {
                                 chat.chatTab = (ChatTab)item;
                                 chat.chatTab.tradeClicked();
                             }
                         }));
                         return;
                     }
                 }
                 if (!found)
                 {
                     chat.AddChat(selected, sid);
                     chat.Focus();
                     chat.chatTab.tradeClicked();
                 }
             }
         }
     }));
 }
예제 #2
0
 private void friends_list_ItemActivate(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         if (friends_list.SelectedItem != null)
         {
             ulong sid = Convert.ToUInt64(column_sid.GetValue(friends_list.SelectedItem.RowObject));
             string selected = bot.SteamFriends.GetFriendPersonaName(sid);
             if (!chat_opened)
             {
                 chat = new Chat(bot);
                 chat.AddChat(selected, sid);
                 chat.Show();
                 chat.Activate();
                 chat_opened = true;
             }
             else
             {
                 bool found = false;
                 foreach (TabPage tab in chat.ChatTabControl.TabPages)
                 {
                     if (tab.Text == selected)
                     {
                         chat.ChatTabControl.SelectedTab = tab;
                         chat.Activate();
                         found = true;
                         break;
                     }
                 }
                 if (!found)
                 {
                     chat.AddChat(selected, sid);
                     chat.Activate();
                 }
             }
         }
     }));
 }
예제 #3
0
 private void openChatToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         SteamID steamId = new SteamID(contextMenuSteamId);
         string selected = bot.SteamFriends.GetFriendPersonaName(contextMenuSteamId);
         if (!chat_opened)
         {
             chat = new Chat(bot);
             chat.AddChat(selected, contextMenuSteamId);
             chat.Show();
             chat.Focus();
             chat_opened = true;
         }
         else
         {
             bool found = false;
             foreach (TabPage tab in chat.ChatTabControl.TabPages)
             {
                 if ((SteamID)tab.Tag == steamId)
                 {
                     chat.ChatTabControl.SelectedTab = tab;
                     chat.Focus();
                     found = true;
                 }
             }
             if (!found)
             {
                 chat.AddChat(selected, contextMenuSteamId);
                 chat.Focus();
             }
         }
     }));
 }
예제 #4
0
        void OpenChatHandler(object sender, JavascriptMethodEventArgs e)
        {
            try
            {
                bot.main.Invoke((Action)(() =>
                {
                    ulong steamId = Convert.ToUInt64(e.Arguments[0].ToString());
                    string selected = bot.SteamFriends.GetFriendPersonaName(steamId);
                    if (!chat_opened)
                    {
                        chat = new Chat(bot);
                        chat.AddChat(selected, steamId);
                        chat.Show();
                        chat.Activate();
                        chat_opened = true;
                    }
                    else
                    {
                        bool found = false;
                        foreach (TabPage tab in chat.ChatTabControl.TabPages)
                        {
                            if ((SteamID)tab.Tag == new SteamID(steamId))
                            {
                                chat.ChatTabControl.SelectedTab = tab;
                                chat.Activate();
                                found = true;
                                break;
                            }
                        }
                        if (!found)
                        {
                            chat.AddChat(selected, steamId);
                            chat.Activate();
                        }
                    }
                }));
            }
            catch
            {

            }
        }
예제 #5
0
 private void inviteToTradeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         string selected = bot.SteamFriends.GetFriendPersonaName(contextMenuSteamId);
         if (!chat_opened)
         {
             chat = new Chat(bot);
             chat.AddChat(selected, contextMenuSteamId);
             chat.Show();
             chat.Focus();
             chat_opened = true;
             chat.chatTab.tradeClicked();
         }
         else
         {
             bool found = false;
             foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
             {
                 if ((SteamID)tab.Tag == new SteamID(contextMenuSteamId))
                 {
                     found = true;
                     tab.Invoke((Action)(() =>
                     {
                         foreach (var item in tab.Controls)
                         {
                             chat.chatTab = (ChatTab)item;
                             chat.chatTab.tradeClicked();
                         }
                     }));
                     return;
                 }
             }
             if (!found)
             {
                 chat.AddChat(selected, contextMenuSteamId);
                 chat.Focus();
                 chat.chatTab.tradeClicked();
             }
         }
     }));
 }
예제 #6
0
파일: Friends.cs 프로젝트: notafraid90/Mist
 private void openChatToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         if (friends_list.SelectedItem != null)
         {
             ulong sid = Convert.ToUInt64(column_sid.GetValue(friends_list.SelectedItem.RowObject));
             string selected = bot.SteamFriends.GetFriendPersonaName(sid);
             if (!chat_opened)
             {
                 chat = new Chat(bot);
                 chat.AddChat(selected, sid);
                 chat.Show();
                 chat.Focus();
                 chat_opened = true;
             }
             else
             {
                 bool found = false;
                 foreach (TabPage tab in chat.ChatTabControl.TabPages)
                 {
                     if (tab.Text == selected)
                     {
                         chat.ChatTabControl.SelectedTab = tab;
                         chat.Focus();
                         found = true;
                     }
                 }
                 if (!found)
                 {
                     chat.AddChat(selected, sid);
                     chat.Focus();
                 }
             }
         }
     }));
 }
예제 #7
0
파일: Friends.cs 프로젝트: Jamyn/Mist
 private void inviteToTradeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         ulong sid = Convert.ToUInt64(column_sid.GetValue(friends_list.SelectedItem.RowObject));
         string selected = bot.SteamFriends.GetFriendPersonaName(sid);
         if (!chat_opened)
         {
             chat = new Chat(bot);
             chat.AddChat(selected, sid);
             chat.Show();
             chat.Focus();
             chat_opened = true;
             chat.chatTab.tradeClicked();
         }
         else
         {
             bool found = false;
             foreach (TabPage tab in Friends.chat.ChatTabControl.TabPages)
             {
                 if (tab.Text == selected)
                 {
                     found = true;
                     tab.Invoke((Action)(() =>
                     {
                         foreach (var item in tab.Controls)
                         {
                             chat.chatTab = (ChatTab) item;
                             chat.chatTab.tradeClicked();
                         }
                     }));
                     return;
                 }
             }
             if (!found)
             {
                 chat.AddChat(selected, sid);
                 chat.Focus();
                 chat.chatTab.tradeClicked();
             }
         }
     }));
 }
예제 #8
0
파일: Friends.cs 프로젝트: Jamyn/Mist
 private void friends_list_ItemActivate(object sender, EventArgs e)
 {
     bot.main.Invoke((Action)(() =>
     {
         string selected = "";
         try
         {
             selected = friends_list.SelectedItem.Text;
         }
         catch
         {
             selected = null;
         }
         if (selected != null)
         {
             ulong sid = ListFriends.GetSID(selected);
             if (!chat_opened)
             {
                 chat = new Chat(bot);
                 chat.AddChat(selected, sid);
                 chat.Show();
                 chat.Activate();
                 chat_opened = true;
             }
             else
             {
                 bool found = false;
                 foreach (TabPage tab in chat.ChatTabControl.TabPages)
                 {
                     if (tab.Text == selected)
                     {
                         chat.ChatTabControl.SelectedTab = tab;
                         chat.Activate();
                         found = true;
                     }
                 }
                 if (!found)
                 {
                     chat.AddChat(selected, sid);
                     chat.Activate();
                 }
             }
         }
     }));
 }