public IXLConditionalFormat CopyTo(IXLWorksheet targetSheet) { if (targetSheet == Range?.Worksheet) { throw new InvalidOperationException("Cannot copy conditional format to the worksheet it already belongs to."); } var targetRanges = Ranges.Select(r => targetSheet.Range(((XLRangeAddress)r.RangeAddress).WithoutWorksheet())); var newCf = new XLConditionalFormat(this, targetRanges); targetSheet.ConditionalFormats.Add(newCf); return(newCf); }
public XLConditionalFormat(XLConditionalFormat other) { Range = other.Range; Style = new XLStyle(this, other.Style); Values = new XLDictionary <XLFormula>(other.Values); Colors = new XLDictionary <XLColor>(other.Colors); ContentTypes = new XLDictionary <XLCFContentType>(other.ContentTypes); IconSetOperators = new XLDictionary <XLCFIconSetOperator>(other.IconSetOperators); ConditionalFormatType = other.ConditionalFormatType; TimePeriod = other.TimePeriod; IconSetStyle = other.IconSetStyle; Operator = other.Operator; Bottom = other.Bottom; Percent = other.Percent; ReverseIconOrder = other.ReverseIconOrder; ShowIconOnly = other.ShowIconOnly; ShowBarOnly = other.ShowBarOnly; }
public XLConditionalFormat(XLConditionalFormat conditionalFormat) { Id = Guid.NewGuid(); Range = conditionalFormat.Range; Style = new XLStyle(this, conditionalFormat.Style); Values = new XLDictionary <XLFormula>(conditionalFormat.Values); Colors = new XLDictionary <XLColor>(conditionalFormat.Colors); ContentTypes = new XLDictionary <XLCFContentType>(conditionalFormat.ContentTypes); IconSetOperators = new XLDictionary <XLCFIconSetOperator>(conditionalFormat.IconSetOperators); ConditionalFormatType = conditionalFormat.ConditionalFormatType; TimePeriod = conditionalFormat.TimePeriod; IconSetStyle = conditionalFormat.IconSetStyle; Operator = conditionalFormat.Operator; Bottom = conditionalFormat.Bottom; Percent = conditionalFormat.Percent; ReverseIconOrder = conditionalFormat.ReverseIconOrder; ShowIconOnly = conditionalFormat.ShowIconOnly; ShowBarOnly = conditionalFormat.ShowBarOnly; StopIfTrueInternal = OpenXmlHelper.GetBooleanValueAsBool(conditionalFormat.StopIfTrueInternal, true); }
public XLCFColorScaleMid(XLConditionalFormat conditionalFormat) { _conditionalFormat = conditionalFormat; }
public XLCFDataBarMin(XLConditionalFormat conditionalFormat) { _conditionalFormat = conditionalFormat; }
public XLConditionalFormat(XLConditionalFormat conditionalFormat, IEnumerable <IXLRange> targetRanges) : this(conditionalFormat.StyleValue) { targetRanges?.ForEach(range => Ranges.Add(range)); CopyFrom(conditionalFormat); }
public XLConditionalFormat(XLConditionalFormat conditionalFormat, IXLRange targetRange) : this(conditionalFormat, new[] { targetRange }) { }
public XLCFIconSet(XLConditionalFormat conditionalFormat) { _conditionalFormat = conditionalFormat; }