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

                case "createdAt":
                    this._CreatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "updatedAt":
                    this._UpdatedAt = ParseInt(propertyNode.InnerText);
                    continue;

                case "partnerId":
                    this._PartnerId = ParseInt(propertyNode.InnerText);
                    continue;

                case "name":
                    this._Name = propertyNode.InnerText;
                    continue;

                case "systemName":
                    this._SystemName = propertyNode.InnerText;
                    continue;

                case "desciption":
                    this._Desciption = propertyNode.InnerText;
                    continue;

                case "status":
                    this._Status = (StorageProfileStatus)ParseEnum(typeof(StorageProfileStatus), propertyNode.InnerText);
                    continue;

                case "protocol":
                    this._Protocol = (StorageProfileProtocol)StringEnum.Parse(typeof(StorageProfileProtocol), propertyNode.InnerText);
                    continue;

                case "storageUrl":
                    this._StorageUrl = propertyNode.InnerText;
                    continue;

                case "storageBaseDir":
                    this._StorageBaseDir = propertyNode.InnerText;
                    continue;

                case "storageUsername":
                    this._StorageUsername = propertyNode.InnerText;
                    continue;

                case "storagePassword":
                    this._StoragePassword = propertyNode.InnerText;
                    continue;

                case "storageFtpPassiveMode":
                    this._StorageFtpPassiveMode = ParseBool(propertyNode.InnerText);
                    continue;

                case "minFileSize":
                    this._MinFileSize = ParseInt(propertyNode.InnerText);
                    continue;

                case "maxFileSize":
                    this._MaxFileSize = ParseInt(propertyNode.InnerText);
                    continue;

                case "flavorParamsIds":
                    this._FlavorParamsIds = propertyNode.InnerText;
                    continue;

                case "maxConcurrentConnections":
                    this._MaxConcurrentConnections = ParseInt(propertyNode.InnerText);
                    continue;

                case "pathManagerClass":
                    this._PathManagerClass = propertyNode.InnerText;
                    continue;

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

                case "trigger":
                    this._Trigger = ParseInt(propertyNode.InnerText);
                    continue;

                case "deliveryPriority":
                    this._DeliveryPriority = ParseInt(propertyNode.InnerText);
                    continue;

                case "deliveryStatus":
                    this._DeliveryStatus = (StorageProfileDeliveryStatus)ParseEnum(typeof(StorageProfileDeliveryStatus), propertyNode.InnerText);
                    continue;

                case "readyBehavior":
                    this._ReadyBehavior = (StorageProfileReadyBehavior)ParseEnum(typeof(StorageProfileReadyBehavior), propertyNode.InnerText);
                    continue;

                case "allowAutoDelete":
                    this._AllowAutoDelete = ParseInt(propertyNode.InnerText);
                    continue;

                case "createFileLink":
                    this._CreateFileLink = ParseBool(propertyNode.InnerText);
                    continue;

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

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

                case "privateKey":
                    this._PrivateKey = propertyNode.InnerText;
                    continue;

                case "publicKey":
                    this._PublicKey = propertyNode.InnerText;
                    continue;

                case "passPhrase":
                    this._PassPhrase = propertyNode.InnerText;
                    continue;

                case "shouldExportThumbs":
                    this._ShouldExportThumbs = ParseBool(propertyNode.InnerText);
                    continue;
                }
            }
        }
 public StorageProfile(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = ParseInt(node["id"].Value <string>());
     }
     if (node["createdAt"] != null)
     {
         this._CreatedAt = ParseInt(node["createdAt"].Value <string>());
     }
     if (node["updatedAt"] != null)
     {
         this._UpdatedAt = ParseInt(node["updatedAt"].Value <string>());
     }
     if (node["partnerId"] != null)
     {
         this._PartnerId = ParseInt(node["partnerId"].Value <string>());
     }
     if (node["name"] != null)
     {
         this._Name = node["name"].Value <string>();
     }
     if (node["systemName"] != null)
     {
         this._SystemName = node["systemName"].Value <string>();
     }
     if (node["desciption"] != null)
     {
         this._Desciption = node["desciption"].Value <string>();
     }
     if (node["status"] != null)
     {
         this._Status = (StorageProfileStatus)ParseEnum(typeof(StorageProfileStatus), node["status"].Value <string>());
     }
     if (node["protocol"] != null)
     {
         this._Protocol = (StorageProfileProtocol)StringEnum.Parse(typeof(StorageProfileProtocol), node["protocol"].Value <string>());
     }
     if (node["storageUrl"] != null)
     {
         this._StorageUrl = node["storageUrl"].Value <string>();
     }
     if (node["storageBaseDir"] != null)
     {
         this._StorageBaseDir = node["storageBaseDir"].Value <string>();
     }
     if (node["storageUsername"] != null)
     {
         this._StorageUsername = node["storageUsername"].Value <string>();
     }
     if (node["storagePassword"] != null)
     {
         this._StoragePassword = node["storagePassword"].Value <string>();
     }
     if (node["storageFtpPassiveMode"] != null)
     {
         this._StorageFtpPassiveMode = ParseBool(node["storageFtpPassiveMode"].Value <string>());
     }
     if (node["minFileSize"] != null)
     {
         this._MinFileSize = ParseInt(node["minFileSize"].Value <string>());
     }
     if (node["maxFileSize"] != null)
     {
         this._MaxFileSize = ParseInt(node["maxFileSize"].Value <string>());
     }
     if (node["flavorParamsIds"] != null)
     {
         this._FlavorParamsIds = node["flavorParamsIds"].Value <string>();
     }
     if (node["maxConcurrentConnections"] != null)
     {
         this._MaxConcurrentConnections = ParseInt(node["maxConcurrentConnections"].Value <string>());
     }
     if (node["pathManagerClass"] != null)
     {
         this._PathManagerClass = node["pathManagerClass"].Value <string>();
     }
     if (node["pathManagerParams"] != null)
     {
         this._PathManagerParams = new List <KeyValue>();
         foreach (var arrayNode in node["pathManagerParams"].Children())
         {
             this._PathManagerParams.Add(ObjectFactory.Create <KeyValue>(arrayNode));
         }
     }
     if (node["trigger"] != null)
     {
         this._Trigger = ParseInt(node["trigger"].Value <string>());
     }
     if (node["deliveryPriority"] != null)
     {
         this._DeliveryPriority = ParseInt(node["deliveryPriority"].Value <string>());
     }
     if (node["deliveryStatus"] != null)
     {
         this._DeliveryStatus = (StorageProfileDeliveryStatus)ParseEnum(typeof(StorageProfileDeliveryStatus), node["deliveryStatus"].Value <string>());
     }
     if (node["readyBehavior"] != null)
     {
         this._ReadyBehavior = (StorageProfileReadyBehavior)ParseEnum(typeof(StorageProfileReadyBehavior), node["readyBehavior"].Value <string>());
     }
     if (node["allowAutoDelete"] != null)
     {
         this._AllowAutoDelete = ParseInt(node["allowAutoDelete"].Value <string>());
     }
     if (node["createFileLink"] != null)
     {
         this._CreateFileLink = ParseBool(node["createFileLink"].Value <string>());
     }
     if (node["rules"] != null)
     {
         this._Rules = new List <Rule>();
         foreach (var arrayNode in node["rules"].Children())
         {
             this._Rules.Add(ObjectFactory.Create <Rule>(arrayNode));
         }
     }
     if (node["deliveryProfileIds"] != null)
     {
         this._DeliveryProfileIds = new List <KeyValue>();
         foreach (var arrayNode in node["deliveryProfileIds"].Children())
         {
             this._DeliveryProfileIds.Add(ObjectFactory.Create <KeyValue>(arrayNode));
         }
     }
     if (node["privateKey"] != null)
     {
         this._PrivateKey = node["privateKey"].Value <string>();
     }
     if (node["publicKey"] != null)
     {
         this._PublicKey = node["publicKey"].Value <string>();
     }
     if (node["passPhrase"] != null)
     {
         this._PassPhrase = node["passPhrase"].Value <string>();
     }
     if (node["shouldExportThumbs"] != null)
     {
         this._ShouldExportThumbs = ParseBool(node["shouldExportThumbs"].Value <string>());
     }
     if (node["packagerUrl"] != null)
     {
         this._PackagerUrl = node["packagerUrl"].Value <string>();
     }
     if (node["exportPeriodically"] != null)
     {
         this._ExportPeriodically = ParseBool(node["exportPeriodically"].Value <string>());
     }
     if (node["excludedFlavorParamsIds"] != null)
     {
         this._ExcludedFlavorParamsIds = node["excludedFlavorParamsIds"].Value <string>();
     }
     if (node["shouldExportCaptions"] != null)
     {
         this._ShouldExportCaptions = ParseBool(node["shouldExportCaptions"].Value <string>());
     }
 }