Esempio n. 1
0
 /// <summary>
 /// Creates a new facet category with a given name and type.
 /// </summary>
 /// <remarks>
 /// See the <see cref="Name"/> and <see cref="Type"/> properties for details.
 /// </remarks>
 /// <param name="name">the desired name for the new facet category</param>
 /// <param name="type">the type of the new facet category</param>
 public PivotFacetCategory(String name, PivotFacetType type)
 {
     this.Name               = name;
     this.Type               = type;
     this.IsFilterVisible    = type.IsValidInFilterPane();
     this.IsMetaDataVisible  = true;
     this.IsWordWheelVisible = type.IsValidInWordWheel();
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a new facet category with a given name and type.
 /// </summary>
 /// <remarks>
 /// See the <see cref="Name"/> and <see cref="Type"/> properties for details.
 /// </remarks>
 /// <param name="name">the desired name for the new facet category</param>
 /// <param name="type">the type of the new facet category</param>
 public PivotFacetCategory(String name, PivotFacetType type)
 {
     this.Name = name;
     this.Type = type;
     this.IsFilterVisible = type.IsValidInFilterPane();
     this.IsMetaDataVisible = true;
     this.IsWordWheelVisible = type.IsValidInWordWheel();
 }
Esempio n. 3
0
        internal IComparable ValidateFacetValue(ICollectionDefinition definition, String facetCategoryName, IComparable value)
        {
            IComparable actualValue = value;

            if (definition.FacetCategories.Contains(facetCategoryName))
            {
                PivotFacetCategory existingFacetCategory = definition.FacetCategories[facetCategoryName];

                if ((existingFacetCategory.Type.IsValidValue(value) == false))
                {
                    actualValue = null;
                    if (value is String)
                    {
                        try
                        {
                            actualValue = existingFacetCategory.Type.ParseValue((String)value);
                        }
                        catch (FormatException)
                        {
                            // Do nothing.
                        }
                    }

                    if (actualValue == null)
                    {
                        throw new ArgumentException("Item Id " + this.Id + " has an incompatible value (type: " +
                                                    value.GetType().Name + ") for facet category " + facetCategoryName);
                    }
                }
            }
            else if ((this.ContainingCollection != null) && (this.ContainingCollection.InferFacetCategories))
            {
                PivotFacetType facetType = PivotFacetType.IdentifyType(value);
                this.ContainingCollection.FacetCategories.Add(new PivotFacetCategory(facetCategoryName, facetType));
            }
            else
            {
                throw new ArgumentException("Item Id " + this.Id + " has an incompatible value (type: " +
                                            value.GetType().Name + ") for facet category " + facetCategoryName);
            }

            return(actualValue);
        }
 private IEnumerable<Object> SplitJoinedValues(String joinedValue, PivotFacetType facetType)
 {
     foreach (String value in this.SplitJoinedStrings(joinedValue))
     {
         yield return facetType.ParseValue(value);
     }
 }