コード例 #1
0
        private void Chat_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MainWindow wind = (MainWindow)Window.GetWindow(this);
                if ((SettingsServer.MyItem)dtgClients.SelectedItem == null)
                {
                    wind.chatControl.chatPlace.Children.Clear(); return;
                }
                SettingsServer.MyItem myItem = (SettingsServer.MyItem)dtgClients.SelectedItem;
                SettingsServer        stg    = (SettingsServer)wind.stgServer;
                wind.chatControl.chatPlace.Children.Clear();
                Chat chat = stg.chats[Convert.ToInt32(myItem.ID)];
                chat.title.Text   = "Чат с " + myItem.Tag + " (" + myItem.IP + ")";
                chat.ConnectionID = Convert.ToInt32(myItem.ID);
                wind.chatControl.chatPlace.Children.Add(chat);

                wind.GridMain.Children.Clear();
                wind.GridMain.Children.Add(wind.chatControl);
                wind.chatControl.dtgClients.ItemsSource = dtgClients.Items;
                wind.chatControl.dtgClients.Items.Refresh();
            }
            catch
            {
            }
        }
コード例 #2
0
        private void tglServer_Click(object sender, RoutedEventArgs e)
        {
            SettingsServer stg = (SettingsServer)wind.stgServer;

            stg.Button_Click(null, null);
            this.Aud.Content         = wind.AC.Text;
            this.Serv.Content        = wind.serverText.Text;
            this.Resources["SBrush"] = new SolidColorBrush(((SolidColorBrush)wind.serverInd.Fill).Color);
        }
コード例 #3
0
 private void RemoteDesktop_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SettingsServer.MyItem myItem = (SettingsServer.MyItem)dtgClients.SelectedItem;
         SettingsServer.RemoteDesktop_Click(myItem.ID);
     }
     catch
     {
     }
 }
コード例 #4
0
        private void notifOff_Click(object sender, RoutedEventArgs e)
        {
            SettingsServer stg = (SettingsServer)wind.stgServer;

            stg.notify.IsChecked = !stg.notify.IsChecked;
            if (stg.notify.IsChecked.Value)
            {
                notif.Content = "Откл. уведомления";
            }
            else
            {
                notif.Content = "Вкл. уведомления";
            }
        }
コード例 #5
0
 private void dtgClients_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         if ((SettingsServer.MyItem)dtgClients.SelectedItem == null)
         {
             chatPlace.Children.Clear(); return;
         }
         SettingsServer.MyItem myItem = (SettingsServer.MyItem)dtgClients.SelectedItem;
         SettingsServer        stg    = (SettingsServer)wind.stgServer;
         chatPlace.Children.Clear();
         Chat chat = stg.chats[Convert.ToInt32(myItem.ID)];
         chat.title.Text   = "Чат с " + myItem.Tag + " (" + myItem.IP + ")";
         chat.ConnectionID = Convert.ToInt32(myItem.ID);
         chatPlace.Children.Add(chat);
     }
     catch
     {
     }
 }