示例#1
0
        public DistributionJobData(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "distributionProfileId":
                    this._DistributionProfileId = ParseInt(propertyNode.InnerText);
                    continue;

                case "distributionProfile":
                    this._DistributionProfile = ObjectFactory.Create <DistributionProfile>(propertyNode);
                    continue;

                case "entryDistributionId":
                    this._EntryDistributionId = ParseInt(propertyNode.InnerText);
                    continue;

                case "entryDistribution":
                    this._EntryDistribution = ObjectFactory.Create <EntryDistribution>(propertyNode);
                    continue;

                case "remoteId":
                    this._RemoteId = propertyNode.InnerText;
                    continue;

                case "providerType":
                    this._ProviderType = (DistributionProviderType)StringEnum.Parse(typeof(DistributionProviderType), propertyNode.InnerText);
                    continue;

                case "providerData":
                    this._ProviderData = ObjectFactory.Create <DistributionJobProviderData>(propertyNode);
                    continue;

                case "results":
                    this._Results = propertyNode.InnerText;
                    continue;

                case "sentData":
                    this._SentData = propertyNode.InnerText;
                    continue;

                case "mediaFiles":
                    this._MediaFiles = new List <DistributionRemoteMediaFile>();
                    foreach (XmlElement arrayNode in propertyNode.ChildNodes)
                    {
                        this._MediaFiles.Add(ObjectFactory.Create <DistributionRemoteMediaFile>(arrayNode));
                    }
                    continue;
                }
            }
        }
 public DistributionJobData(JToken node) : base(node)
 {
     if (node["distributionProfileId"] != null)
     {
         this._DistributionProfileId = ParseInt(node["distributionProfileId"].Value <string>());
     }
     if (node["distributionProfile"] != null)
     {
         this._DistributionProfile = ObjectFactory.Create <DistributionProfile>(node["distributionProfile"]);
     }
     if (node["entryDistributionId"] != null)
     {
         this._EntryDistributionId = ParseInt(node["entryDistributionId"].Value <string>());
     }
     if (node["entryDistribution"] != null)
     {
         this._EntryDistribution = ObjectFactory.Create <EntryDistribution>(node["entryDistribution"]);
     }
     if (node["remoteId"] != null)
     {
         this._RemoteId = node["remoteId"].Value <string>();
     }
     if (node["providerType"] != null)
     {
         this._ProviderType = (DistributionProviderType)StringEnum.Parse(typeof(DistributionProviderType), node["providerType"].Value <string>());
     }
     if (node["providerData"] != null)
     {
         this._ProviderData = ObjectFactory.Create <DistributionJobProviderData>(node["providerData"]);
     }
     if (node["results"] != null)
     {
         this._Results = node["results"].Value <string>();
     }
     if (node["sentData"] != null)
     {
         this._SentData = node["sentData"].Value <string>();
     }
     if (node["mediaFiles"] != null)
     {
         this._MediaFiles = new List <DistributionRemoteMediaFile>();
         foreach (var arrayNode in node["mediaFiles"].Children())
         {
             this._MediaFiles.Add(ObjectFactory.Create <DistributionRemoteMediaFile>(arrayNode));
         }
     }
 }