Opc.Ua.Configuration.PseudoComServer.Export C# (CSharp) Method

Export() public static method

Exports COM endpoint configurations to the specified file.
public static Export ( string filePath ) : void
filePath string The file path.
return void
        public static void Export(string filePath, params string[] progIds)
        {
            List<ConfiguredEndpoint> endpoints = Enumerate();
            ConfiguredEndpointCollection collection = new ConfiguredEndpointCollection();
            
            for (int ii = 0; ii < endpoints.Count; ii++)
            {
                ConfiguredEndpoint endpoint = endpoints[ii];

                if (endpoint.ComIdentity == null)
                {
                    continue;
                }

                if (progIds == null || progIds.Length == 0)
                {
                    collection.Add(endpoint);
                    continue;
                }

                for (int jj = 0; jj < progIds.Length; jj++)
                {
                    if (progIds[jj] == endpoint.ComIdentity.ProgId)
                    {
                        collection.Add(endpoint);
                        break;
                    }
                }
            }

            if (collection.Count > 0)
            {
                collection.Save(filePath);
            }
        }