public ElementField EnableIndex(ElementFieldIndexCalculationType calculationType, ElementFieldIndexSortType indexSortType)
        {
            ValidateEnableIndex();

            IndexEnabled         = true;
            IndexCalculationType = (byte)calculationType;
            IndexSortType        = (byte)indexSortType;

            AddUserRating(50);

            return(this);
        }
示例#2
0
        public ElementField EnableIndex(ElementFieldIndexCalculationType calculationType, ElementFieldIndexSortType indexSortType)
        {
            if (DataType == (byte)ElementFieldDataType.String ||
                DataType == (byte)ElementFieldDataType.String ||
                DataType == (byte)ElementFieldDataType.String)
            {
                throw new InvalidOperationException(string.Format("Index cannot be enabled for this type: {0}", DataType));
            }

            IndexEnabled         = true;
            IndexCalculationType = (byte)calculationType;
            IndexSortType        = (byte)indexSortType;

            IndexRatingTotal = 50; // Computed field
            IndexRatingCount = 1;  // Computed field

            AddUserRating(50);

            return(this);
        }
        public ElementField EnableIndex(ElementFieldIndexCalculationType calculationType, ElementFieldIndexSortType indexSortType)
        {
            ValidateEnableIndex();

            this.IndexEnabled = true;
            this.IndexCalculationType = (byte)calculationType;
            this.IndexSortType = (byte)indexSortType;
            return this;
        }