示例#1
0
        internal DataBar ToDataBar()
        {
            DataBar db = new DataBar();
            if (this.MinLength != 10) db.MinLength = this.MinLength;
            if (this.MaxLength != 90) db.MaxLength = this.MaxLength;
            if (!this.ShowValue) db.ShowValue = this.ShowValue;

            SLConditionalFormatValueObject cfvo;

            cfvo = new SLConditionalFormatValueObject();
            cfvo.Type = ConditionalFormatValueObjectValues.Min;
            switch (this.MinimumType)
            {
                case SLConditionalFormatAutoMinMaxValues.Automatic:
                    cfvo.Type = ConditionalFormatValueObjectValues.Min;
                    cfvo.Val = string.Empty;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Formula:
                    cfvo.Type = ConditionalFormatValueObjectValues.Formula;
                    cfvo.Val = this.MinimumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Number:
                    cfvo.Type = ConditionalFormatValueObjectValues.Number;
                    cfvo.Val = this.MinimumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Percent:
                    cfvo.Type = ConditionalFormatValueObjectValues.Percent;
                    cfvo.Val = this.MinimumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Percentile:
                    cfvo.Type = ConditionalFormatValueObjectValues.Percentile;
                    cfvo.Val = this.MinimumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Value:
                    cfvo.Type = ConditionalFormatValueObjectValues.Min;
                    cfvo.Val = string.Empty;
                    break;
            }
            db.Append(cfvo.ToConditionalFormatValueObject());

            cfvo = new SLConditionalFormatValueObject();
            cfvo.Type = ConditionalFormatValueObjectValues.Max;
            switch (this.MaximumType)
            {
                case SLConditionalFormatAutoMinMaxValues.Automatic:
                    cfvo.Type = ConditionalFormatValueObjectValues.Max;
                    cfvo.Val = string.Empty;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Formula:
                    cfvo.Type = ConditionalFormatValueObjectValues.Formula;
                    cfvo.Val = this.MaximumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Number:
                    cfvo.Type = ConditionalFormatValueObjectValues.Number;
                    cfvo.Val = this.MaximumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Percent:
                    cfvo.Type = ConditionalFormatValueObjectValues.Percent;
                    cfvo.Val = this.MaximumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Percentile:
                    cfvo.Type = ConditionalFormatValueObjectValues.Percentile;
                    cfvo.Val = this.MaximumValue;
                    break;
                case SLConditionalFormatAutoMinMaxValues.Value:
                    cfvo.Type = ConditionalFormatValueObjectValues.Max;
                    cfvo.Val = string.Empty;
                    break;
            }
            db.Append(cfvo.ToConditionalFormatValueObject());

            db.Append(this.Color.ToSpreadsheetColor());

            return db;
        }
示例#2
0
        internal DataBar ToDataBar()
        {
            DataBar db = new DataBar();

            if (this.MinLength != 10)
            {
                db.MinLength = this.MinLength;
            }
            if (this.MaxLength != 90)
            {
                db.MaxLength = this.MaxLength;
            }
            if (!this.ShowValue)
            {
                db.ShowValue = this.ShowValue;
            }

            SLConditionalFormatValueObject cfvo;

            cfvo      = new SLConditionalFormatValueObject();
            cfvo.Type = ConditionalFormatValueObjectValues.Min;
            switch (this.MinimumType)
            {
            case SLConditionalFormatAutoMinMaxValues.Automatic:
                cfvo.Type = ConditionalFormatValueObjectValues.Min;
                cfvo.Val  = string.Empty;
                break;

            case SLConditionalFormatAutoMinMaxValues.Formula:
                cfvo.Type = ConditionalFormatValueObjectValues.Formula;
                cfvo.Val  = this.MinimumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Number:
                cfvo.Type = ConditionalFormatValueObjectValues.Number;
                cfvo.Val  = this.MinimumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Percent:
                cfvo.Type = ConditionalFormatValueObjectValues.Percent;
                cfvo.Val  = this.MinimumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Percentile:
                cfvo.Type = ConditionalFormatValueObjectValues.Percentile;
                cfvo.Val  = this.MinimumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Value:
                cfvo.Type = ConditionalFormatValueObjectValues.Min;
                cfvo.Val  = string.Empty;
                break;
            }
            db.Append(cfvo.ToConditionalFormatValueObject());

            cfvo      = new SLConditionalFormatValueObject();
            cfvo.Type = ConditionalFormatValueObjectValues.Max;
            switch (this.MaximumType)
            {
            case SLConditionalFormatAutoMinMaxValues.Automatic:
                cfvo.Type = ConditionalFormatValueObjectValues.Max;
                cfvo.Val  = string.Empty;
                break;

            case SLConditionalFormatAutoMinMaxValues.Formula:
                cfvo.Type = ConditionalFormatValueObjectValues.Formula;
                cfvo.Val  = this.MaximumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Number:
                cfvo.Type = ConditionalFormatValueObjectValues.Number;
                cfvo.Val  = this.MaximumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Percent:
                cfvo.Type = ConditionalFormatValueObjectValues.Percent;
                cfvo.Val  = this.MaximumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Percentile:
                cfvo.Type = ConditionalFormatValueObjectValues.Percentile;
                cfvo.Val  = this.MaximumValue;
                break;

            case SLConditionalFormatAutoMinMaxValues.Value:
                cfvo.Type = ConditionalFormatValueObjectValues.Max;
                cfvo.Val  = string.Empty;
                break;
            }
            db.Append(cfvo.ToConditionalFormatValueObject());

            db.Append(this.Color.ToSpreadsheetColor());

            return(db);
        }