/// <summary>
 /// Event handler for form closing
 /// Check if settings are changed, and ask the user if he wants to save settings if needed
 /// Then hides the settings form if this event comes from the close button, or completely exit if it comes from tray context menu "Exit" button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">The event object, will be used to cancel closing event if needed</param>
 private void Form_FormClosing(object sender, FormClosingEventArgs e)
 {
     //Cancel closing event if it is not from tray context menu
     if (!exiting)
     {
         e.Cancel = true;
     }
     //If the user changed any settings, ask him what to do
     if (settingsChanged)
     {
         if (MessageBox.Show("You have changed some settings, do you want to apply them? ", "Hourly Reminder", MessageBoxButtons.YesNo) == DialogResult.Yes)
         {
             //Yes clicked, apply
             BtnApply.PerformClick();
         }
         else
         {
             //No clicked, cancel
             BtnCancel.PerformClick();
         }
     }
     else
     {
         //Nothing changed, simply hide the form
         this.Hide();
     }
 }
        /// <summary>
        /// Applicant applies for a new loan
        /// </summary>
        /// <param name="income"></param>
        /// <param name="loanAmt"></param>
        /// <param name="currTestContext"></param>
        /// <param name="screenShotDir"></param>
        /// <returns>True if application was sent successfully, false otherwise</returns>
        public bool applicantApply(string income, string loanAmt,
                                   TestContext currTestContext, string screenShotDir)
        {
            bool appliedSuccessfully = false;

            try
            {
                // set the yearly income
                TxtFeildYearlyIncome.Clear();
                TxtFeildYearlyIncome.SendKeys(income);

                // select the loan amount
                CmbFieldAmount.Click();
                new SelectElement(CmbFieldAmount).SelectByText(loanAmt);


                //Take screenshot before applicant applies for loan
                var fileName = TakeScreenShot(currTestContext, screenShotDir);

                // store filename
                if (fileName != null)
                {
                    ScreenshotFileCollnt.Add(fileName);
                }

                // apply for loan
                BtnApply.Click();

                // Take screenshot after applicant applies for loan
                fileName = TakeScreenShot(currTestContext, screenShotDir);

                // store filename
                if (fileName != null)
                {
                    ScreenshotFileCollnt.Add(fileName);
                }

                appliedSuccessfully = true;
            } catch (Exception) {
                appliedSuccessfully = false;
            }

            return(appliedSuccessfully);
        }
        void ReleaseDesignerOutlets()
        {
            if (AssertTableView != null)
            {
                AssertTableView.Dispose();
                AssertTableView = null;
            }

            if (AttributeTableView != null)
            {
                AttributeTableView.Dispose();
                AttributeTableView = null;
            }

            if (BtnAddAssertServices != null)
            {
                BtnAddAssertServices.Dispose();
                BtnAddAssertServices = null;
            }

            if (BtnAddAttributeService != null)
            {
                BtnAddAttributeService.Dispose();
                BtnAddAttributeService = null;
            }

            if (BtnAddSignAlgo != null)
            {
                BtnAddSignAlgo.Dispose();
                BtnAddSignAlgo = null;
            }

            if (BtnApply != null)
            {
                BtnApply.Dispose();
                BtnApply = null;
            }

            if (BtnAddSloService != null)
            {
                BtnAddSloService.Dispose();
                BtnAddSloService = null;
            }

            if (BtnRemoveSloService != null)
            {
                BtnRemoveSloService.Dispose();
                BtnRemoveSloService = null;
            }

            if (BtnBrowseCertificate != null)
            {
                BtnBrowseCertificate.Dispose();
                BtnBrowseCertificate = null;
            }

            if (BtnRemoveAssertService != null)
            {
                BtnRemoveAssertService.Dispose();
                BtnRemoveAssertService = null;
            }

            if (BtnRemoveAttributeService != null)
            {
                BtnRemoveAttributeService.Dispose();
                BtnRemoveAttributeService = null;
            }

            if (BtnRemoveSignAlgo != null)
            {
                BtnRemoveSignAlgo.Dispose();
                BtnRemoveSignAlgo = null;
            }

            if (BtnViewCertificate != null)
            {
                BtnViewCertificate.Dispose();
                BtnViewCertificate = null;
            }

            if (ChkSign != null)
            {
                ChkSign.Dispose();
                ChkSign = null;
            }

            if (SignAlgorithmTableView != null)
            {
                SignAlgorithmTableView.Dispose();
                SignAlgorithmTableView = null;
            }

            if (SloServicesTableView != null)
            {
                SloServicesTableView.Dispose();
                SloServicesTableView = null;
            }

            if (TxtCertificate != null)
            {
                TxtCertificate.Dispose();
                TxtCertificate = null;
            }

            if (TxtRpName != null)
            {
                TxtRpName.Dispose();
                TxtRpName = null;
            }

            if (TxtUrl != null)
            {
                TxtUrl.Dispose();
                TxtUrl = null;
            }
        }
		void ReleaseDesignerOutlets ()
		{
			if (CbTokenAuthMethod != null) {
				CbTokenAuthMethod.Dispose ();
				CbTokenAuthMethod = null;
			}

			if (BtnAddPostLogoutRedirectUri != null) {
				BtnAddPostLogoutRedirectUri.Dispose ();
				BtnAddPostLogoutRedirectUri = null;
			}

			if (BtnAddRedirectUri != null) {
				BtnAddRedirectUri.Dispose ();
				BtnAddRedirectUri = null;
			}

			if (BtnApply != null) {
				BtnApply.Dispose ();
				BtnApply = null;
			}

			if (BtnBrowseCertificate != null) {
				BtnBrowseCertificate.Dispose ();
				BtnBrowseCertificate = null;
			}

			if (BtnRemovePostLogoutRedirectUri != null) {
				BtnRemovePostLogoutRedirectUri.Dispose ();
				BtnRemovePostLogoutRedirectUri = null;
			}

			if (BtnRemoveRedirectUri != null) {
				BtnRemoveRedirectUri.Dispose ();
				BtnRemoveRedirectUri = null;
			}

			if (PostLogoutRedirectUriTableView != null) {
				PostLogoutRedirectUriTableView.Dispose ();
				PostLogoutRedirectUriTableView = null;
			}

			if (RedirectUriTableView != null) {
				RedirectUriTableView.Dispose ();
				RedirectUriTableView = null;
			}

			if (TxtCertificateDN != null) {
				TxtCertificateDN.Dispose ();
				TxtCertificateDN = null;
			}

			if (TxtLogoutUrl != null) {
				TxtLogoutUrl.Dispose ();
				TxtLogoutUrl = null;
			}

			if (TxtName != null) {
				TxtName.Dispose ();
				TxtName = null;
			}

			if (TxtPostLogoutRedirectUri != null) {
				TxtPostLogoutRedirectUri.Dispose ();
				TxtPostLogoutRedirectUri = null;
			}

			if (TxtRedirectUri != null) {
				TxtRedirectUri.Dispose ();
				TxtRedirectUri = null;
			}
		}
