示例#1
0
        private void ProcessXCategory(AnalysisSourceField analysisSourceField)
        {
            if (!analysisSourceField.IsXCategory)
            {
                return;
            }

            AnalysisExplicitCategoryField categoryBaseField = null;

            if (analysisSourceField.CategoryName?.Length > 0)
            {
                categoryBaseField = new AnalysisExplicitCategoryField(
                    this.Analysis,
                    analysisSourceField,
                    analysisSourceField.CategoryName);
            }

            if (categoryBaseField == null)
            {
                this.SetXCategory(new AnalysisSourceFieldCategory(analysisSourceField));
            }
            else
            {
                this.SetXCategory(new AnalysisExplicitCategoryFieldCategory(categoryBaseField));
            }
        }
示例#2
0
        private void ProcessCategory(AnalysisSourceField analysisSourceField)
        {
            if (!analysisSourceField.IsCategory)
            {
                return;
            }

            AnalysisExplicitCategoryField categoryBaseField = null;

            if (analysisSourceField.CategoryName?.Length > 0)
            {
                categoryBaseField = new AnalysisExplicitCategoryField(
                    this.Analysis,
                    analysisSourceField,
                    analysisSourceField.CategoryName);
            }

            var category = categoryBaseField == null
                ? (AnalysisCategory) new AnalysisSourceFieldCategory(analysisSourceField)
                : new AnalysisExplicitCategoryFieldCategory(categoryBaseField);

            this.categoryDictionary.SetObjectForKey(category, category.Key);
            if (analysisSourceField.IsDefaultCategory)
            {
                this.SetDefaultCategory(category);
            }
            else if (this.firstCategory == null)
            {
                this.firstCategory = category;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="AnalysisExplicitCategoryFieldCategory"/> class.
 /// </summary>
 /// <param name="field">Field</param>
 public AnalysisExplicitCategoryFieldCategory(AnalysisExplicitCategoryField field)
 {
     this.AnalysisField = field;
 }