internal SLConditionalFormattingRule Clone()
        {
            var cfr = new SLConditionalFormattingRule();

            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.Extensions = new List <ConditionalFormattingRuleExtension>();
            for (var i = 0; i < Extensions.Count; ++i)
            {
                cfr.Extensions.Add((ConditionalFormattingRuleExtension)Extensions[i].CloneNode(true));
            }

            cfr.Type     = Type;
            cfr.FormatId = FormatId;
            cfr.HasDifferentialFormat = HasDifferentialFormat;
            cfr.DifferentialFormat    = DifferentialFormat.Clone();

            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.StdDev        = StdDev;
            cfr.EqualAverage  = EqualAverage;

            return(cfr);
        }
Example #2
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);
        }