Ejemplo n.º 1
0
        // Add territory using the corresponding information in handle
        // Returns the newly added territory handle (not the input one).
        //
        public static async Task <iS3TerritoryHandle> AddTerritory(
            iS3TerritoryHandle territoryHandle)
        {
            iS3TerritoryHandle newHandle =
                await MiniServer.AddTerritoryHandle(territoryHandle.Name,
                                                    territoryHandle.Type, territoryHandle.DbName);

            Type         t         = MiniServer.GetType(newHandle.Type);
            iS3Territory territory = (iS3Territory)
                                     Activator.CreateInstance(t, newHandle);

            MiniServer.AddTerritory(territory);

            return(newHandle);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
        public static void AddTerritory(iS3Territory territory)
        {
            string ID = territory.TerritoryHandle.ID.ToString();

            Territories[ID] = territory;
        }