示例#1
0
 public ThumbParams(JToken node) : base(node)
 {
     if (node["cropType"] != null)
     {
         this._CropType = (ThumbCropType)ParseEnum(typeof(ThumbCropType), node["cropType"].Value <string>());
     }
     if (node["quality"] != null)
     {
         this._Quality = ParseInt(node["quality"].Value <string>());
     }
     if (node["cropX"] != null)
     {
         this._CropX = ParseInt(node["cropX"].Value <string>());
     }
     if (node["cropY"] != null)
     {
         this._CropY = ParseInt(node["cropY"].Value <string>());
     }
     if (node["cropWidth"] != null)
     {
         this._CropWidth = ParseInt(node["cropWidth"].Value <string>());
     }
     if (node["cropHeight"] != null)
     {
         this._CropHeight = ParseInt(node["cropHeight"].Value <string>());
     }
     if (node["videoOffset"] != null)
     {
         this._VideoOffset = ParseFloat(node["videoOffset"].Value <string>());
     }
     if (node["width"] != null)
     {
         this._Width = ParseInt(node["width"].Value <string>());
     }
     if (node["height"] != null)
     {
         this._Height = ParseInt(node["height"].Value <string>());
     }
     if (node["scaleWidth"] != null)
     {
         this._ScaleWidth = ParseFloat(node["scaleWidth"].Value <string>());
     }
     if (node["scaleHeight"] != null)
     {
         this._ScaleHeight = ParseFloat(node["scaleHeight"].Value <string>());
     }
     if (node["backgroundColor"] != null)
     {
         this._BackgroundColor = node["backgroundColor"].Value <string>();
     }
     if (node["sourceParamsId"] != null)
     {
         this._SourceParamsId = ParseInt(node["sourceParamsId"].Value <string>());
     }
     if (node["format"] != null)
     {
         this._Format = (ContainerFormat)StringEnum.Parse(typeof(ContainerFormat), node["format"].Value <string>());
     }
     if (node["density"] != null)
     {
         this._Density = ParseInt(node["density"].Value <string>());
     }
     if (node["stripProfiles"] != null)
     {
         this._StripProfiles = ParseBool(node["stripProfiles"].Value <string>());
     }
     if (node["videoOffsetInPercentage"] != null)
     {
         this._VideoOffsetInPercentage = ParseInt(node["videoOffsetInPercentage"].Value <string>());
     }
     if (node["interval"] != null)
     {
         this._Interval = ParseInt(node["interval"].Value <string>());
     }
 }
        public ThumbParams(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "cropType":
                    this._CropType = (ThumbCropType)ParseEnum(typeof(ThumbCropType), propertyNode.InnerText);
                    continue;

                case "quality":
                    this._Quality = ParseInt(propertyNode.InnerText);
                    continue;

                case "cropX":
                    this._CropX = ParseInt(propertyNode.InnerText);
                    continue;

                case "cropY":
                    this._CropY = ParseInt(propertyNode.InnerText);
                    continue;

                case "cropWidth":
                    this._CropWidth = ParseInt(propertyNode.InnerText);
                    continue;

                case "cropHeight":
                    this._CropHeight = ParseInt(propertyNode.InnerText);
                    continue;

                case "videoOffset":
                    this._VideoOffset = ParseFloat(propertyNode.InnerText);
                    continue;

                case "width":
                    this._Width = ParseInt(propertyNode.InnerText);
                    continue;

                case "height":
                    this._Height = ParseInt(propertyNode.InnerText);
                    continue;

                case "scaleWidth":
                    this._ScaleWidth = ParseFloat(propertyNode.InnerText);
                    continue;

                case "scaleHeight":
                    this._ScaleHeight = ParseFloat(propertyNode.InnerText);
                    continue;

                case "backgroundColor":
                    this._BackgroundColor = propertyNode.InnerText;
                    continue;

                case "sourceParamsId":
                    this._SourceParamsId = ParseInt(propertyNode.InnerText);
                    continue;

                case "format":
                    this._Format = (ContainerFormat)StringEnum.Parse(typeof(ContainerFormat), propertyNode.InnerText);
                    continue;

                case "density":
                    this._Density = ParseInt(propertyNode.InnerText);
                    continue;

                case "stripProfiles":
                    this._StripProfiles = ParseBool(propertyNode.InnerText);
                    continue;

                case "videoOffsetInPercentage":
                    this._VideoOffsetInPercentage = ParseInt(propertyNode.InnerText);
                    continue;
                }
            }
        }