예제 #1
0
        void ShowInput(bool Multiline)
        {
            if (this.IsDisposed)
            {
                return;
            }
            if (this.InvokeRequired)
            {
                ShowInput_d SI = new ShowInput_d(ShowInput);
                this.Invoke(SI, new object[] { Multiline });
            }
            else
            {
                InputTB.Text = "";

                BaseSplit.Panel2Collapsed = false;

                InputTB.Multiline = Multiline;
                if (Multiline)
                {
                    InputTB.Height     = BaseSplit.Panel2.Height - 70;
                    InputTB.ScrollBars = ScrollBars.Both;
                    InputLbl.Text      = "Enter your input below and press the 'Submit' button:";
                }
                else
                {
                    InputLbl.Text = "Enter your input below and press hit the enter key or press the 'Submit' button:";
                }
                OutputTB.SelectionStart = OutputTB.Text.Length;
                OutputTB.ScrollToCaret();
                InputTB.Focus();
            }
        }
예제 #2
0
 private async void ExecuteBttn_Click(object sender, EventArgs _)
 {
     if (InputTB.Text.Length == 0)
     {
         MessageBox.Show("No Command Provided!");
         return;
     }
     OutputTB.AppendText(await exec.CommandExec(InputTB.Text));
     InputTB.Clear();
 }
예제 #3
0
 void StartExecution()
 {
     DisableAllButtons();
     StatusTB.Text = "Executing...";
     OutputTB.ClearData();
     InputString = InputTB.GetText();
     InputBytes  = InputTB.GetBytes();
     //Input = InputTB.GetText();
     T = new Thread(ExecuteCommand);
     T.Start();
 }
예제 #4
0
 private void EncodeOutToEncodeInBtn_Click(object sender, EventArgs e)
 {
     if (ShouldGetBytesFromResult())
     {
         InputTB.SetBytes(OutputTB.GetBytes());
     }
     else
     {
         InputTB.SetText(OutputTB.GetText());
     }
 }
예제 #5
0
 private void EncodeOutToEncodeInBtn_Click(object sender, EventArgs e)
 {
     if (OutputTB.IsBinary)
     {
         InputTB.SetBytes(OutputTB.GetBytes());
     }
     else
     {
         InputTB.SetText(OutputTB.GetText());
     }
 }
예제 #6
0
 public void WriteLog(string inp, bool isImportant = false)
 {
     Dispatcher.InvokeAsync(() =>
     {
         var para = new Paragraph();
         para.Inlines.Add(new Run()
         {
             Text = inp, Foreground = isImportant ? ImportantBrush : NormalBrush
         });
         OutputTB.Document.Blocks.Add(para);
         OutputTB.ScrollToEnd();
     }, System.Windows.Threading.DispatcherPriority.Background);
 }
예제 #7
0
 private async void StepBttn_Click(object sender, EventArgs _)
 {
     if (FilenameTB.Text.Length == 0)
     {
         MessageBox.Show("File Not Provided!");
         return;
     }
     if (commands.Count == 0)
     {
         return;
     }
     OutputTB.AppendText(await exec.CommandExec(commands.First.Value));
     commands.RemoveFirst();
     if (commands.Count == 0)
     {
         FilenameTB.Clear();
     }
 }
예제 #8
0
 private async void SeqBttn_Click(object sender, EventArgs _)
 {
     if (FilenameTB.Text.Length == 0)
     {
         MessageBox.Show("File Not Provided!");
         return;
     }
     if (commands.Count == 0)
     {
         return;
     }
     foreach (var c in commands)
     {
         OutputTB.AppendText(await exec.CommandExec(c));
     }
     commands.Clear();
     FilenameTB.Clear();
 }
예제 #9
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            Account account;

            OutputTB.Clear();
            account = CoreDataRepository.Accounts.GetByUserName(useridTB.Text);
            AuthenticationResult result = Authenticate(useridTB.Text, passwordTB.Password, out account);

            if (result.Status == AuthenticationStatus.Success)
            {
                CurrentAccountID = account.ID;
                Contact     contact     = Repository.Contacts.GetByAccount(account);
                TestControl testControl = new TestControl();
                testControl.DataRepository = DataRepository;
                this.Content = testControl;
            }
            else
            {
                OutputTB.Text = "Invalid Login";
            }
        }
예제 #10
0
        private void DownloadBtn_Click(object sender, RoutedEventArgs e)
        {
            ftp ftpClient = new ftp(HostTB.Text, UserTB.Text, PasswordTB.Password);

            if (OperationSelectLB.SelectedIndex == 0)
            {
                ftpClient.upload(RemoteFilenameTB.Text, LocalFilenameTB.Text);
            }
            else
            {
                // ftpClient.upload(RemoteFilenameTB.Text, LocalFilenameTB.Text);
                string[] files = ftpClient.directoryListSimple(RemoteFilenameTB.Text);

                OutputTB.Clear();
                foreach (String filename in files)
                {
                    OutputTB.Text += String.Format("{0}\n", filename);
                }
            }
            OutputTB.Text += "Done";
        }
예제 #11
0
 internal void ShowEncodeDecodeResult(byte[] Result, string Message)
 {
     if (this.InvokeRequired)
     {
         ShowEncodeDecodeResultBytes_d SEDR_d = new ShowEncodeDecodeResultBytes_d(ShowEncodeDecodeResult);
         this.Invoke(SEDR_d, new object[] { Result, Message });
     }
     else
     {
         OutputTB.SetBytes(Result);
         if (Message.Length > 0)
         {
             StatusTB.BackColor = Color.Red;
         }
         else
         {
             StatusTB.BackColor = SystemColors.Control;
         }
         StatusTB.Text = Message;
         EnableAllEncodeDecodeCommandButtons();
     }
 }
예제 #12
0
 private void ClearButton_Click(object sender, RoutedEventArgs e)
 {
     OutputTB.Clear();
 }