/// <summary>
        /// Returns the UA COM servers registered on the local computer.
        /// </summary>
        public static List <RegisteredDotNetOpcServer> EnumRegisteredServers(bool updateWrapperPath)
        {
            // enumerate server clsids.
            List <Guid> clsids = ConfigUtils.EnumClassesInCategory(ConfigUtils.CATID_RegisteredDotNetOpcServers);

            // initialize server objects.
            List <RegisteredDotNetOpcServer> servers = new List <RegisteredDotNetOpcServer>();

            for (int ii = 0; ii < clsids.Count; ii++)
            {
                servers.Add(new RegisteredDotNetOpcServer(clsids[ii]));

                if (updateWrapperPath)
                {
                    string wrapperPath = ConfigUtils.GetExecutablePath(servers[ii].WrapperClsid);

                    if (String.IsNullOrEmpty(wrapperPath))
                    {
                        continue;
                    }

                    RegistryKey key = Registry.ClassesRoot.OpenSubKey(String.Format(@"CLSID\{{{0}}}\LocalServer32", clsids[ii]), true);

                    if (key != null)
                    {
                        key.SetValue(null, wrapperPath);
                        key.Close();
                    }
                }
            }

            return(servers);
        }
예제 #2
0
        /// <summary>
        /// Returns the wrapped objects registered on the local machine.
        /// </summary>
        public static List <DotNetOpcServer> EnumServers()
        {
            // enumerate clsids.
            List <Guid> clsids = ConfigUtils.EnumClassesInCategory(ConfigUtils.CATID_DotNetOpcServers);

            // initialize objects.
            List <DotNetOpcServer> servers = new List <DotNetOpcServer>();

            for (int ii = 0; ii < clsids.Count; ii++)
            {
                servers.Add(new DotNetOpcServer(clsids[ii]));
            }

            return(servers);
        }
예제 #3
0
        /// <summary>
        /// Sets the nodes in the control.
        /// </summary>
        public void Initialize(Guid catid)
        {
            Clear();

            m_catid = catid;

            List <Guid> clsids = ConfigUtils.EnumClassesInCategory(catid);

            foreach (Guid clsid in clsids)
            {
                AddItem(clsid);
            }

            AdjustColumns();
        }