void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.DlgPasswordChange = ((PNotes.NET.WndPasswordChange)(target)); #line 20 "..\..\WndPasswordChange.xaml" this.DlgPasswordChange.Loaded += new System.Windows.RoutedEventHandler(this.DlgPasswordChange_Loaded); #line default #line hidden return; case 2: this.lblOldPwrd = ((System.Windows.Controls.TextBlock)(target)); return; case 3: this.txtOldPwrd = ((System.Windows.Controls.PasswordBox)(target)); #line 32 "..\..\WndPasswordChange.xaml" this.txtOldPwrd.PasswordChanged += new System.Windows.RoutedEventHandler(this.txtEnterPwrd_PasswordChanged); #line default #line hidden return; case 4: this.lblEnterPwrd = ((System.Windows.Controls.TextBlock)(target)); return; case 5: this.txtEnterPwrd = ((System.Windows.Controls.PasswordBox)(target)); #line 34 "..\..\WndPasswordChange.xaml" this.txtEnterPwrd.PasswordChanged += new System.Windows.RoutedEventHandler(this.txtEnterPwrd_PasswordChanged); #line default #line hidden return; case 6: this.lblConfirmPwrd = ((System.Windows.Controls.TextBlock)(target)); return; case 7: this.txtConfirmPwrd = ((System.Windows.Controls.PasswordBox)(target)); #line 36 "..\..\WndPasswordChange.xaml" this.txtConfirmPwrd.PasswordChanged += new System.Windows.RoutedEventHandler(this.txtEnterPwrd_PasswordChanged); #line default #line hidden return; case 8: this.cmdOK = ((System.Windows.Controls.Button)(target)); #line 42 "..\..\WndPasswordChange.xaml" this.cmdOK.Click += new System.Windows.RoutedEventHandler(this.cmdOK_Click); #line default #line hidden return; case 9: this.cmdCancel = ((System.Windows.Controls.Button)(target)); return; } this._contentLoaded = true; }
private void cmdChangePwrd_Click(object sender, RoutedEventArgs e) { try { // if new password has been applied or old password has not been changed - show standard password changing dialog if (PNStatic.Settings.Protection.PasswordString == _TempSettings.Protection.PasswordString) { var dpc = new WndPasswordChange(); dpc.PasswordChanged += dpc_PasswordChanged; var showDialog = dpc.ShowDialog(); if (showDialog == null || !showDialog.Value) { dpc.PasswordChanged -= dpc_PasswordChanged; } } else { // if new password has not been applied and old password is empty - show standard password creation dialog if (PNStatic.Settings.Protection.PasswordString.Trim().Length == 0) { var dpc = new WndPasswordCreate(); dpc.PasswordChanged += dpc_PasswordChanged; var showDialog = dpc.ShowDialog(); if (showDialog == null || !showDialog.Value) { dpc.PasswordChanged -= dpc_PasswordChanged; } } else { // otherwise show standard password changing dialog using old password var dpc = new WndPasswordChange(); dpc.PasswordChanged += dpc_PasswordChanged; var showDialog = dpc.ShowDialog(); if (showDialog == null || !showDialog.Value) { dpc.PasswordChanged -= dpc_PasswordChanged; } } } } catch (Exception ex) { PNStatic.LogException(ex); } }
private void actionChangePassword() { try { var dpc = new WndPasswordChange { Owner = this }; dpc.PasswordChanged += dpc_PasswordChanged; var showDialog = dpc.ShowDialog(); if (showDialog == null || !showDialog.Value) { dpc.PasswordChanged -= dpc_PasswordChanged; } } catch (Exception ex) { PNStatic.LogException(ex); } }