示例#1
0
        internal SLConditionalFormattingRule2010 Clone()
        {
            var cfr = new SLConditionalFormattingRule2010();

            cfr.Formulas = new List <Formula>();
            for (var i = 0; i < Formulas.Count; ++i)
            {
                cfr.Formulas.Add((Formula)Formulas[i].CloneNode(true));
            }

            cfr.HasColorScale       = HasColorScale;
            cfr.ColorScale          = ColorScale.Clone();
            cfr.HasDataBar          = HasDataBar;
            cfr.DataBar             = DataBar.Clone();
            cfr.HasIconSet          = HasIconSet;
            cfr.IconSet             = IconSet.Clone();
            cfr.HasDifferentialType = HasDifferentialType;
            cfr.DifferentialType    = DifferentialType.Clone();

            cfr.Type              = Type;
            cfr.Priority          = Priority;
            cfr.StopIfTrue        = StopIfTrue;
            cfr.AboveAverage      = AboveAverage;
            cfr.Percent           = Percent;
            cfr.Bottom            = Bottom;
            cfr.HasOperator       = HasOperator;
            cfr.Operator          = Operator;
            cfr.Text              = Text;
            cfr.HasTimePeriod     = HasTimePeriod;
            cfr.TimePeriod        = TimePeriod;
            cfr.Rank              = Rank;
            cfr.StandardDeviation = StandardDeviation;
            cfr.EqualAverage      = EqualAverage;
            cfr.ActivePresent     = ActivePresent;
            cfr.Id = Id;

            return(cfr);
        }
示例#2
0
        internal X14.ConditionalFormattingRule ToConditionalFormattingRule()
        {
            var cfr = new X14.ConditionalFormattingRule();

            if (Type != null)
            {
                cfr.Type = Type.Value;
            }
            if (Priority != null)
            {
                cfr.Priority = Priority.Value;
            }
            if (StopIfTrue)
            {
                cfr.StopIfTrue = StopIfTrue;
            }
            if (!AboveAverage)
            {
                cfr.AboveAverage = AboveAverage;
            }
            if (Percent)
            {
                cfr.Percent = Percent;
            }
            if (Bottom)
            {
                cfr.Bottom = Bottom;
            }
            if (HasOperator)
            {
                cfr.Operator = Operator;
            }
            if ((Text != null) && (Text.Length > 0))
            {
                cfr.Text = Text;
            }
            if (HasTimePeriod)
            {
                cfr.TimePeriod = TimePeriod;
            }
            if (Rank != null)
            {
                cfr.Rank = Rank.Value;
            }
            if (StandardDeviation != null)
            {
                cfr.StandardDeviation = StandardDeviation.Value;
            }
            if (EqualAverage)
            {
                cfr.EqualAverage = EqualAverage;
            }
            if (ActivePresent)
            {
                cfr.ActivePresent = ActivePresent;
            }
            if (Id != null)
            {
                cfr.Id = Id;
            }

            foreach (var f in Formulas)
            {
                cfr.Append((Formula)f.CloneNode(true));
            }
            if (HasColorScale)
            {
                cfr.Append(ColorScale.ToColorScale());
            }
            if (HasDataBar)
            {
                cfr.Append(DataBar.ToDataBar(Priority != null));
            }
            if (HasIconSet)
            {
                cfr.Append(IconSet.ToIconSet());
            }
            if (HasDifferentialType)
            {
                cfr.Append(DifferentialType.ToDifferentialType());
            }

            return(cfr);
        }