private bool _UVncHelper1_ValidateAccountOrOpenInputAccountBoxEvent(object sender, UVncOption option) { return((bool)this.Dispatcher.Invoke(new Func <bool>(() => { InputAccountWindow inputAccountWindow = new InputAccountWindow(); inputAccountWindow.Owner = this; inputAccountWindow.ShowDialog(); var input = UVncOption.ValidateInputAccount(); return input; }))); }
private void Application_Startup(object sender, StartupEventArgs e) { if (e != null && e.Args != null) { UVncOption.ToLauchRemoteSupportGetArguments(e.Args); } else { UVncOption.ToLauchRemoteSupportGetArguments(null); } }
private void btnOK_Click(object sender, RoutedEventArgs e) { e.Handled = true; UVncOption.AdminUser = txtAdminUser.Text?.Trim(); UVncOption.AdminPasswd = txtAdminPasswd.Password?.Trim(); if (UVncOption.ValidateInputAccount()) { Close(); } else { txtAdminUser.Clear(); txtAdminPasswd.Clear(); } }
private bool _UVncHelper1_ShowProgressBarEvent(object sender, UVncOption option) { var vnc = (UVncHelper)sender; if (vnc.IsShowProgressBar) { this.Dispatcher.Invoke(new Action(() => { this.IsEnabled = false; progressBar1.Visibility = Visibility.Visible; })); } else { this.Dispatcher.Invoke(new Action(() => { this.IsEnabled = true; progressBar1.Visibility = Visibility.Hidden; })); } return(true); }
private void VNCHelpInitial() { try { txtBlockHostName.Text = UVncOption.HostName; txtBlockHostIP.Text = UVncOption.HostIP; _UVncHelper1 = new UVncHelper(UVncOption.GetUVncInstance()); // 訂閱事件 SubscribeUVncHelperEvent(); // binding 依賴屬性 BindingVNCNotity(); // 啟動 winvnc.exe LaunchRemoteSupport(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }