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(); } }
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(); }
void StartExecution() { DisableAllButtons(); StatusTB.Text = "Executing..."; OutputTB.ClearData(); InputString = InputTB.GetText(); InputBytes = InputTB.GetBytes(); //Input = InputTB.GetText(); T = new Thread(ExecuteCommand); T.Start(); }
private void EncodeOutToEncodeInBtn_Click(object sender, EventArgs e) { if (ShouldGetBytesFromResult()) { InputTB.SetBytes(OutputTB.GetBytes()); } else { InputTB.SetText(OutputTB.GetText()); } }
private void EncodeOutToEncodeInBtn_Click(object sender, EventArgs e) { if (OutputTB.IsBinary) { InputTB.SetBytes(OutputTB.GetBytes()); } else { InputTB.SetText(OutputTB.GetText()); } }
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); }
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(); } }
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(); }
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"; } }
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"; }
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(); } }
private void ClearButton_Click(object sender, RoutedEventArgs e) { OutputTB.Clear(); }