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

Delete() public static method

Deletes the configured endpoints conatined a collection saved on disk.
public static Delete ( string filePath ) : string
filePath string The file path.
return string
        public static string Delete(string filePath)
        {
            StringBuilder errors = new StringBuilder();

            ConfiguredEndpointCollection collection = ConfiguredEndpointCollection.Load(filePath);

            int loaded = 0;
            int deleted = 0;

            foreach (ConfiguredEndpoint endpoint in collection.Endpoints)
            {
                loaded++;

                try
                {
                    Delete(endpoint.ComIdentity.Clsid);
                    deleted++;
                }
                catch (Exception e)
                {
                    if (errors.Length > 0)
                    {
                        errors.AppendFormat("\r\n");
                    }

                    errors.AppendFormat("Endpoint #{0} - {1}", loaded, e.Message);
                }
            }

            if (errors.Length > 0)
            {
                errors.AppendFormat("\r\n\r\n{0} of {0} endpoints deleted successfully.", deleted, loaded);
            }

            return errors.ToString();
        }

Same methods

PseudoComServer::Delete ( System.Guid clsid ) : void