예제 #1
0
        private void SetHostAddress(string domainID)
        {
            // Get the current address for this domain.
            Uri currentAddress = DomainProvider.ResolveLocation(domainID);

            if (currentAddress != null)
            {
                UriBuilder ub = new UriBuilder(currentAddress);
                ub.Host = "mylocalhost";
                DomainProvider.SetHostLocation(domainID, ub.Uri);
            }

            currentAddress = DomainProvider.ResolveLocation(domainID);
            if ((currentAddress == null) || (currentAddress.Host != "mylocalhost"))
            {
                throw new ApplicationException("Did not set host address.");
            }
        }
예제 #2
0
        private Domain CreateDomain()
        {
            // Create a new domain
            Domain domain =
                new Domain(
                    store,
                    "DomainServerAddressTest",
                    Guid.NewGuid().ToString(),
                    "Test domain",
                    SyncRoles.Slave,
                    Domain.ConfigurationType.ClientServer);

            domain.SetType(domain, "Enterprise");

            Member member = new Member("Test Owner", Guid.NewGuid().ToString(), Access.Rights.Admin);

            member.IsOwner = true;
            domain.Commit(new Node[] { domain, member });

            // Set a default host address.
            DomainProvider.SetHostLocation(domain.ID, new Uri("http://localhost/simias10"));
            return(domain);
        }