예제 #1
0
 private void Disconnect_Click(object sender, EventArgs e)
 {
     foreach (ToolStripMenuItem connection in this.connections.DropDownItems)
     {
         if (connection.Tag == ((ContextMenuStrip)sender).Tag)
         {
             this.connections.DropDownItems.Remove(connection);
             break;
         }
     }
     SSH.StopForwarding((int)((ContextMenuStrip)sender).Tag);
 }
예제 #2
0
        private void Disconnect_Click(object sender, RoutedEventArgs e)
        {
            var indexes = (Tuple <int, int, string>)((Button)sender).Tag;

            devices_list[indexes.Item2].Item5.Content = "Connect";
            devices_list[indexes.Item2].Item5.Tag     = indexes.Item2;
            devices_list[indexes.Item2].Item5.Click  += Connect_Click;
            devices_list[indexes.Item2].Item5.Click  -= Disconnect_Click;
            devices_list[indexes.Item2].Item1.Fill    = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#f24569"));
            devices_list[indexes.Item2].Item1.ToolTip = null;
            ((App)Application.Current).RemoveConnectionToContextMenu("Disconnect from " + indexes.Item3);
            SSH.StopForwarding(indexes.Item1);
        }