Beispiel #5
0
        void ReleaseDesignerOutlets()
        {
            if (BtnAddGroup != null)
            {
                BtnAddGroup.Dispose();
                BtnAddGroup = null;
            }

            if (BtnApply != null)
            {
                BtnApply.Dispose();
                BtnApply = null;
            }

            if (BtnRemoveGroup != null)
            {
                BtnRemoveGroup.Dispose();
                BtnRemoveGroup = null;
            }

            if (ChActAsUser != null)
            {
                ChActAsUser.Dispose();
                ChActAsUser = null;
            }

            if (ChIdpAdmin != null)
            {
                ChIdpAdmin.Dispose();
                ChIdpAdmin = null;
            }

            if (chkActive != null)
            {
                chkActive.Dispose();
                chkActive = null;
            }

            if (MemberTableView != null)
            {
                MemberTableView.Dispose();
                MemberTableView = null;
            }

            if (RdoRoleGroup != null)
            {
                RdoRoleGroup.Dispose();
                RdoRoleGroup = null;
            }

            if (TxtDescription != null)
            {
                TxtDescription.Dispose();
                TxtDescription = null;
            }

            if (TxtEmail != null)
            {
                TxtEmail.Dispose();
                TxtEmail = null;
            }

            if (TxtFirstName != null)
            {
                TxtFirstName.Dispose();
                TxtFirstName = null;
            }

            if (TxtLastName != null)
            {
                TxtLastName.Dispose();
                TxtLastName = null;
            }

            if (TxtUsername != null)
            {
                TxtUsername.Dispose();
                TxtUsername = null;
            }

            if (LoginAsUser != null)
            {
                LoginAsUser.Dispose();
                LoginAsUser = null;
            }
        }
