fix(control): 修复金额单元格关闭阶段异常
This commit is contained in:
@@ -12,10 +12,15 @@ using DevExpress.XtraGrid.Views.Grid;
|
||||
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
|
||||
|
||||
// Token: 0x02000003 RID: 3
|
||||
public class AmountCellRender
|
||||
public class AmountCellRender : IDisposable
|
||||
{
|
||||
public AmountCellRender(GridView gridView_0)
|
||||
{
|
||||
if (gridView_0 == null)
|
||||
{
|
||||
throw new ArgumentNullException("gridView_0");
|
||||
}
|
||||
|
||||
Class5.gBkiB4AzUqwkh();
|
||||
this.colorGray = Color.FromArgb(189, 185, 185);
|
||||
this.colorGreen = Color.Green;
|
||||
@@ -25,23 +30,58 @@ public class AmountCellRender
|
||||
this.dictionary_0 = new Dictionary<string, Class2>();
|
||||
this.list_0 = new List<GridColumn>();
|
||||
this.object_0 = gridView_0;
|
||||
this.gridControl_0 = this.object_0.GridControl;
|
||||
this.object_0.CustomDrawCell += this.object_0_CustomDrawCell;
|
||||
this.object_0.CustomDrawColumnHeader += this.object_0_CustomDrawColumnHeader;
|
||||
this.object_0.CustomDrawFooterCell += this.object_0_CustomDrawFooterCell;
|
||||
this.object_0.GridControl.Paint += this.method_0;
|
||||
if (this.gridControl_0 != null)
|
||||
{
|
||||
this.gridControl_0.Paint += this.method_0;
|
||||
}
|
||||
}
|
||||
|
||||
private void method_0(object sender, PaintEventArgs e)
|
||||
{
|
||||
BaseViewInfo viewInfo = ((sender as GridControl).FocusedView as GridView).GetViewInfo();
|
||||
if (this.disposed || this.list_0.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GridControl gridControl = sender as GridControl;
|
||||
if (gridControl == null || gridControl.IsDisposed || gridControl.Disposing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GridView gridView = gridControl.FocusedView as GridView;
|
||||
if (gridView == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GridViewInfo gridViewInfo = gridView.GetViewInfo() as GridViewInfo;
|
||||
if (gridViewInfo == null || gridViewInfo.ColumnsInfo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (GridColumn gridColumn in this.list_0)
|
||||
{
|
||||
Class2 @class = this.dictionary_0[gridColumn.Name];
|
||||
Class2 @class;
|
||||
if (gridColumn == null ||
|
||||
!this.dictionary_0.TryGetValue(gridColumn.Name, out @class) ||
|
||||
@class == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (@class.IsCountinuousCell())
|
||||
{
|
||||
GridViewInfo gridViewInfo = viewInfo as GridViewInfo;
|
||||
GridColumnInfoArgs gridColumnInfoArgs = gridViewInfo.ColumnsInfo[gridColumn];
|
||||
if (gridColumnInfoArgs == null) return;
|
||||
if (gridColumnInfoArgs == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int num = 0;
|
||||
int int_;
|
||||
if (@class.method_4())
|
||||
@@ -82,10 +122,16 @@ public class AmountCellRender
|
||||
|
||||
private void object_0_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
|
||||
{
|
||||
if (this.dictionary_0.ContainsKey(e.Column.Name))
|
||||
if (this.disposed || e.Column == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Class2 @class;
|
||||
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
|
||||
@class != null)
|
||||
{
|
||||
e.DisplayText = "";
|
||||
Class2 @class = this.dictionary_0[e.Column.Name];
|
||||
Rectangle bounds = e.Bounds;
|
||||
Rectangle rectangle_ = bounds;
|
||||
Graphics graphics = e.Graphics;
|
||||
@@ -98,14 +144,20 @@ public class AmountCellRender
|
||||
|
||||
private void object_0_CustomDrawFooterCell(object sender, FooterCellCustomDrawEventArgs e)
|
||||
{
|
||||
if (this.dictionary_0.ContainsKey(e.Column.Name))
|
||||
if (this.disposed || e.Column == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Class2 @class;
|
||||
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
|
||||
@class != null)
|
||||
{
|
||||
Class2 @class = this.dictionary_0[e.Column.Name];
|
||||
if (@class.method_8())
|
||||
{
|
||||
e.Info.DisplayText = "";
|
||||
Rectangle bounds = e.Bounds;
|
||||
@class.method_17(bounds, e.Graphics, e.Appearance.Font, e.Info.Value.ToString());
|
||||
@class.method_17(bounds, e.Graphics, e.Appearance.Font, Convert.ToString(e.Info.Value));
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
@@ -113,13 +165,15 @@ public class AmountCellRender
|
||||
|
||||
private void object_0_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
|
||||
{
|
||||
if (e.Column == null)
|
||||
if (this.disposed || e.Column == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (this.dictionary_0.ContainsKey(e.Column.Name))
|
||||
|
||||
Class2 @class;
|
||||
if (this.dictionary_0.TryGetValue(e.Column.Name, out @class) &&
|
||||
@class != null)
|
||||
{
|
||||
Class2 @class = this.dictionary_0[e.Column.Name];
|
||||
if (@class.method_6())
|
||||
{
|
||||
e.Column.Caption = "";
|
||||
@@ -204,14 +258,44 @@ public class AmountCellRender
|
||||
|
||||
public void RemoveAmountColumn(GridColumn gridColumn_0)
|
||||
{
|
||||
if (this.dictionary_0.ContainsKey(gridColumn_0.Name))
|
||||
if (gridColumn_0 != null && this.dictionary_0.ContainsKey(gridColumn_0.Name))
|
||||
{
|
||||
this.dictionary_0.Remove(gridColumn_0.Name);
|
||||
this.list_0.Remove(gridColumn_0);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (this.disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.disposed = true;
|
||||
GridView gridView = this.object_0;
|
||||
GridControl gridControl = this.gridControl_0;
|
||||
this.object_0 = null;
|
||||
this.gridControl_0 = null;
|
||||
|
||||
if (gridView != null)
|
||||
{
|
||||
gridView.CustomDrawCell -= this.object_0_CustomDrawCell;
|
||||
gridView.CustomDrawColumnHeader -= this.object_0_CustomDrawColumnHeader;
|
||||
gridView.CustomDrawFooterCell -= this.object_0_CustomDrawFooterCell;
|
||||
}
|
||||
if (gridControl != null)
|
||||
{
|
||||
gridControl.Paint -= this.method_0;
|
||||
}
|
||||
|
||||
this.dictionary_0.Clear();
|
||||
this.list_0.Clear();
|
||||
}
|
||||
|
||||
private GridView object_0;
|
||||
private GridControl gridControl_0;
|
||||
private bool disposed;
|
||||
|
||||
private Color colorGray;
|
||||
private Color colorGreen;
|
||||
|
||||
Reference in New Issue
Block a user