コード例 #1
0
        internal Site(TopologySite topologySite, ServiceTopology.All all)
        {
            this.DistinguishedName = topologySite.DistinguishedName;
            all.Sites.Add(this.DistinguishedName, this);
            this.Id             = topologySite.Id;
            this.Guid           = topologySite.Guid;
            this.Name           = topologySite.Name;
            this.PartnerId      = topologySite.PartnerId;
            this.MinorPartnerId = topologySite.MinorPartnerId;
            List <ADObjectId> list = new List <ADObjectId>(topologySite.ResponsibleForSites);

            this.ResponsibleForSites = list.AsReadOnly();
            if (topologySite.TopologySiteLinks == null || topologySite.TopologySiteLinks.Count == 0)
            {
                this.SiteLinks = SiteLink.EmptyCollection;
                return;
            }
            List <SiteLink> list2 = new List <SiteLink>(topologySite.TopologySiteLinks.Count);

            foreach (ITopologySiteLink topologySiteLink in topologySite.TopologySiteLinks)
            {
                TopologySiteLink topologySiteLink2 = (TopologySiteLink)topologySiteLink;
                SiteLink         item = SiteLink.Get(topologySiteLink2, all);
                list2.Add(item);
            }
            this.SiteLinks = list2.AsReadOnly();
        }
コード例 #2
0
        internal static SiteLink Get(TopologySiteLink topologySiteLink, ServiceTopology.All all)
        {
            SiteLink result;

            if (!all.SiteLinks.TryGetValue(topologySiteLink.DistinguishedName, out result))
            {
                result = new SiteLink(topologySiteLink, all);
            }
            return(result);
        }