Beispiel #6
0
        void IndividualEditPanel_Loaded(object sender, RoutedEventArgs e)
        {
            this.ParentWindow = Window.GetWindow(this);
            if (this.ParentWindow == null)
            {
                throw new InternalAnomaly("Window cannot be obtained for this UserControl.");
            }

            this.BtnApply = this.GetTemplateChild <PaletteButton>("BtnApply");
            BtnApply.SetVisible(this.ShowApply, true);

            //this.BtnRefresh = this.GetTemplateChild<PaletteButton>("BtnRefresh");
            //BtnRefresh.SetVisible(this.ShowRefresh, false);

            this.BtnAdvanced = this.GetTemplateChild <PaletteToggleButton>("BtnAdvanced");

            this.BtnHelp = this.GetTemplateChild <PaletteButton>("BtnHelp");
            BtnHelp.SetVisible(this.HasHelpForShowing, false);

            this.BtnOK     = this.GetTemplateChild <PaletteButton>("BtnOK");
            this.BtnCancel = this.GetTemplateChild <PaletteButton>("BtnCancel");

            this.ShowAdvancedMembers   = AppExec.GetConfiguration <bool>("UserInterface", "ShowAdvancedProperties", false);
            this.BtnAdvanced.IsChecked = this.ShowAdvancedMembers;

            this.ParentWindow.Loaded  += new RoutedEventHandler(ParentWindow_Loaded);
            this.ParentWindow.Closing += new System.ComponentModel.CancelEventHandler(ParentWindow_Closing);
            this.ParentWindow.Closed  += new EventHandler(ParentWindow_Closed);

            this.BtnHelp.SetVisible(this.HasHelpForShowing);

            // Asked here because may have been setted before template load
            if (!this.CanCancelEditing)
            {
                this.BtnCancel.IsEnabled = false;
            }

            // Append extra buttons
            var PnlButtons = this.GetTemplateChild <Panel>("PnlButtons");

            if (PnlButtons != null && this.ExtraButtons != null && this.ExtraButtons.Count > 0)
            {
                foreach (var Extra in this.ExtraButtons)
                {
                    var LocalExtra = Extra;
                    var NewButton  = new PaletteButton(LocalExtra.Item1, LocalExtra.Item3, Summary: LocalExtra.Item2);
                    NewButton.Margin = new Thickness(2);
                    NewButton.Click += ((sndr, args) => LocalExtra.Item4(this.AssociatedEntity));
                    PnlButtons.Children.Add(NewButton);
                }
            }

            // Set header
            var Header = Display.GetTemplateChild <Border>(this, "BrdHeader");

            if (Header == null)
            {
                return;
            }

            Header.Child = this.HeaderContent;
            Header.SetVisible(this.HeaderContent != null);
        }
