Example #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);
                PropertiesCTRL.Initialize(null);

                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 TsCDaServer ShowDialog(OpcSpecification specification)
        {
            SpecificationCB.SelectedItem = specification;

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

            TsCDaServer server = ServersCTRL.SelectedServer;

            ServersCTRL.Clear();
            return(server);
        }
Example #3
0
        /// <summary>
        /// Prompts a user to create a new subscription with a modal dialog.
        /// </summary>
        public TsCDaSubscription ShowDialog(TsCDaServer server)
        {
            if (server == null)
            {
                throw new ArgumentNullException("server");
            }

            m_server       = server;
            m_subscription = null;
            m_items        = null;

            BackBTN.Enabled          = false;
            NextBTN.Enabled          = true;
            CancelBTN.Visible        = true;
            DoneBTN.Visible          = false;
            OptionsBTN.Visible       = false;
            SubscriptionCTRL.Visible = true;
            BrowseCTRL.Visible       = false;
            ItemsCTRL.Visible        = true;
            ResultsCTRL.Visible      = false;

            SubscriptionCTRL.Server = m_server;
            SubscriptionCTRL.Set(null);
            BrowseCTRL.ShowSingleServer(m_server, null);
            ItemsCTRL.Initialize((TsCDaItem)null);

            ShowDialog();

            // ensure server connection in the browse control are closed.
            BrowseCTRL.Clear();

            return(m_subscription);
        }