Exemplo 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);
        }