示例#1
0
        /// <summary>
        /// Displays the address space for the specified server.
        /// </summary>
        public OpcItem ShowDialog(TsCDaServer server)
        {
            try
            {
                if (server == null)
                {
                    throw new ArgumentNullException("server");
                }

                m_server = server;
                m_itemID = null;

                TsCDaBrowseFilters filters = new TsCDaBrowseFilters();

                filters.ReturnAllProperties  = false;
                filters.ReturnPropertyValues = false;

                BrowseCTRL.ShowSingleServer(m_server, filters);

                if (ShowDialog() != DialogResult.OK)
                {
                    return(null);
                }

                return(m_itemID);
            }
            finally
            {
                // ensure server connection in the browse control are closed.
                BrowseCTRL.Clear();
            }
        }
        /// <summary>
        /// Prompts the use to select a server with the specified specification.
        /// </summary>
        public OpcServer ShowDialog(OpcSpecification specification)
        {
            SpecificationCB.SelectedItem = specification;

            if (ShowDialog() != DialogResult.OK)
            {
                ServersCTRL.Clear();
                return(null);
            }

            OpcServer server = ServersCTRL.SelectedServer;

            ServersCTRL.Clear();
            return(server);
        }