Beispiel #7
0
        void ReleaseDesignerOutlets()
        {
            if (UserClassName != null)
            {
                UserClassName.Dispose();
                UserClassName = null;
            }

            if (TxtPasswordClassName != null)
            {
                TxtPasswordClassName.Dispose();
                TxtPasswordClassName = null;
            }

            if (TxtDomainClassName != null)
            {
                TxtDomainClassName.Dispose();
                TxtDomainClassName = null;
            }

            if (TxtGroupClassName != null)
            {
                TxtGroupClassName.Dispose();
                TxtGroupClassName = null;
            }

            if (AttributeMapTableView != null)
            {
                AttributeMapTableView.Dispose();
                AttributeMapTableView = null;
            }

            if (BtnAddAttribute != null)
            {
                BtnAddAttribute.Dispose();
                BtnAddAttribute = null;
            }

            if (BtnAddDomainSchemaAttribute != null)
            {
                BtnAddDomainSchemaAttribute.Dispose();
                BtnAddDomainSchemaAttribute = null;
            }

            if (BtnAddGroupSchemaAttribute != null)
            {
                BtnAddGroupSchemaAttribute.Dispose();
                BtnAddGroupSchemaAttribute = null;
            }

            if (BtnAddPasswordSchemaAttribute != null)
            {
                BtnAddPasswordSchemaAttribute.Dispose();
                BtnAddPasswordSchemaAttribute = null;
            }

            if (BtnAddUserSchemaAttribute != null)
            {
                BtnAddUserSchemaAttribute.Dispose();
                BtnAddUserSchemaAttribute = null;
            }

            if (BtnApply != null)
            {
                BtnApply.Dispose();
                BtnApply = null;
            }

            if (BtnBaseDnForNestedGroups != null)
            {
                BtnBaseDnForNestedGroups.Dispose();
                BtnBaseDnForNestedGroups = null;
            }

            if (BtnClose != null)
            {
                BtnClose.Dispose();
                BtnClose = null;
            }

            if (BtnGroupSearch != null)
            {
                BtnGroupSearch.Dispose();
                BtnGroupSearch = null;
            }

            if (BtnMatchRuleInChain != null)
            {
                BtnMatchRuleInChain.Dispose();
                BtnMatchRuleInChain = null;
            }

            if (BtnRemoveAttribute != null)
            {
                BtnRemoveAttribute.Dispose();
                BtnRemoveAttribute = null;
            }

            if (BtnRemoveDomainSchemaAttribute != null)
            {
                BtnRemoveDomainSchemaAttribute.Dispose();
                BtnRemoveDomainSchemaAttribute = null;
            }

            if (BtnRemoveGroupSchemaAttribute != null)
            {
                BtnRemoveGroupSchemaAttribute.Dispose();
                BtnRemoveGroupSchemaAttribute = null;
            }

            if (BtnRemovePasswordSchemaAttribute != null)
            {
                BtnRemovePasswordSchemaAttribute.Dispose();
                BtnRemovePasswordSchemaAttribute = null;
            }

            if (BtnRemoveUserSchemaAttribute != null)
            {
                BtnRemoveUserSchemaAttribute.Dispose();
                BtnRemoveUserSchemaAttribute = null;
            }

            if (DomainAttributesTableView != null)
            {
                DomainAttributesTableView.Dispose();
                DomainAttributesTableView = null;
            }

            if (DomainList != null)
            {
                DomainList.Dispose();
                DomainList = null;
            }

            if (GroupAttributes != null)
            {
                GroupAttributes.Dispose();
                GroupAttributes = null;
            }

            if (GroupAttributesTableView != null)
            {
                GroupAttributesTableView.Dispose();
                GroupAttributesTableView = null;
            }

            if (PasswordAttributeList != null)
            {
                PasswordAttributeList.Dispose();
                PasswordAttributeList = null;
            }

            if (PasswordTableView != null)
            {
                PasswordTableView.Dispose();
                PasswordTableView = null;
            }

            if (TxtAttributeName != null)
            {
                TxtAttributeName.Dispose();
                TxtAttributeName = null;
            }

            if (TxtAttributeValue != null)
            {
                TxtAttributeValue.Dispose();
                TxtAttributeValue = null;
            }

            if (TxtDomainValue != null)
            {
                TxtDomainValue.Dispose();
                TxtDomainValue = null;
            }

            if (TxtGroupValue != null)
            {
                TxtGroupValue.Dispose();
                TxtGroupValue = null;
            }

            if (TxtPasswordValue != null)
            {
                TxtPasswordValue.Dispose();
                TxtPasswordValue = null;
            }

            if (TxtUserAttributeValue != null)
            {
                TxtUserAttributeValue.Dispose();
                TxtUserAttributeValue = null;
            }

            if (UsersAttributeList != null)
            {
                UsersAttributeList.Dispose();
                UsersAttributeList = null;
            }

            if (UsersMapTableView != null)
            {
                UsersMapTableView.Dispose();
                UsersMapTableView = null;
            }
        }