Beispiel #1
0
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application, 
            ClientForm masterForm, 
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            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;

            // 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();
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 /// <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_forms.Add(form);
         form.FormClosing += new FormClosingEventHandler(Window_FormClosing);
         form.Show();
     }
     else
     {
         m_masterForm.OpenForm();
     }
 }
Beispiel #4
0
        public SampleClientForm(
            ApplicationInstance application,
            Opc.Ua.Sample.Controls.ClientForm masterForm,
            ApplicationConfiguration configuration)
            :
            base(configuration.CreateMessageContext(), application, masterForm, configuration)
        {
            InitializeComponent();

            base.BrowseCTRL.MethodCalled += new Opc.Ua.Sample.Controls.MethodCalledEventHandler(BrowseCTRL_MethodCalled);

            if (!configuration.SecurityConfiguration.AutoAcceptUntrustedCertificates)
            {
                configuration.CertificateValidator.CertificateValidation += new CertificateValidationEventHandler(CertificateValidator_CertificateValidation);
            }
        }
Beispiel #5
0
        public ClientForm(
            ServiceMessageContext context,
            ApplicationInstance application,
            ClientForm masterForm,
            ApplicationConfiguration configuration)
        {
            InitializeComponent();
            this.Icon = ClientUtils.GetAppIcon();

            // Create the NotifyIcon.
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);

            // The Icon property sets the icon that will appear
            // in the systray for this application.
            notifyIcon1.Icon = ClientUtils.GetAppIcon();

            // The Text property sets the text that will be displayed,
            // in a tooltip, when the mouse hovers over the systray icon.
            notifyIcon1.Text    = "OPCUA-MQTT Interface";
            notifyIcon1.Visible = true;

            // Handle the DoubleClick event to activate the form.
            notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);

            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;

            // 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();
        }
Beispiel #6
0
 /// <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_forms.Add(form);
         form.FormClosing += new FormClosingEventHandler(Window_FormClosing);
         form.Show();
     }
     else
     {
         m_masterForm.OpenForm();
     }
 }