예제 #1
0
        public Policy(string filePath, XElement node, ObjectIndex references)
            : base(filePath, node, node.Attribute("PolicyId").Value, references)
        {
            if (XmlNode.Element(PolicyItem.ns + "BasePolicy")?.Element(PolicyItem.ns + "PolicyId")?.Value != null)
            {
                BasePolicy = new Reference <Policy>(this, XmlNode.Element(PolicyItem.ns + "BasePolicy")?.Element(PolicyItem.ns + "PolicyId")?.Value, references);
            }

            if (XmlNode.Element("UserJourneys") != null)
            {
                this.UserJourneys = new List <UserJourney>();
                foreach (var uj in XmlNode.Element("UserJourneys").Elements("UserJourney"))
                {
                    this.UserJourneys.Add(UserJourney.Load(this, filePath, uj, references));
                }
            }

            // RelyingParty
            this.RelyingParty = RelyingParty.Load(this, filePath, references);
            // BuildingBlocks
            this.BuildingBlocks = BuildingBlocks.Load(this, filePath, references);

            // ClaimsProviders
            if (XmlNode.Element(PolicyItem.ns + "ClaimsProviders") != null)
            {
                this.ClaimsProviders = new List <ClaimsProvider>();
                foreach (var cp in XmlNode.Element(PolicyItem.ns + "ClaimsProviders").Elements(PolicyItem.ns + "ClaimsProvider"))
                {
                    this.ClaimsProviders.Add(ClaimsProvider.Load(this, filePath, cp, references));
                }
            }
        }
예제 #2
0
        internal static ClaimsProvider Load(Policy policy, string path, XElement node, ObjectIndex references)
        {
            ClaimsProvider item = new ClaimsProvider(path, node, references, policy);

            // fill data
            item.TechnicalProfiles = new List <TechnicalProfile>();
            foreach (var step in item.XmlNode.Element(PolicyItem.ns + "TechnicalProfiles").Elements(PolicyItem.ns + "TechnicalProfile"))
            {
                item.TechnicalProfiles.Add(TechnicalProfile.Load(item, path, step, references));
            }
            return(item);
        }