Пример #1
0
 /// <summary>
 /// Initializes the object with the ProgID of the server being accessed.
 /// </summary>
 public ComClient(ComClientConfiguration configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException("configuration");
     }
     m_url = configuration.ServerUrl;
 }
Пример #2
0
        /// <summary>
        /// Shows the dialog.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        /// <returns>True if the configuration was updated.</returns>
        public bool ShowDialogForDelete(ApplicationConfiguration configuration)
        {
            this.Text         = "Select Wrapped COM Server to Delete";
            m_delete          = true;
            m_configuration   = configuration;
            AddressPN.Visible = false;

            // extract the wrapper configuration from the application configuration.
            ComWrapperServerConfiguration wrapperConfig = m_configuration.ParseExtension <ComWrapperServerConfiguration>();

            if (wrapperConfig == null)
            {
                wrapperConfig = new ComWrapperServerConfiguration();
            }

            if (wrapperConfig.WrappedServers == null)
            {
                wrapperConfig.WrappedServers = new ComClientConfigurationCollection();
            }

            // populate the list of wrapped servers.
            for (int ii = 0; ii < wrapperConfig.WrappedServers.Count; ii++)
            {
                ComClientConfiguration server = wrapperConfig.WrappedServers[ii];

                ListViewItem item = new ListViewItem(server.ServerUrl);
                item.SubItems.Add(server.ServerName);
                item.Tag = server;

                ServersLV.Items.Add(item);
            }

            for (int ii = 0; ii < ServersLV.Columns.Count; ii++)
            {
                ServersLV.Columns[ii].Width = -2;
            }

            // show the dialog.
            if (ShowDialog() != DialogResult.OK)
            {
                return(false);
            }

            return(true);
        }
Пример #3
0
        /// <summary>
        /// Initializes the manager by creating the default instance.
        /// </summary>
        public void Initialize(
            ServerSystemContext context,
            ComClientConfiguration configuration,
            ComServerStatusState statusNode,
            object statusNodeLock)
        {
            m_defaultSystemContext = context;
            m_configuration        = configuration;
            m_statusNode           = statusNode;
            m_statusNodeLock       = statusNodeLock;
            m_statusUpdateInterval = m_configuration.MaxReconnectWait;

            // limit status updates to once per 10 seconds.
            if (m_statusUpdateInterval < 10000)
            {
                m_statusUpdateInterval = 10000;
            }

            StartStatusTimer(OnStatusTimerExpired);
        }