Exemplo n.º 1
0
        // Add domain using the corresponding information in handle
        // Returns the newly added domain handle (not the input one).
        //
        public static async Task <iS3DomainHandle> AddDomain(
            iS3DomainHandle domainHandle)
        {
            iS3DomainHandle newHandle =
                await MiniServer.AddDomainHandle(domainHandle.Name, domainHandle.Type,
                                                 domainHandle.ParentID, domainHandle.DbName);

            iS3Territory territory = MiniServer.GetTerritory(newHandle.ParentID);

            Type      t      = MiniServer.GetType(newHandle.Type);
            iS3Domain domain = (iS3Domain)
                               Activator.CreateInstance(t, newHandle);

            territory.Domains.Add(domain);

            return(newHandle);
        }