Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AnalysisExplicitCategoryValue"/> class.
        /// </summary>
        /// <param name="category">Category</param>
        /// <param name="configCategoryValue">Config category value</param>
        /// <param name="parameters">Parameters</param>
        public AnalysisExplicitCategoryValue(AnalysisExplicitCategory category, UPConfigAnalysisCategoryValue configCategoryValue, List <object> parameters = null)
        {
            this.Category            = category;
            this.ConfigCategoryValue = configCategoryValue;
            this.Key   = this.ConfigCategoryValue.RefValue;
            this.Label = this.ConfigCategoryValue.Label;
            if (parameters != null)
            {
                foreach (List <object> param in parameters)
                {
                    var paramKey = param[0] as string;
                    var value    = param[1] as string;
                    this.Key   = this.Key.Replace(paramKey, value);
                    this.Label = this.Label.Replace(paramKey, value);
                }
            }

            var arr = new List <object>();

            foreach (UPConfigAnalysisCategoryCondition configCondition in configCategoryValue.Conditions)
            {
                arr.Add(new AnalysisExplicitCategoryCondition(configCondition, parameters));
            }

            this.Conditions = arr;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisExplicitCategoryValue"/> class.
 /// </summary>
 /// <param name="category">Category</param>
 /// <param name="otherLabel">Other label</param>
 public AnalysisExplicitCategoryValue(AnalysisExplicitCategory category, string otherLabel)
 {
     this.Category = category;
     this.Key      = "OTHER";
     this.Label    = otherLabel;
 }