Beispiel #1
0
 private void PropButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DirectoryControll controll = Table.SelectedItem as DirectoryControll;
         Connection.SendMessage(new MessageClass(Connection.ID, UserID, Commands.GetDirInfo, ID, controll.FullName));
     }
     catch { }
 }
Beispiel #2
0
 private void Table_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         DirectoryControll controll = Table.SelectedItem as DirectoryControll;
         Connection.SendMessage(new MessageClass(Connection.ID, UserID, Commands.CD, ID, controll.FullName));
     }
     catch { }
 }
Beispiel #3
0
 private void DownloadButton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Loading = new LoadingWindow();
         Loading.Show();
         DirectoryControll controll = Table.SelectedItem as DirectoryControll;
         Connection.SendMessage(new MessageClass(Connection.ID, UserID, Commands.StartDownload, ID, controll.FullName));
     }
     catch { }
 }
Beispiel #4
0
        private void RunWithButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DirectoryControll controll = Table.SelectedItem as DirectoryControll;

                TextWindow textWindow = new TextWindow(false);
                textWindow.Owner = this;
                textWindow.ShowDialog();

                Connection.SendMessage(new MessageClass(Connection.ID, UserID, Commands.RunWith, ID, controll.FullName + ";" + textWindow.TextBox.Text));
            }
            catch { }
        }
Beispiel #5
0
        public void SetDirs(byte[] data)
        {
            DirMessage msg;

            using (var ms = new MemoryStream(data))
            {
                msg = new BinaryFormatter().Deserialize(ms) as DirMessage;
            }

            if (msg.Path.IndexOf("<Error>") > -1)
            {
                MessageBox.Show(msg.Path);
                return;
            }

            Dispatcher.Invoke(Table.Items.Clear);
            PathBox.Text = msg.Path;

            if (msg.Path == "")
            {
                if (msg.Drives != null)
                {
                    for (int i = 0; i < msg.Drives.Length; i++)
                    {
                        Dispatcher.Invoke(() =>
                        {
                            DirectoryControll controll = new DirectoryControll(msg.Drives[i]);
                            Table.Items.Add(controll);
                        });
                    }
                }

                return;
            }

            Dispatcher.Invoke(() =>
            {
                DirectoryControll controll = new DirectoryControll(System.IO.Path.GetDirectoryName(msg.Path));
                Table.Items.Add(controll);
            });

            if (msg.Directories != null)
            {
                for (int i = 0; i < msg.Directories.Length; i++)
                {
                    Dispatcher.Invoke(() =>
                    {
                        DirectoryControll controll = new DirectoryControll(msg.Directories[i]);
                        Table.Items.Add(controll);
                    });
                }
            }

            if (msg.Files != null)
            {
                for (int i = 0; i < msg.Files.Length; i++)
                {
                    Dispatcher.Invoke(() =>
                    {
                        DirectoryControll controll = new DirectoryControll(msg.Files[i]);
                        Table.Items.Add(controll);
                    });
                }
            }
        }