Prompts the user to edit a PseudoComServerDlg.
Inheritance: System.Windows.Forms.Form
Exemplo n.º 1
0
        private void ConfigureMI_Click(object sender, EventArgs e)
        {
            try {
                ConfiguredEndpoint endpoint = SelectedTag as ConfiguredEndpoint;

                if (endpoint == null)
                {
                    return;
                }

                EndpointComIdentity comIdentity = new PseudoComServerDlg().ShowDialog(endpoint);

                if (comIdentity == null)
                {
                    return;
                }

                endpoint.ComIdentity = comIdentity;
                PseudoComServer.Save(endpoint);

                UpdateItem(ItemsLV.SelectedItems[0], endpoint);
                AdjustColumns();
            } catch (Exception exception) {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemplo n.º 2
0
        private void NewMI_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);

                if (server == null)
                {
                    return;
                }

                ConfiguredEndpoint endpoint = new ConfiguredEndpoint(server, null);

                endpoint.ComIdentity = new EndpointComIdentity();
                endpoint.ComIdentity.Specification = ComSpecification.DA;

                endpoint = new ConfiguredServerDlg().ShowDialog(endpoint, m_configuration);

                if (endpoint == null)
                {
                    return;
                }

                EndpointComIdentity comIdentity = new PseudoComServerDlg().ShowDialog(endpoint);

                if (comIdentity == null)
                {
                    return;
                }

                endpoint.ComIdentity = comIdentity;
                PseudoComServer.Save(endpoint);

                AddItem(endpoint);
                AdjustColumns();
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void ConfigureMI_Click(object sender, EventArgs e)
        {
            try
            {
                ConfiguredEndpoint endpoint = SelectedTag as ConfiguredEndpoint;
                
                if (endpoint == null)
                {
                    return;
                }

                EndpointComIdentity comIdentity = new PseudoComServerDlg().ShowDialog(endpoint);

                if (comIdentity == null)
                {
                    return;
                }
                
                endpoint.ComIdentity = comIdentity;
                PseudoComServer.Save(endpoint);
                
                UpdateItem(ItemsLV.SelectedItems[0], endpoint);
                AdjustColumns();
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
        private void NewMI_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationDescription server = new DiscoveredServerListDlg().ShowDialog(null, m_configuration);

                if (server == null)
                {
                    return;
                }

                ConfiguredEndpoint endpoint = new ConfiguredEndpoint(server, null);

                endpoint.ComIdentity = new EndpointComIdentity();
                endpoint.ComIdentity.Specification = ComSpecification.DA;

                endpoint = new ConfiguredServerDlg().ShowDialog(endpoint, m_configuration);

                if (endpoint == null)
                {
                    return;
                }
                
                EndpointComIdentity comIdentity = new PseudoComServerDlg().ShowDialog(endpoint);

                if (comIdentity == null)
                {
                    return;
                }

                endpoint.ComIdentity = comIdentity;
                PseudoComServer.Save(endpoint);

                AddItem(endpoint);
                AdjustColumns();
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception);
            }
        }
Exemplo n.º 5
0
        private void OkBTN_Click(object sender, EventArgs e)
        {
            if (m_endpoint == null)
            {
                EditBTN_Click(sender, e);

                if (m_endpoint == null)
                {
                    return;
                }
            }

            try
            {
                EndpointComIdentity comIdentity = new PseudoComServerDlg().ShowDialog(m_endpoint);

                if (comIdentity == null)
                {
                    return;
                }

                m_endpoint.ComIdentity = comIdentity;

                // set a default configuration.
                if (comIdentity.Specification != ComSpecification.HDA)
                {
                    ComProxyConfiguration configuration = m_endpoint.ParseExtension<ComProxyConfiguration>(null);

                    if (configuration == null)
                    {
                        configuration = new ComProxyConfiguration();
                        configuration.BrowseBlockSize = 1000;
                    }

                    m_endpoint.UpdateExtension<ComProxyConfiguration>(null, configuration);
                }
                else
                {
                    ComHdaProxyConfiguration configuration = m_endpoint.ParseExtension<ComHdaProxyConfiguration>(null);

                    if (configuration == null)
                    {
                        configuration = new ComHdaProxyConfiguration();
                        configuration.BrowseBlockSize = 1000;
                        configuration.MaxReturnValues = 10000;
                    }

                    m_endpoint.UpdateExtension<ComHdaProxyConfiguration>(null, configuration);
                }

                PseudoComServer.Save(m_endpoint);

                DialogResult = DialogResult.OK;
            }
            catch (Exception exception)
            {
                GuiUtils.HandleException(this.Text, System.Reflection.MethodBase.GetCurrentMethod(), exception);
            }
        }