Enhanced Documents – various improvements

Enhanced Documents – existing docversion properties UI
This commit is contained in:
2016-01-20 16:35:48 +00:00
parent 33850f59c1
commit 77cdf81736
4 changed files with 1353 additions and 629 deletions

View File

@@ -150,6 +150,44 @@ namespace VEPROMS
set { _SelectedROFst = value; }
}
#endregion
private frmVEPROMS _MyParent;
public frmVEPROMS MyParent
{
get { return _MyParent; }
set { _MyParent = value; }
}
//private FolderInfo _MyFolder = null;
//public FolderInfo MyFolder
//{
// get { return _MyFolder; }
// set { _MyFolder = value; }
//}
private DocVersionInfo _MyDocVersion = null;
public DocVersionInfo MyDocVersion
{
get { return _MyDocVersion; }
set { _MyDocVersion = value; }
}
public frmVEPROMS(frmVEPROMS myParent, DocVersionInfo myDocVersion)
{
MyParent = myParent;
MyDocVersion=myDocVersion;
InitializeComponent();
SetupFolder(MyDocVersion.FolderID);
tc.MySessionInfo = MyParent.MySessionInfo;
displaySearch1.TopFolderID = myDocVersion.FolderID;
SelectedDVI = myDocVersion;
tc.VersionID = myDocVersion.VersionID;
}
public void OpenItem(ItemInfo myItemInfo)
{
tc.OpenItem(myItemInfo);
}
public void RefreshItem(ItemInfo myItemInfo)
{
tc.RefreshItem(myItemInfo);
}
public frmVEPROMS()
{
// The following Try/Catch was added to protect against a problem seen by Kathy and Michelle
@@ -280,7 +318,13 @@ namespace VEPROMS
else if (parameter.ToUpper().StartsWith("/UF"))
UpdateFormats(null);
}
VETreeNode tn = VETreeNode.GetFolder(1);
SetupFolder(1);
tc.VersionID = 0;
}
private void SetupFolder(int folderID)
{
VETreeNode tn = VETreeNode.GetFolder(folderID);
tv.Nodes.Add(tn);
tv.NodePSI += new vlnTreeViewPSIEvent(tv_NodePSI);
tv.NodeSI += new vlnTreeViewSIEvent(tv_NodeSI);
@@ -293,9 +337,9 @@ namespace VEPROMS
tv.NodeInsert += new vlnTreeViewEvent(tv_NodeInsert);
tv.PasteItemInfo += new vlnTreeViewItemInfoPasteEvent(tv_PasteItemInfo);
tv.GetChangeId += new vlnTreeViewGetChangeIdEvent(tv_GetChangeId);
tv.NodeCopy += new vlnTreeViewEvent(tv_NodeCopy);
tv.ClipboardStatus += new vlnTreeViewClipboardStatusEvent(tv_ClipboardStatus);
tv.ProgressBar = bottomProgBar;
tv.NodeCopy += new vlnTreeViewEvent(tv_NodeCopy);
tv.ClipboardStatus += new vlnTreeViewClipboardStatusEvent(tv_ClipboardStatus);
tv.ProgressBar = bottomProgBar;
tc.ItemPaste += new StepPanelItemPastedEvent(tc_ItemPasted);
displayHistory.HistorySelectionChanged += new DisplayHistoryEvent(displayHistory_HistorySelectionChanged);
_CommentTitleBckColor = epAnnotations.TitleStyle.BackColor1.Color;
@@ -329,7 +373,7 @@ namespace VEPROMS
tv.ProcedureCheckedOutTo += new vlnTreeViewEvent(tv_ProcedureCheckedOutTo);
tv.ViewPDF += new vlnTreeViewPdfEvent(tv_ViewPDF);
displayApplicability.ApplicabilityViewModeChanged += new DisplayApplicability.DisplayApplicabilityEvent(displayApplicability_ApplicabilityViewModeChanged);
tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets);
tv.ExportImportProcedureSets += new vlnTreeViewEvent(tv_ExportImportProcedureSets);
tv.PrintTransitionReport += new vlnTreeViewEvent(tv_PrintTransitionReport);
tv.ProcessingComplete += tv_ProcessingComplete;
tv.Processing += tv_Processing;
@@ -923,22 +967,25 @@ namespace VEPROMS
}
private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e)
{
if (MyActivityTimer != null)MyActivityTimer.Dispose();
if(MySessionInfo != null)MySessionInfo.EndSession();
// Save the location and size of the VE-PROMS appication for this user
if (this.WindowState == FormWindowState.Normal)
if (MyParent == null)
{
Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size;
if (MyActivityTimer != null) MyActivityTimer.Dispose();
if (MySessionInfo != null) MySessionInfo.EndSession();
// Save the location and size of the VE-PROMS appication for this user
if (this.WindowState == FormWindowState.Normal)
{
Settings.Default.Location = this.Location;
Settings.Default.Size = this.Size;
}
if (this.MyVersionWindowList != null)
Settings.Default.VersionWindows = this.MyVersionWindowList.ToSettings();
Settings.Default.WindowState = this.WindowState;
Settings.Default.QATItems = ribbonControl1.QatLayout;
SaveMRU();
//Settings.Default.Save();
Volian.Base.Library.DebugPagination.Close();
Volian.Base.Library.DebugText.Close();
}
if(this.MyVersionWindowList != null)
Settings.Default.VersionWindows = this.MyVersionWindowList.ToSettings();
Settings.Default.WindowState = this.WindowState;
Settings.Default.QATItems = ribbonControl1.QatLayout;
SaveMRU();
//Settings.Default.Save();
Volian.Base.Library.DebugPagination.Close();
Volian.Base.Library.DebugText.Close();
}
void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
{
@@ -947,13 +994,16 @@ namespace VEPROMS
// RHM 20121010
// Something was causing the process to remain in memory for an extended period of time
// after printing procedures. The following lines kills the process immediately.
try
if (MyParent == null)
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
catch (Exception ex)
{
_MyLog.Warn("Attempting to Close", ex);
try
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
}
catch (Exception ex)
{
_MyLog.Warn("Attempting to Close", ex);
}
}
}
// Get the "Procedures" Panel Heading (title).
@@ -1022,7 +1072,16 @@ namespace VEPROMS
}
}
private SessionInfo MySessionInfo;
private SessionInfo _MySessionInfo;
public SessionInfo MySessionInfo
{
get {
if (_MySessionInfo == null)
_MySessionInfo = MyParent.MySessionInfo;
return _MySessionInfo;
}
set { _MySessionInfo = value; }
}
private System.Threading.Timer MyActivityTimer;
private System.Threading.Timer MyRefreshTimer;
private DevComponents.DotNetBar.ButtonItem btnManageSecurity;
@@ -1204,20 +1263,20 @@ namespace VEPROMS
tmrCloseTabItems.Enabled = true;
CloseSessionsNoLongerActive();
MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id);
if (MySessionInfo == null)
{
MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked");
Application.Exit();
}
this.LastContentChange = MySessionInfo.LastContentChange;
_MyLog.WarnFormat("Original last content change {0}", this.LastContentChange);
RefreshLastChange();
if (MySessionInfo == null)
{
MessageBox.Show("This database is locked by the Administrator. Please try again later", "PROMS is Locked");
Application.Exit();
}
tc.MySessionInfo = MySessionInfo;
tv.MySessionInfo = MySessionInfo;
System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false);
//System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(MySessionInfo.PingSession);
//System.Diagnostics.Process xyzzy = System.Diagnostics.Process.GetCurrentProcess();
if(!System.Diagnostics.Debugger.IsAttached)// running in Production Mode (Not in the debugger)
if (!System.Diagnostics.Debugger.IsAttached)// running in Production Mode (Not in the debugger)
{
System.Threading.TimerCallback timerDelegate = new System.Threading.TimerCallback(this.PingSession);
MyActivityTimer = new System.Threading.Timer(timerDelegate, autoEvent, 10000, 10000);
@@ -1232,7 +1291,7 @@ namespace VEPROMS
// get the saved location and size of the VE-PROMS appication for this user
this.txtSearch.KeyPress += new KeyPressEventHandler(txtSearch_KeyPress);
this.txtSearch.KeyUp += txtSearch_KeyUp; // RHM20150506 Multiline ItemID TextBox
this.txtSearch.TextChanged+=txtSearch_TextChanged; // RHM20150506 Multiline ItemID TextBox
this.txtSearch.TextChanged += txtSearch_TextChanged; // RHM20150506 Multiline ItemID TextBox
this.btnNext.Click += btnNext_Click; // RHM20150506 Multiline ItemID TextBox
this.btnPrint1.Click += btnPrint1_Click; // RHM20150506 Multiline ItemID TextBox
this.btnPrevious.Click += btnPrevious_Click; // RHM20150506 Multiline ItemID TextBox
@@ -1243,7 +1302,7 @@ namespace VEPROMS
// if the Procedures panel was left open from the last session, then open it
epProcedures.Expanded = Settings.Default.TreeviewExpanded;
if (Settings.Default["QATItems"] != null) ribbonControl1.QatLayout = Settings.Default.QATItems;
// See if any database 'changes' need done and do them:
MakeDatabaseChanges();
@@ -1253,11 +1312,14 @@ namespace VEPROMS
// if the user selected to "Remember Last" (was "Save Expanded") then use the MRU list to
// expand the tree to the last opened procedure
//if (epProcedures.Expanded && _MyMRIList.Count > 0)
if (Settings.Default.SaveTreeviewExpanded && _MyMRIList.Count > 0)
if (MyParent == null)
{
tv.AdjustTree(_MyMRIList[0].MyItemInfo.MyProcedure);
tv.SelectedNode.Expand();
SetCaption(tv.SelectedNode as VETreeNode);
if (Settings.Default.SaveTreeviewExpanded && _MyMRIList.Count > 0)
{
tv.AdjustTree(_MyMRIList[0].MyItemInfo.MyProcedure);
tv.SelectedNode.Expand();
SetCaption(tv.SelectedNode as VETreeNode);
}
}
//get version windows settings
MyVersionWindowList = VersionWindowList.GetVersionWindowList(Properties.Settings.Default.VersionWindows);
@@ -1273,13 +1335,14 @@ namespace VEPROMS
ctrlAnnotationDetails.SetupAnnotations(displaySearch1);
SetupButtons();
displayBookMarks.MyDisplayTabControl = tc; // allows bookmark selection to bring up steps/docs
office2007StartButton1.MouseDown +=new MouseEventHandler(office2007StartButton1_MouseDown);
office2007StartButton1.MouseDown += new MouseEventHandler(office2007StartButton1_MouseDown);
//displayRO.EnabledChanged += new EventHandler(displayRO_EnabledChanged);
tc.Enter += new EventHandler(tc_Enter);
tc.Leave += new EventHandler(tc_Leave);
tc.StatusChanged += new DisplayTabControlStatusEvent(tc_StatusChanged);
tc.ToggleRibbonExpanded += new DisplayTabControlEvent(tc_ToggleRibbonExpanded);
tc.OpenEnhancedDocument += tc_OpenEnhancedDocument;
tc.RefreshEnhancedDocument += tc_RefreshEnhancedDocument;
this.Deactivate += new EventHandler(frmVEPROMS_Deactivate);
if (VlnSettings.DemoMode) StepRTB.MyFontFamily = GetFamily("Bookman Old Style");
displaySearch1.Enter += new EventHandler(displaySearch1_Enter);
@@ -1300,7 +1363,7 @@ namespace VEPROMS
// btnAdmin.Visible = false;
StepTabRibbon.PasteNoReturnsSetting = Properties.Settings.Default.PasteNoReturns;
StepTabRibbon.PastePlainTextSetting = Properties.Settings.Default.PastePlainText;
Activate();
Activate();
//FolderInfo fi = FolderInfo.Get(1);
//FormatInfo frmI = FormatInfo.Get(fi.FormatID ?? 1);
//if (frmI.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds)
@@ -1308,12 +1371,34 @@ namespace VEPROMS
// dlgChgId dlgCI = new dlgChgId(tc);
// dlgCI.ShowDialog(this);
//}
// RHM20150506 Multiline ItemID TextBox
this.txtSearch.Text = Volian.Base.Library.VlnSettings.GetItemIDs().Replace(",","\r\n");
// Open First Item
if (this.txtSearch.Text.Length > 0 && !this.txtSearch.Text.Contains("\r\n"))
CurrentID = txtSearch.Text;
// RHM20150506 Multiline ItemID TextBox
if (MyParent == null)
{
this.txtSearch.Text = Volian.Base.Library.VlnSettings.GetItemIDs().Replace(",", "\r\n");
// Open First Item
if (this.txtSearch.Text.Length > 0 && !this.txtSearch.Text.Contains("\r\n"))
CurrentID = txtSearch.Text;
}
}
void tc_RefreshEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
{
// if the procedure is opened then move to the select step
if (!Properties.Settings.Default.SeparateWindows)
{
tc.RefreshItem(args.MyItemInfo);
}
else
{
int versionID = args.MyItemInfo.MyDocVersion.VersionID;
frmVEPROMS child = null;
if (EnhancedForms.ContainsKey(versionID))
{
child = EnhancedForms[versionID];
child.RefreshItem(args.MyItemInfo);
}
}
}
/// <summary>
/// This looks for sessions associated with the current PC and user which are no longer active and removes them.
/// This will in-turn close any related procedure owner records and allow the user to re-open a previously open procedure.
@@ -1342,6 +1427,22 @@ namespace VEPROMS
// return true;
// return false;
//}
Dictionary<int, frmVEPROMS> _EnhancedForms=null;
public Dictionary<int, frmVEPROMS> EnhancedForms
{
get
{
if(_EnhancedForms == null)
{
if (_MyParent == null)
_EnhancedForms = new Dictionary<int, frmVEPROMS>();
else
_EnhancedForms = MyParent.EnhancedForms;
}
return _EnhancedForms;
}
set { _EnhancedForms = value; }
}
void tc_OpenEnhancedDocument(object sender, ItemSelectedChangedEventArgs args)
{
if (!Properties.Settings.Default.SeparateWindows)
@@ -1350,45 +1451,75 @@ namespace VEPROMS
}
else
{
if (!tc.dicEnhancedDocuments.ContainsKey(args.MyItemInfo.MyProcedure.MyDocVersion))
int versionID = args.MyItemInfo.MyDocVersion.VersionID;
if(MyParent != null && args.MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments.Count > 0
&& !args.MyItemInfo.MyDocVersion.DocVersionConfig.MyEnhancedDocuments.HasSourcePointer)
{
frmEnhanced frm = new frmEnhanced(args.MyItemInfo);
foreach (VersionWindow vw in MyVersionWindowList)
if (vw.VersionID == args.MyItemInfo.MyProcedure.MyDocVersion.VersionID)
{
frm.SetDesktopBounds(vw.MyRectangle.Left, vw.MyRectangle.Top, vw.MyRectangle.Width, vw.MyRectangle.Height);
break;
}
frm.Move += frmEnhancedDocumentResize;
frm.Resize += frmEnhancedDocumentResize;
frm.MySessionInfo = MySessionInfo;
tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm);
frm.FormClosed += frm_FormClosed;
//frm.Show(this); When this was specified the child form displayed on top of the parent form.
frm.Show(); // With this removed either form can be on top (user selectable - currently active form on top)
MyParent.OpenItem(args.MyItemInfo);
return;
}
frmVEPROMS child = null;
if (EnhancedForms.ContainsKey(versionID))
child = EnhancedForms[versionID];
else
{
frmEnhanced frm = tc.dicEnhancedDocuments[args.MyItemInfo.MyProcedure.MyDocVersion];
frm.MyItemInfo = args.MyItemInfo;
frm.OpenItem();
child = CreateEnhancedWindow(args.MyItemInfo.MyDocVersion);
}
child.OpenItem(args.MyItemInfo);
//if (!tc.dicEnhancedDocuments.ContainsKey(args.MyItemInfo.MyProcedure.MyDocVersion))
//{
// frmEnhanced frm = new frmEnhanced(args.MyItemInfo);
// frm.MySessionInfo = MySessionInfo;
// tc.dicEnhancedDocuments.Add(args.MyItemInfo.MyProcedure.MyDocVersion, frm);
// frm.FormClosed += frm_FormClosed;
// //frm.Show(this); When this was specified the child form displayed on top of the parent form.
// frm.Show(); // With this removed either form can be on top (user selectable - currently active form on top)
//}
//else
//{
// frmEnhanced frm = tc.dicEnhancedDocuments[args.MyItemInfo.MyProcedure.MyDocVersion];
// frm.MyItemInfo = args.MyItemInfo;
// frm.OpenItem();
//}
}
}
}
void frmEnhancedDocumentResize(object sender, EventArgs e)
private frmVEPROMS CreateEnhancedWindow(DocVersionInfo dvi)
{
frmEnhanced frm = sender as frmEnhanced;
RectangleConverter rc = new RectangleConverter();
string str = string.Format("{0}~{1}", frm.MyItemInfo.MyProcedure.MyDocVersion.VersionID, rc.ConvertToString(frm.DesktopBounds));
MyVersionWindowList.Add(new VersionWindow(str));
frmVEPROMS child;
if (EnhancedForms.ContainsKey(dvi.VersionID))
{
child = EnhancedForms[dvi.VersionID];
}
else{
child = new frmVEPROMS(this, dvi);
EnhancedForms.Add(dvi.VersionID, child);
child.Visible = false;
child.Show();
foreach (VersionWindow vw in MyVersionWindowList)
if (vw.VersionID == dvi.VersionID)
{
child.SetDesktopBounds(vw.MyRectangle.Left, vw.MyRectangle.Top, vw.MyRectangle.Width, vw.MyRectangle.Height);
break;
}
child.Visible = true;
child.Move += child_MoveOrSize;
child.Resize += child_MoveOrSize;
child.FormClosed += child_FormClosed;
}
return child;
}
void frm_FormClosed(object sender, FormClosedEventArgs e)
void child_FormClosed(object sender, FormClosedEventArgs e)
{
tc.dicEnhancedDocuments.Remove((sender as frmEnhanced).MyItemInfo.MyProcedure.MyDocVersion);
EnhancedForms.Remove((sender as frmVEPROMS).MyDocVersion.VersionID) ;
}
void child_MoveOrSize(object sender, EventArgs e)
{
frmVEPROMS frm = sender as frmVEPROMS;
RectangleConverter rc = new RectangleConverter();
string str = string.Format("{0}~{1}", frm.MyDocVersion.VersionID, rc.ConvertToString(frm.DesktopBounds));
MyVersionWindowList.Add(new VersionWindow(str));
}
private bool HasSetAdministrator(UserInfo ui)
{
DocVersionInfoList dvil = DocVersionInfoList.Get();
@@ -1646,16 +1777,19 @@ namespace VEPROMS
Membership.MakeMembership(u, g, null, "");
}
}
if (VlnSettings.GetCommandFlag("VeauLeeAnn" + GetSecurityKey()) || VlnSettings.GetCommandFlag("VeauLeeAnnXYZZY" ))
if (MyParent == null)
{
//pop up user list to select from
ContextMenuStrip cms = BuildUserMenu();
while (proxyUser == null)
if (VlnSettings.GetCommandFlag("VeauLeeAnn" + GetSecurityKey()) || VlnSettings.GetCommandFlag("VeauLeeAnnXYZZY"))
{
cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2));
System.Windows.Forms.Application.DoEvents();
//pop up user list to select from
ContextMenuStrip cms = BuildUserMenu();
while (proxyUser == null)
{
cms.Show(new System.Drawing.Point((System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - cms.Width) / 2, (System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - cms.Height) / 2));
System.Windows.Forms.Application.DoEvents();
}
VlnSettings.UserID = proxyUser;
}
VlnSettings.UserID = proxyUser;
}
lblUser.Text = VlnSettings.UserID;
lblUser.MouseDown += new MouseEventHandler(lblUser_MouseDown);
@@ -2152,11 +2286,22 @@ namespace VEPROMS
//_MyLog.DebugFormat("tv_BeforeExpand \n{0}",Volian.Base.Library.vlnStackTrace.StackToStringLocal(2,10));
_ExpandingTree = true;
VETreeNode tn = ((VETreeNode)e.Node);
tn.LoadingChildrenDone += new VETreeNodeEvent(tn_LoadingChildrenDone);
tn.LoadingChildrenMax += new VETreeNodeEvent(tn_LoadingChildrenMax);
tn.LoadingChildrenValue += new VETreeNodeEvent(tn_LoadingChildrenValue);
tn.LoadingChildrenSQL += new VETreeNodeEvent(tn_LoadingChildrenSQL);
tn.LoadChildren(true);
if (MyParent == null &&
Properties.Settings.Default.SeparateWindows && tn.VEObject is FolderInfo
&& (tn.VEObject as FolderInfo).FolderDocVersionCount == 1
&& (tn.VEObject as FolderInfo).FolderDocVersions[0].DocVersionConfig.MyEnhancedDocuments.HasSourcePointer)
{
CreateEnhancedWindow((tn.VEObject as FolderInfo).FolderDocVersions[0]);
tn.Nodes.Clear();
}
else
{
tn.LoadingChildrenDone += new VETreeNodeEvent(tn_LoadingChildrenDone);
tn.LoadingChildrenMax += new VETreeNodeEvent(tn_LoadingChildrenMax);
tn.LoadingChildrenValue += new VETreeNodeEvent(tn_LoadingChildrenValue);
tn.LoadingChildrenSQL += new VETreeNodeEvent(tn_LoadingChildrenSQL);
tn.LoadChildren(true);
}
}
#region Property Page and Grid
DialogResult tv_NodeOpenProperty(object sender, vlnTreePropertyEventArgs args)
@@ -2754,6 +2899,7 @@ namespace VEPROMS
private StepRTB _LastStepRTB = null;
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
if (args != null && args.MyEditItem != null && !args.MyEditItem.MyStepPanel.ContainsFocus) return;
btnFixMSWord.Visible = (args != null && ( args.MyItemInfo != null && args.MyEditItem == null));
if (_LastStepRTB != null && !_LastStepRTB.Disposing && !_LastStepRTB.Closed)
_LastStepRTB.EditModeChanged -= new StepRTBEvent(_LastStepRTB_EditModeChanged);
@@ -2882,6 +3028,19 @@ namespace VEPROMS
E_ROValueType.Table : (SelectedStepTabPanel.MyStepPanel.SelectedEditItem.MyItemInfo.IsFigure) ? E_ROValueType.Image : E_ROValueType.Text;
if (_LastStepRTB.IsRoTable && _LastStepRTB.MyItemInfo.MyContent.ContentRoUsageCount > 0)
displayRO.CurROLink = _LastStepRTB.MyItemInfo.MyContent.ContentRoUsages[0];
// if this is an enhanced step (linked from a source document), don't bring up the ro or transition panel,
// and don't allow replace on the find/replace dialog.
if (args.MyItemInfo.IsEnhancedStep)
{
// originally had these two lines to make the step properties panel/tran & ro tabs invisitble for
// enhanced steps but this was causing an error in the caret management code in StepTabPanel (Hide/ShowCaret)
//infotabTransition.Visible = false;
//infotabRO.Visible = false;
// RHM: Had to use a timer to keep from getting into an infinite loop
// Not sure why , but tc_Leave was being called over and over again.
//KBR:TmrSetTransROInVisible.Enabled = true;
}
}
else
{
@@ -2896,7 +3055,28 @@ namespace VEPROMS
}
btnPrint.Enabled = (_CurrentItem != null);
}
/*KBR:Timer _tmrSetTransROInVisible;
public Timer TmrSetTransROInVisible
{
get
{
if (_tmrSetTransROInVisible == null)
{
_tmrSetTransROInVisible = new Timer();
_tmrSetTransROInVisible.Enabled = false;
_tmrSetTransROInVisible.Interval = 50;
_tmrSetTransROInVisible.Tick += _tmrSetTransROInVisible_Tick;
}
return _tmrSetTransROInVisible;
}
}
void _tmrSetTransROInVisible_Tick(object sender, EventArgs e)
{
TmrSetTransROInVisible.Enabled = false;
infotabTransition.Visible = false;
infotabRO.Visible = false;
}
*/
void _LastStepRTB_EditModeChanged(object sender, EventArgs args)
{
if (_LastStepRTB.EditMode) // going into edit mode in a cell of the grid.
@@ -3482,7 +3662,7 @@ namespace VEPROMS
}
}
}
#region Lock stuff
#region Lock stuff / used for multi-user support
public class TabItemsToClose : Stack<DisplayTabItem>
{
public void PushDTI(DisplayTabItem dti)
@@ -3512,4 +3692,71 @@ namespace VEPROMS
}
}
#endregion
public class VersionWindow
{
private int _VersionID;
public int VersionID
{
get { return _VersionID; }
set { _VersionID = value; }
}
private int _DBId;
public int DBId
{
get { return _DBId; }
set { _DBId = value; }
}
private Rectangle _MyRectangle;
public Rectangle MyRectangle
{
get { return _MyRectangle; }
set { _MyRectangle = value; }
}
public override string ToString()
{
RectangleConverter rc = new RectangleConverter();
return string.Format("{0}~{1}", _VersionID, rc.ConvertToString(_MyRectangle));
}
public VersionWindow(string str)
{
string[] parts = str.Split('~');
_VersionID = int.Parse(parts[0]);
RectangleConverter rc = new RectangleConverter();
_MyRectangle = (Rectangle)rc.ConvertFromString(parts[1]);
}
}
public class VersionWindowList : List<VersionWindow>
{
public static VersionWindowList GetVersionWindowList(System.Collections.Specialized.StringCollection list)
{
VersionWindowList vwl = new VersionWindowList();
if (list != null)
{
foreach (string str in list)
vwl.Add(new VersionWindow(str));
}
return vwl;
}
public System.Collections.Specialized.StringCollection ToSettings()
{
if (Count == 0) return null;
System.Collections.Specialized.StringCollection retval = new System.Collections.Specialized.StringCollection();
foreach (VersionWindow vw in this)
retval.Add(vw.ToString());
return retval;
}
public new void Add(VersionWindow versionWindow)
{
foreach (VersionWindow vw in this)
{
if (vw.VersionID == versionWindow.VersionID)
{
this.Remove(vw);
break;
}
}
base.Add(versionWindow);
}
}
}