예제 #1
0
 public PlayReadyPolicy(JToken node) : base(node)
 {
     if (node["gracePeriod"] != null)
     {
         this._GracePeriod = ParseInt(node["gracePeriod"].Value <string>());
     }
     if (node["licenseRemovalPolicy"] != null)
     {
         this._LicenseRemovalPolicy = (PlayReadyLicenseRemovalPolicy)ParseEnum(typeof(PlayReadyLicenseRemovalPolicy), node["licenseRemovalPolicy"].Value <string>());
     }
     if (node["licenseRemovalDuration"] != null)
     {
         this._LicenseRemovalDuration = ParseInt(node["licenseRemovalDuration"].Value <string>());
     }
     if (node["minSecurityLevel"] != null)
     {
         this._MinSecurityLevel = (PlayReadyMinimumLicenseSecurityLevel)ParseEnum(typeof(PlayReadyMinimumLicenseSecurityLevel), node["minSecurityLevel"].Value <string>());
     }
     if (node["rights"] != null)
     {
         this._Rights = new List <PlayReadyRight>();
         foreach (var arrayNode in node["rights"].Children())
         {
             this._Rights.Add(ObjectFactory.Create <PlayReadyRight>(arrayNode));
         }
     }
 }
        public PlayReadyPolicy(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "gracePeriod":
                    this._GracePeriod = ParseInt(propertyNode.InnerText);
                    continue;

                case "licenseRemovalPolicy":
                    this._LicenseRemovalPolicy = (PlayReadyLicenseRemovalPolicy)ParseEnum(typeof(PlayReadyLicenseRemovalPolicy), propertyNode.InnerText);
                    continue;

                case "licenseRemovalDuration":
                    this._LicenseRemovalDuration = ParseInt(propertyNode.InnerText);
                    continue;

                case "minSecurityLevel":
                    this._MinSecurityLevel = (PlayReadyMinimumLicenseSecurityLevel)ParseEnum(typeof(PlayReadyMinimumLicenseSecurityLevel), propertyNode.InnerText);
                    continue;

                case "rights":
                    this._Rights = new List <PlayReadyRight>();
                    foreach (XmlElement arrayNode in propertyNode.ChildNodes)
                    {
                        this._Rights.Add(ObjectFactory.Create <PlayReadyRight>(arrayNode));
                    }
                    continue;
                }
            }
        }