Reduced duplicated Audits
Added comments Added and used calculated IsDirty Property
This commit is contained in:
@@ -17,6 +17,12 @@ namespace Volian.Controls.Library
|
||||
public partial class GridItem : EditItem
|
||||
{
|
||||
#region Fields
|
||||
private bool _IsSaving;
|
||||
public bool IsSaving
|
||||
{
|
||||
get { return _IsSaving; }
|
||||
set { _IsSaving = value; }
|
||||
}
|
||||
public VlnFlexGrid MyFlexGrid
|
||||
{
|
||||
get { return _MyFlexGrid; }
|
||||
@@ -381,8 +387,10 @@ namespace Volian.Controls.Library
|
||||
//_MyToolTip.SetSuperTooltip(MyStepRTB, tpi);
|
||||
_MyToolTip.SetSuperTooltip(MyFlexGrid, tpi);
|
||||
}
|
||||
private bool DoNotRefresh = false;
|
||||
public override void RefreshContent()
|
||||
{
|
||||
if (DoNotRefresh) return;
|
||||
_ActiveMode = MyFlexGrid.ContainsFocus;
|
||||
using (Grid myGrid = MyItemInfo.MyContent.MyGrid.Get())
|
||||
{
|
||||
@@ -432,6 +440,7 @@ namespace Volian.Controls.Library
|
||||
public override void SetFocus() { MyFlexGrid.Focus();}
|
||||
public override void SaveContents()
|
||||
{
|
||||
if (!MyFlexGrid.IsDirty && !IsSaving) return;
|
||||
List<int> RtfRoUsageList = new List<int>();
|
||||
List<int> RtfTransList = new List<int>();
|
||||
|
||||
@@ -1144,17 +1153,22 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
public override void SaveCurrentAndContents()
|
||||
{
|
||||
IsSaving = true;
|
||||
if (MyFlexGrid.Row >= 0 && MyFlexGrid.Col >= 0 && MyStepRTB.EditMode) // Only if a Cell is Selected
|
||||
{
|
||||
int row = MyFlexGrid.Row;
|
||||
int col = MyFlexGrid.Col;
|
||||
SaveContents();
|
||||
//SaveContents();
|
||||
DoNotRefresh = true;
|
||||
MyStepRTB.Rtf = MyStepRTB.DoNewLinkInGridCell();
|
||||
DoNotRefresh = false;
|
||||
MyFlexGrid.Row = row;
|
||||
MyFlexGrid.Col = col;
|
||||
MyFlexGrid[MyFlexGrid.Row, MyFlexGrid.Col] = MyStepRTB.Rtf;
|
||||
}
|
||||
if (!MyFlexGrid.IsDirty) return;
|
||||
SaveContents();
|
||||
IsSaving = false;
|
||||
}
|
||||
#endregion
|
||||
#region Miscellaneous Support
|
||||
|
Reference in New Issue
Block a user