// 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); }
// 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); }
public static void AddTerritory(iS3Territory territory) { string ID = territory.TerritoryHandle.ID.ToString(); Territories[ID] = territory; }