Open Enhanced Document from Procedure or Procedure from Enhanced Document

Added new feature to keep Background Document and Deviation Documents in Sync as the user moves through the procedure.
Support ReadOnly steps for Enhanced Documents linked steps.
This commit is contained in:
Rich
2015-09-12 15:47:44 +00:00
parent 551b71e525
commit a87decdbe3
3 changed files with 173 additions and 75 deletions

View File

@@ -172,7 +172,7 @@ namespace Volian.Controls.Library
// for hls in background documents - without this, the tab gets overwritten by the rtb.
if (MyItemInfo.FormatStepData == null || MyItemInfo.FormatStepData.TabData.IdentEdit.Contains("{Section Prefix}") || !MyItemInfo.IsHigh ||
(MyItemInfo.IsHigh && MyItemInfo.FormatStepData.PageBreakOnStep))
_MyStepRTB.Left = lblTab.Left + lblTab.Width;
_MyStepRTB.Left = lblTab.Left + lblTab.Width;
_MyStepRTB.Width = Width - _MyStepRTB.Left - RTBMargin - CheckOffMargin;
}
_TabFormat = value;
@@ -410,11 +410,53 @@ namespace Volian.Controls.Library
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private bool _ProcessingEnter = false;
private void _StepRTB_Enter(object sender, EventArgs e)
{
if (MyStepPanel.DisplayItemChanging) return;
//vlnStackTrace.ShowStack("_StepRTB_Enter {0}",this.MyID);
MyStepPanel.SelectedEditItem = this;
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.SyncEnhancedDocuments)
{
if (!_ProcessingEnter)
{
_ProcessingEnter = true;
DisplayTabItem dti = null;
StepConfig sc = new StepConfig(MyItemInfo.MyContent.Config);
if (sc.Step_SourceToBackground != null && sc.Step_SourceToDeviation != null)
{
ItemInfo bii = ItemInfo.Get(int.Parse(sc.Step_SourceToBackground));
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(bii))
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(bii));
// dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(bii);
ItemInfo dii = ItemInfo.Get(int.Parse(sc.Step_SourceToDeviation));
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(dii))
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(dii));
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(dii);
if (dti != null)
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
}
else if (sc.Step_SourceToBackground != null && sc.Step_SourceToDeviation == null)
{
ItemInfo bii = ItemInfo.Get(int.Parse(sc.Step_SourceToBackground));
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(bii))
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(bii));
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(bii);
if (dti != null)
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
}
else if (sc.Step_SourceToBackground == null && sc.Step_SourceToDeviation != null)
{
ItemInfo dii = ItemInfo.Get(int.Parse(sc.Step_SourceToDeviation));
if (MyStepPanel.MyStepTabPanel.MyDisplayTabControl.IsItemInfoProcedureOpen(dii))
MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OnOpenEnhancedDocument(new ItemSelectedChangedEventArgs(dii));
//dti = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.OpenItem(dii);
if (dti != null)
dti.MyStepTabPanel.MyDisplayTabControl.OpenItem(this.MyItemInfo);
}
_ProcessingEnter = false;
}
}
}
/// <summary>
/// Pass the AttachmentClick event to the StepPanel control.
@@ -676,6 +718,7 @@ namespace Volian.Controls.Library
{
if (MyStepRTB.ReadOnly) return;
if (!MyStepRTB.ActiveMode) return;
if (MyStepRTB.IsExperimenting) return;
if (MyStepRTB.MyItemInfo.MyContent.Number != null && !MyStepRTB.IsDirty && MyStepRTB.Text.Contains("(Resolved Transition Text)") == false) return;
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
if (success)