B2019-043 Added checks for being in design mode during initialization of variables

B2019-043 Added checks for being in design mode during initialization of variables.  Also needed to remove the parameter from the constructor
This commit is contained in:
2019-03-22 15:19:19 +00:00
parent 94f18653eb
commit b29176f636
11 changed files with 112 additions and 76 deletions

View File

@@ -28,9 +28,12 @@ namespace Volian.Controls.Library
get { return _ProcItem; }
set
{
//if (_ProcItem == value) return; // Jeff (Westinghouse) requested list to be provided every time fixes both C2016-007 and B2016-097
_ProcItem = value;
if (ExeType > 0) CreateProcList();
if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface
{
//if (_ProcItem == value) return; // Jeff (Westinghouse) requested list to be provided every time fixes both C2016-007 and B2016-097
_ProcItem = value;
if (ExeType > 0) CreateProcList();
}
}
}
@@ -93,12 +96,15 @@ namespace Volian.Controls.Library
get { return _CurrentItem; }
set
{
_CurrentItem = value;
SetupCurrentItemValues();
SetupConfigEdit();
// B2017-126 Only turn-on NamedPipe if Command Line parameter /NamedPipe is used.
// This eliminates waiting for the Pipe if the command line parameter is not used.
if (ExeType > 0 && Volian.Base.Library.VlnSettings.GetCommandFlag("NamedPipe")) SendPromsAnnotationData();
if (!DesignMode && value != null) // B2019-043 need to check if we are just saving changes to the user interface
{
_CurrentItem = value;
SetupCurrentItemValues();
SetupConfigEdit();
// B2017-126 Only turn-on NamedPipe if Command Line parameter /NamedPipe is used.
// This eliminates waiting for the Pipe if the command line parameter is not used.
if (ExeType > 0 && Volian.Base.Library.VlnSettings.GetCommandFlag("NamedPipe")) SendPromsAnnotationData();
}
}
}
private int _FromType;
@@ -124,7 +130,7 @@ namespace Volian.Controls.Library
}
private void SetupConfigEdit()
{
if (ExeType == 0) ; // initialize ExeType
//if (ExeType == 0) ; // initialize ExeType
}
private string _ExePath;
private string _PipeOut;
@@ -135,7 +141,7 @@ namespace Volian.Controls.Library
{
get
{
if (_ExeType == 0)
if (!DesignMode && _ExeType == 0) // B2019-043 need to check if we are just saving changes to the user interface
{
_ExeType = -1;
foreach (AnnotationTypeInfo ati in AnnotationTypeInfoList.Get())
@@ -163,9 +169,12 @@ namespace Volian.Controls.Library
{
get { return _Annotations; }
set
{
_Annotations = value;
itemAnnotationsBindingSource.DataSource = _Annotations;
{
if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface
{
_Annotations = value;
itemAnnotationsBindingSource.DataSource = _Annotations;
}
}
}
@@ -175,6 +184,7 @@ namespace Volian.Controls.Library
get { return _CurrentAnnotation; }
set
{
if (DesignMode) return; // B2019-043 need to check if we are just saving changes to the user interface
if (_CurrentAnnotation == null && value == null) return; // No Change
if (_CurrentAnnotation != null && value != null)
if (_CurrentAnnotation.AnnotationID == value.AnnotationID) return; // No Change
@@ -207,9 +217,12 @@ namespace Volian.Controls.Library
get { return rtxbComment.Text; }
set
{
rtxbComment.Text = value;
if (rtxbComment.Text != string.Empty)
rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text
if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface
{
rtxbComment.Text = value;
if (rtxbComment.Text != string.Empty)
rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text
}
}
}
@@ -218,9 +231,12 @@ namespace Volian.Controls.Library
get { return rtxbComment.Rtf; }
set
{
rtxbComment.Rtf = value;
if (rtxbComment.Rtf != string.Empty)
rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text
if (!DesignMode) // B2019-043 need to check if we are just saving changes to the user interface
{
rtxbComment.Rtf = value;
if (rtxbComment.Rtf != string.Empty)
rtxbComment.SelectionStart = rtxbComment.TextLength; // position cursor to end of text
}
}
}
private UserInfo _MyUserInfo;
@@ -413,13 +429,16 @@ namespace Volian.Controls.Library
private void StartClientProcess()
{
_ClientProcess = Process.Start(_ExePath);
_ClientProcess.WaitForInputIdle();
_ClientProcess.Exited += ClientProcess_Exited;
if (_ExePath != null) // B2019-043 if we are just saving changes to the user interface don't do anything
{
_ClientProcess = Process.Start(_ExePath);
_ClientProcess.WaitForInputIdle();
_ClientProcess.Exited += ClientProcess_Exited;
}
}
private void SendPromsAnnotationData()
{
Console.WriteLine("Send {0}", CurrentItem);
//Console.WriteLine("Send {0}", CurrentItem);
XmlDocument xdMessage = new XmlDocument();
xdMessage.LoadXml("<PromsToClient Mode='AnnotationSetup'><PromsAnnotationConfig/></PromsToClient>");
// Add Steps Data
@@ -496,7 +515,7 @@ namespace Volian.Controls.Library
private void ProcessMessage(string message)
{
Console.WriteLine(message);
//Console.WriteLine(message);
XmlDocument xd = new XmlDocument();
xd.LoadXml(message);
string Mode = GetAttribute(xd, "ClientToProms", "Mode");