/// <summary> /// Opens a new form. /// </summary> public void OpenForm() { if (m_masterForm == null) { ClientForm form = new ClientForm(m_context, m_application, this, m_configuration, m_logFileFolderPath); m_forms.Add(form); form.FormClosing += new FormClosingEventHandler(Window_FormClosing); form.Show(); } else { m_masterForm.OpenForm(); } }
private void NewWindowMI_Click(object sender, EventArgs e) { try { ClientForm form = this.FindForm() as ClientForm; if (form != null) { form.OpenForm(); } } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }
public ClientForm( ServiceMessageContext context, ApplicationInstance application, ClientForm masterForm, ApplicationConfiguration configuration, string logFileFolderPath ) { InitializeComponent(); if (maintenanceControlComponent.Warning != null) { Utils.Trace("The following warning(s) appeared during loading the license: " + maintenanceControlComponent.Warning); } if (String.IsNullOrEmpty(logFileFolderPath)) { throw new ArgumentNullException(nameof(logFileFolderPath)); } m_logFileFolderPath = logFileFolderPath; m_masterForm = masterForm; m_context = context; m_application = application; m_server = application.Server as Opc.Ua.Server.StandardServer; if (m_masterForm == null) { m_forms = new List <ClientForm>(); } SessionsCTRL.Configuration = m_configuration = configuration; SessionsCTRL.MessageContext = context; m_btcBrowse = (BaseTreeCtrl)BrowseCTRL; m_btcSession = (BaseTreeCtrl)SessionsCTRL; m_btcSession.NodesTV.MouseDown += new MouseEventHandler(NodesTVInSession_MouseDown); m_btcBrowse.NodesTV.MouseDown += new MouseEventHandler(NodesTVInBrowse_MouseDown); // get list of cached endpoints. m_endpoints = m_configuration.LoadCachedEndpoints(true); m_endpoints.DiscoveryUrls = configuration.ClientConfiguration.WellKnownDiscoveryUrls; EndpointSelectorCTRL.Initialize(m_endpoints, m_configuration); // initialize control state. Disconnect(); }