Exemple #1
0
        protected override void OnSelectionChanged(SelectionChangedEventArgs e)
        {
            base.OnSelectionChanged(e);

            selected_serverinfo_textblock = this.SelectedItem as ServerInfoTextBlock;
            if (selected_serverinfo_textblock == null)
            {
                if (CommandView.current != null)
                {
                    CommandView.current.Visibility = Visibility.Hidden;
                }
                return;
            }

            if (CommandView.current != null)
            {
                CommandView.current.Visibility = Visibility.Visible;
            }
            CommandView.refresh(selected_serverinfo_textblock);

            LinuxTreeViewItem.Refresh();
        }
        private static void sendCommand(string command)
        {
            //LinuxTreeViewItem.ReconnectServer();
            //LinuxTreeViewItem.ReConnect();
            LinuxTreeViewItem.ReConnect(1000);

            try
            {
                // send
                if (shell_stream != null)
                {
                    shell_stream.Write(command);
                    shell_stream.Write("\n");
                    shell_stream.Flush();
                    Log.Print(command, "send command" /*, test4.m_wnd.richTextBox_status*/);
                }
            }
            catch (Exception ex)
            {
                Log.PrintError(ex.Message, "send command", WindowMain.m_wnd.richTextBox_status);
            }
        }
Exemple #3
0
        void loadDirectory()
        {
            SftpFile[] files = PollListInDirectory();
            foreach (var file in files)
            {
                int i;
                for (i = 0; i < IGNORE_FILENAME.Length; i++)
                {
                    if (file.Name == IGNORE_FILENAME[i])
                    {
                        break;
                    }
                }
                if (i != IGNORE_FILENAME.Length)
                {
                    continue;
                }

                LinuxTreeViewItem ltvi;
                if (file.IsDirectory)
                {
                    //this.Items.Insert(0, new LinuxTreeViewItem(file.FullName, file.Name, true));
                    //this.Items.Add(new LinuxTreeViewItem(file.FullName, file.Name, true));
                    ltvi = new LinuxTreeViewItem(file.FullName, file.Name, true);
                    this.Items.Insert(0, ltvi);
                }
                else
                {
                    //this.Items.Insert(0, new LinuxTreeViewItem(file.FullName, file.Name, false));
                    ltvi = new LinuxTreeViewItem(file.FullName, file.Name, false);
                    this.Items.Add(ltvi);
                    //if(file.Name.Substring(file.Name.Length - test_filter.Length, test_filter.Length) != test_filter)
                    //	ltvi.Visibility = Visibility.Collapsed;
                }
            }
        }