Opc.Ua.Configuration.AccessRuleListDlg.ApplyAllBTN_Click C# (CSharp) Method

ApplyAllBTN_Click() private method

private ApplyAllBTN_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void ApplyAllBTN_Click(object sender, EventArgs e)
        {
            try
            {
                StringBuilder buffer = new StringBuilder();
                buffer.Append("The following objects will be affected:");
                buffer.Append("\r\n\r\n");

                foreach (SecuredObject objectType in ObjectTypeCB.Items)
                {
                    buffer.Append(objectType);
                    buffer.Append("\r\n");
                }

                buffer.Append("\r\n");
                buffer.Append("Are you sure you would like to apply access control changes to all of the objects listed above?");

                if (new YesNoDlg().ShowDialog(buffer.ToString(), "Confirm Access Rule Changes") != DialogResult.Yes)
                {
                    return;
                }

                IList<ApplicationAccessRule> rules = AccessRulesCTRL.GetAccessRules();

                for (int ii = 0; ii < m_objectPaths.Count; ii++)
                {
                    ApplicationAccessRule.SetAccessRules(m_objectPaths[ii], rules, true);
                }

                AccessRulesCTRL.Initialize((SecuredObject)ObjectTypeCB.SelectedItem, ObjectPathTB.Text);
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
    }