private void UpdateFormattingObject() { BaseFormattingObject formattingObject1 = (BaseFormattingObject)null; if (this.SupportsConditionalFormatting) { foreach (GridViewColumn column in (Collection <GridViewDataColumn>) this.ViewTemplate.Columns) { GridViewDataColumn gridViewDataColumn = column as GridViewDataColumn; if (gridViewDataColumn != null) { foreach (BaseFormattingObject formattingObject2 in (Collection <BaseFormattingObject>)gridViewDataColumn.ConditionalFormattingObjectList) { if (!formattingObject2.ApplyOnSelectedRows && this.RowInfo.IsSelected) { this.UnsetFormattingObjectProperties(formattingObject2, formattingObject1); } else if (formattingObject2.ApplyToRow && formattingObject2.Evaluate(this.RowInfo, (GridViewColumn)gridViewDataColumn)) { if (formattingObject1 == null) { formattingObject1 = new BaseFormattingObject(); } this.SetFormattingObjectProperties(formattingObject2, formattingObject1); } } } } } this.SetFormattingObject(formattingObject1); }
protected void SetFormattingObject(BaseFormattingObject format) { if (!this.SupportsConditionalFormatting || this.formattingObject == null && format == null) { return; } BaseFormattingObject formattingObject = this.formattingObject; this.formattingObject = format; this.SuspendPropertyNotifications(); this.NotifyFormatChanged(formattingObject); this.ResumePropertyNotifications(); }
public override void Copy(BaseFormattingObject source) { ExpressionFormattingObject source1 = source as ExpressionFormattingObject; if (source1 != null) { ReflectionHelper.CopyFields <ExpressionFormattingObject>(this, source1); this.OnPropertyChanged("CellBackColor"); } else { base.Copy(source); } }
protected virtual void SetFormattingObjectProperties( BaseFormattingObject source, BaseFormattingObject target) { if (source == null || target == null) { return; } target.Enabled = source.Enabled; target.ApplyToRow = source.ApplyToRow; target.ApplyOnSelectedRows = source.ApplyOnSelectedRows; if (source.IsValueSet("CellBackColor")) { target.cellBackColor = source.CellBackColor; } if (source.IsValueSet("CellForeColor")) { target.cellForeColor = source.CellForeColor; } if (source.IsValueSet("TextAlignment")) { target.textAlignment = source.TextAlignment; } if (source.IsValueSet("RowBackColor")) { target.rowBackColor = source.RowBackColor; } if (source.IsValueSet("RowForeColor")) { target.rowForeColor = source.RowForeColor; } if (source.IsValueSet("RowTextAlignment")) { target.rowTextAlignment = source.RowTextAlignment; } if (source.IsValueSet("CellFont")) { target.cellFont = source.CellFont; } if (!source.IsValueSet("RowFont")) { return; } target.rowFont = source.RowFont; }
public void CopyTo(BaseFormattingObject format) { format.RowForeColor = this.rowForeColor; format.RowBackColor = this.rowBackColor; format.CellForeColor = this.cellForeColor; format.CellBackColor = this.cellBackColor; format.TextAlignment = this.textAlignment; format.RowTextAlignment = this.rowTextAlignment; format.CellFont = this.cellFont; format.RowFont = this.rowFont; format.Enabled = this.enabled; ConditionalFormattingObject formattingObject = format as ConditionalFormattingObject; if (formattingObject == null) { return; } formattingObject.CaseSensitive = this.caseSensitive; }
protected virtual void UnsetFormattingObjectProperties( BaseFormattingObject source, BaseFormattingObject target) { if (source == null || target == null) { return; } if (source.IsValueSet("CellBackColor")) { target.cellBackColor = Color.Empty; } if (source.IsValueSet("CellForeColor")) { target.cellForeColor = Color.Empty; } if (source.IsValueSet("TextAlignment")) { target.textAlignment = ContentAlignment.MiddleLeft; } if (source.IsValueSet("RowBackColor")) { target.rowBackColor = Color.Empty; } if (source.IsValueSet("RowForeColor")) { target.rowForeColor = Color.Empty; } if (source.IsValueSet("RowTextAlignment")) { target.rowTextAlignment = ContentAlignment.MiddleLeft; } if (source.IsValueSet("CellFont")) { target.CellFont = (Font)null; } if (!source.IsValueSet("RowFont")) { return; } target.rowFont = (Font)null; }
public void CopyFrom(BaseFormattingObject format) { this.rowForeColor = format.RowForeColor; this.rowBackColor = format.RowBackColor; this.cellForeColor = format.CellForeColor; this.cellBackColor = format.CellBackColor; this.textAlignment = format.TextAlignment; this.rowTextAlignment = format.RowTextAlignment; this.cellFont = format.CellFont; this.rowFont = format.RowFont; this.enabled = format.Enabled; this.applyOnSelectedRows = format.ApplyOnSelectedRows; ConditionalFormattingObject formattingObject = format as ConditionalFormattingObject; if (formattingObject == null) { return; } this.caseSensitive = formattingObject.CaseSensitive; }
private void UpdateParentFormattingObject() { GridDataRowElement rowElement = this.RowElement as GridDataRowElement; BaseFormattingObject formattingObject1 = (BaseFormattingObject)null; if (rowElement != null) { formattingObject1 = rowElement.FormattingObject; if (formattingObject1 != null && !formattingObject1.ApplyToRow) { formattingObject1 = (BaseFormattingObject)null; } } BaseFormattingObject formattingObject2 = this.parentFormattingObject; this.parentFormattingObject = formattingObject1; this.SuspendPropertyNotifications(); this.ApplyParentFormatting(formattingObject2); this.ResumePropertyNotifications(); }
protected override void NotifyFormatChanged(BaseFormattingObject oldFormat) { base.NotifyFormatChanged(oldFormat); BaseFormattingObject formattingObject = this.FormattingObject; if (formattingObject != null && formattingObject.ApplyToRow) { if (formattingObject.IsValueSet("RowBackColor")) { this.DrawFill = true; this.GradientStyle = GradientStyles.Solid; this.BackColor = formattingObject.RowBackColor; } else { int num1 = (int)this.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); int num2 = (int)this.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local); int num3 = (int)this.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local); } if (formattingObject.IsValueSet("RowFont")) { this.Font = formattingObject.RowFont; } else { int num = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); } } else { if (oldFormat == null) { return; } int num1 = (int)this.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); int num2 = (int)this.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local); int num3 = (int)this.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local); int num4 = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); this.ResetAlternatingRowColor(); } }
private void UpdateFormattingObject() { BaseFormattingObject formattingObject1 = (BaseFormattingObject)null; foreach (BaseFormattingObject formattingObject2 in (Collection <BaseFormattingObject>) this.ColumnInfo.ConditionalFormattingObjectList) { if (!formattingObject2.ApplyOnSelectedRows && this.RowInfo.IsSelected) { this.UnsetFormattingObjectProperties(formattingObject2, formattingObject1); } else if (formattingObject2.Evaluate(this.RowInfo, this.ColumnInfo)) { if (formattingObject1 == null) { formattingObject1 = new BaseFormattingObject(); } this.SetFormattingObjectProperties(formattingObject2, formattingObject1); } } this.SetFormattingObject(formattingObject1); }
protected virtual void NotifyFormatChanged(BaseFormattingObject oldFormat) { this.Invalidate(); }
private void ApplyParentFormatting(BaseFormattingObject oldParentFormat) { if (this.parentFormattingObject == null) { if (oldParentFormat != null) { if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("CellForeColor")) { int num1 = (int)this.ResetValue(VisualElement.ForeColorProperty, ValueResetFlags.Local); } if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("TextAlignment")) { int num2 = (int)this.ResetValue(LightVisualElement.TextAlignmentProperty, ValueResetFlags.Local); } } if (this.FormattingObject != null && this.FormattingObject.IsValueSet("CellFont")) { return; } int num = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); } else { if (this.parentFormattingObject.IsValueSet("RowForeColor")) { if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("CellForeColor")) { this.ForeColor = this.parentFormattingObject.RowForeColor; } } else if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("CellForeColor")) { int num1 = (int)this.ResetValue(VisualElement.ForeColorProperty, ValueResetFlags.Local); } if (this.parentFormattingObject.IsValueSet("RowTextAlignment")) { if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("TextAlignment")) { this.TextAlignment = this.parentFormattingObject.RowTextAlignment; } } else if (this.FormattingObject == null || !this.FormattingObject.IsValueSet("TextAlignment")) { int num2 = (int)this.ResetValue(LightVisualElement.TextAlignmentProperty, ValueResetFlags.Local); } if (this.parentFormattingObject.IsValueSet("RowFont")) { if (this.FormattingObject != null && this.FormattingObject.IsValueSet("CellFont")) { return; } this.Font = this.parentFormattingObject.RowFont; } else { if (this.FormattingObject != null && this.FormattingObject.IsValueSet("CellFont")) { return; } int num3 = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); } } }
protected override void NotifyFormatChanged(BaseFormattingObject oldFormat) { base.NotifyFormatChanged(oldFormat); BaseFormattingObject formattingObject = this.FormattingObject; if (formattingObject != null) { if (formattingObject.IsValueSet("CellBackColor")) { this.DrawFill = true; this.GradientStyle = GradientStyles.Solid; this.BackColor = formattingObject.CellBackColor; } else { int num1 = (int)this.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); int num2 = (int)this.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local); int num3 = (int)this.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local); } if (formattingObject.IsValueSet("CellForeColor")) { this.ForeColor = formattingObject.CellForeColor; } else if (this.parentFormattingObject == null || !this.parentFormattingObject.IsValueSet("RowForeColor")) { int num4 = (int)this.ResetValue(VisualElement.ForeColorProperty, ValueResetFlags.Local); } if (formattingObject.IsValueSet("TextAlignment")) { this.TextAlignment = formattingObject.TextAlignment; } else if (this.parentFormattingObject == null || !this.parentFormattingObject.IsValueSet("RowTextAlignment")) { int num5 = (int)this.ResetValue(LightVisualElement.TextAlignmentProperty, ValueResetFlags.Local); } if (formattingObject.IsValueSet("CellFont")) { this.Font = formattingObject.CellFont; } else { if (this.parentFormattingObject != null && this.parentFormattingObject.IsValueSet("RowFont")) { return; } int num1 = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); } } else { if (oldFormat == null) { return; } int num1 = (int)this.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local); int num2 = (int)this.ResetValue(LightVisualElement.GradientStyleProperty, ValueResetFlags.Local); int num3 = (int)this.ResetValue(VisualElement.BackColorProperty, ValueResetFlags.Local); int num4 = (int)this.ResetValue(VisualElement.ForeColorProperty, ValueResetFlags.Local); int num5 = (int)this.ResetValue(LightVisualElement.TextAlignmentProperty, ValueResetFlags.Local); int num6 = (int)this.ResetValue(VisualElement.FontProperty, ValueResetFlags.Local); } }