예제 #1
0
        public PlayReadyPlayRight(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "analogVideoOPL":
                    this._AnalogVideoOPL = (PlayReadyAnalogVideoOPL)ParseEnum(typeof(PlayReadyAnalogVideoOPL), propertyNode.InnerText);
                    continue;

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

                case "compressedDigitalAudioOPL":
                    this._CompressedDigitalAudioOPL = (PlayReadyDigitalAudioOPL)ParseEnum(typeof(PlayReadyDigitalAudioOPL), propertyNode.InnerText);
                    continue;

                case "compressedDigitalVideoOPL":
                    this._CompressedDigitalVideoOPL = (PlayReadyCompressedDigitalVideoOPL)ParseEnum(typeof(PlayReadyCompressedDigitalVideoOPL), propertyNode.InnerText);
                    continue;

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

                case "uncompressedDigitalAudioOPL":
                    this._UncompressedDigitalAudioOPL = (PlayReadyDigitalAudioOPL)ParseEnum(typeof(PlayReadyDigitalAudioOPL), propertyNode.InnerText);
                    continue;

                case "uncompressedDigitalVideoOPL":
                    this._UncompressedDigitalVideoOPL = (PlayReadyUncompressedDigitalVideoOPL)ParseEnum(typeof(PlayReadyUncompressedDigitalVideoOPL), propertyNode.InnerText);
                    continue;

                case "firstPlayExpiration":
                    this._FirstPlayExpiration = ParseInt(propertyNode.InnerText);
                    continue;

                case "playEnablers":
                    this._PlayEnablers = new List <PlayReadyPlayEnablerHolder>();
                    foreach (XmlElement arrayNode in propertyNode.ChildNodes)
                    {
                        this._PlayEnablers.Add(ObjectFactory.Create <PlayReadyPlayEnablerHolder>(arrayNode));
                    }
                    continue;
                }
            }
        }
 public PlayReadyPlayRight(JToken node) : base(node)
 {
     if (node["analogVideoOPL"] != null)
     {
         this._AnalogVideoOPL = (PlayReadyAnalogVideoOPL)ParseEnum(typeof(PlayReadyAnalogVideoOPL), node["analogVideoOPL"].Value <string>());
     }
     if (node["analogVideoOutputProtectionList"] != null)
     {
         this._AnalogVideoOutputProtectionList = new List <PlayReadyAnalogVideoOPIdHolder>();
         foreach (var arrayNode in node["analogVideoOutputProtectionList"].Children())
         {
             this._AnalogVideoOutputProtectionList.Add(ObjectFactory.Create <PlayReadyAnalogVideoOPIdHolder>(arrayNode));
         }
     }
     if (node["compressedDigitalAudioOPL"] != null)
     {
         this._CompressedDigitalAudioOPL = (PlayReadyDigitalAudioOPL)ParseEnum(typeof(PlayReadyDigitalAudioOPL), node["compressedDigitalAudioOPL"].Value <string>());
     }
     if (node["compressedDigitalVideoOPL"] != null)
     {
         this._CompressedDigitalVideoOPL = (PlayReadyCompressedDigitalVideoOPL)ParseEnum(typeof(PlayReadyCompressedDigitalVideoOPL), node["compressedDigitalVideoOPL"].Value <string>());
     }
     if (node["digitalAudioOutputProtectionList"] != null)
     {
         this._DigitalAudioOutputProtectionList = new List <PlayReadyDigitalAudioOPIdHolder>();
         foreach (var arrayNode in node["digitalAudioOutputProtectionList"].Children())
         {
             this._DigitalAudioOutputProtectionList.Add(ObjectFactory.Create <PlayReadyDigitalAudioOPIdHolder>(arrayNode));
         }
     }
     if (node["uncompressedDigitalAudioOPL"] != null)
     {
         this._UncompressedDigitalAudioOPL = (PlayReadyDigitalAudioOPL)ParseEnum(typeof(PlayReadyDigitalAudioOPL), node["uncompressedDigitalAudioOPL"].Value <string>());
     }
     if (node["uncompressedDigitalVideoOPL"] != null)
     {
         this._UncompressedDigitalVideoOPL = (PlayReadyUncompressedDigitalVideoOPL)ParseEnum(typeof(PlayReadyUncompressedDigitalVideoOPL), node["uncompressedDigitalVideoOPL"].Value <string>());
     }
     if (node["firstPlayExpiration"] != null)
     {
         this._FirstPlayExpiration = ParseInt(node["firstPlayExpiration"].Value <string>());
     }
     if (node["playEnablers"] != null)
     {
         this._PlayEnablers = new List <PlayReadyPlayEnablerHolder>();
         foreach (var arrayNode in node["playEnablers"].Children())
         {
             this._PlayEnablers.Add(ObjectFactory.Create <PlayReadyPlayEnablerHolder>(arrayNode));
         }
     }
 }