Exemple #1
0
 public static Scaling FromDescriptor(dynamic spec)
 {
     Scaling scaling = new Scaling();
     scaling.Min = spec.ContainsKey("Min") ? int.Parse(spec["Min"]) : 1;
     scaling.Max = spec.ContainsKey("Max") ? int.Parse(spec["Max"]) : -1;
     scaling.MinManaged = spec.ContainsKey("Min-Managed") ? int.Parse(spec["Min-Managed"]) : 1;
     scaling.Multiplier = spec.ContainsKey("Multiplier") ? int.Parse(spec["Multiplier"]) : 1;
     scaling.Required = spec.ContainsKey("Required") ? bool.Parse(spec["Required"]) : true;
     return scaling;
 }
Exemple #2
0
        public static Scaling FromDescriptor(dynamic spec)
        {
            Scaling scaling = new Scaling();

            scaling.Min        = spec.ContainsKey("Min") ? spec["Min"] : 1;
            scaling.Max        = spec.ContainsKey("Max") ? spec["Max"] : -1;
            scaling.MinManaged = spec.ContainsKey("Min-Managed") ? spec["Min-Managed"] : 1;
            scaling.Multiplier = spec.ContainsKey("Multiplier") ? spec["Multiplier"] : 1;
            return(scaling);
        }
Exemple #3
0
        public static Scaling FromDescriptor(dynamic spec)
        {
            Scaling scaling = new Scaling();

            scaling.Min        = spec.ContainsKey("Min") ? int.Parse(spec["Min"]) : 1;
            scaling.Max        = spec.ContainsKey("Max") ? int.Parse(spec["Max"]) : -1;
            scaling.MinManaged = spec.ContainsKey("Min-Managed") ? int.Parse(spec["Min-Managed"]) : 1;
            scaling.Multiplier = spec.ContainsKey("Multiplier") ? int.Parse(spec["Multiplier"]) : 1;
            scaling.Required   = spec.ContainsKey("Required") ? bool.Parse(spec["Required"]) : true;
            return(scaling);
        }