diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs index d3a6b6b4..5e5fbaff 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.Designer.cs @@ -3012,12 +3012,12 @@ namespace VEPROMS this.tc.Location = new System.Drawing.Point(37, 147); this.tc.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.tc.Name = "tc"; - this.tc.SelectedTab = null; + this.tc.SelectedDisplayTabItem = null; this.tc.Size = new System.Drawing.Size(962, 571); this.tc.TabIndex = 8; - this.tc.LinkModifyTran += new Volian.Controls.Library.DisplayPanelLinkEvent(this.tc_LinkModifyTran); - this.tc.ItemSelectedChanged += new Volian.Controls.Library.DisplayPanelEvent(this.tc_ItemSelectedChanged); - this.tc.LinkModifyRO += new Volian.Controls.Library.DisplayPanelLinkEvent(this.tc_LinkModifyRO); + this.tc.LinkModifyTran += new Volian.Controls.Library.StepPanelLinkEvent(this.tc_LinkModifyTran); + this.tc.ItemSelectedChanged += new Volian.Controls.Library.StepPanelEvent(this.tc_ItemSelectedChanged); + this.tc.LinkModifyRO += new Volian.Controls.Library.StepPanelLinkEvent(this.tc_LinkModifyRO); // // itemAnnotationsBindingSource // diff --git a/PROMS/VEPROMS User Interface/frmVEPROMS.cs b/PROMS/VEPROMS User Interface/frmVEPROMS.cs index d17be514..60a42df2 100644 --- a/PROMS/VEPROMS User Interface/frmVEPROMS.cs +++ b/PROMS/VEPROMS User Interface/frmVEPROMS.cs @@ -162,7 +162,7 @@ namespace VEPROMS MostRecentItem mri = _MyMRIList.Add((int)(btnItem.Tag)); //SaveMRU(); SetupMRU(); - if (mri != null) tc.OpenItem(mri.MyItem); + if (mri != null) tc.OpenItem(mri.MyItemInfo); #if (DEBUG) // display a property page contianing the Tab Cotrol information //f = new frmPropGrid(tc); @@ -195,75 +195,79 @@ namespace VEPROMS epComments.Expanded = false; rtxbComment.Text = ""; epComments.TitleStyle.BackColor1.Color = _CommentTitleBckColor; - if(_MyMRIList.Add(node.VEObject)!=null) + if (_MyMRIList.Add(node.VEObject) != null) SetupMRU(); - switch (node.VEObject.GetType().Name) + if (node.VEObject.GetType() == typeof(FolderInfo)) { - case "FolderInfo": - _LastFolderInfo = (FolderInfo)(_LastTreeNode.VEObject); - _LastFolder = _LastFolderInfo.Get(); - break; - case "DocVersionInfo": - _LastDocVersionInfo = (DocVersionInfo)(node.VEObject); - _LastDocVersion = _LastDocVersionInfo.Get(); - break; - case "ProcedureInfo": - _LastProcedureInfo = (ProcedureInfo)(_LastTreeNode.VEObject); - _LastProcedure = _LastProcedureInfo.Get(); - - tc.OpenItem((ItemInfo)_LastProcedureInfo); - if (_LastProcedureInfo.ItemAnnotationCount > 0) - { - if (!cbCmntDontPopup.Checked) - epComments.Expanded = true; - rtxbComment.Text = _LastProcedureInfo.ItemAnnotations[0].SearchText; - } - break; - case "SectionInfo": - _LastSectionInfo = (SectionInfo)(_LastTreeNode.VEObject); - _LastSection = _LastSectionInfo.Get(); - tc.OpenItem((ItemInfo)_LastSectionInfo); - if (_LastSectionInfo.ItemAnnotationCount > 0) - { - if (!cbCmntDontPopup.Checked) - epComments.Expanded = true; - rtxbComment.Text = _LastSectionInfo.ItemAnnotations[0].SearchText; - } - break; - case "StepInfo": - _LastStepInfo = (StepInfo)(_LastTreeNode.VEObject); - _LastStep = _LastStepInfo.Get(); - tc.OpenItem((ItemInfo)_LastStepInfo); - //if (_LastStepInfo.ItemAnnotationCount > 0) - //{ - // if (!cbCmntDontPopup.Checked) - // epComments.Expanded = true; - // rtxbComment.Text = _LastStepInfo.ItemAnnotations[0].SearchText; - itemAnnotationsBindingSource.DataSource = _LastStepInfo.ItemAnnotations; - // epComments.TitleStyle.BackColor1.Color = Color.Yellow; - //} - #region Sample Display Table Code - // display an exiting table in that rtf grid thing - //if ((_LastStepInfo.MyContent.Type == 20007) || (_LastStepInfo.MyContent.Type == 20009)) - //{ - // //MessageBox.Show("Source Grid"); - // //frmTable newtable1 = new frmTable(_LastStepInfo.MyContent.Text); - // //newtable1.ShowDialog(); - // //MessageBox.Show("IGrid"); - // //frmIGrid newtable2 = new frmIGrid(_LastStepInfo.MyContent.Text); - // //newtable2.ShowDialog(); - // //MessageBox.Show("GridView"); //standard Visual Studio Control - // //frmGridView newtable3 = new frmGridView(_LastStepInfo.MyContent.Text); - // //newtable3.ShowDialog(); - // MessageBox.Show("FlexCell"); - // frmFlexCell newtable4 = new frmFlexCell(_LastStepInfo.MyContent.Text); - // newtable4.ShowDialog(); - //} - #endregion - break; - default: - break; + _LastFolderInfo = (FolderInfo)(_LastTreeNode.VEObject); + _LastFolder = _LastFolderInfo.Get(); } + else if (node.VEObject.GetType() == typeof(DocVersionInfo)) + { + _LastDocVersionInfo = (DocVersionInfo)(node.VEObject); + _LastDocVersion = _LastDocVersionInfo.Get(); + } + else if (node.VEObject.GetType() == typeof(ProcedureInfo)) + { + _LastProcedureInfo = (ProcedureInfo)(_LastTreeNode.VEObject); + _LastProcedure = _LastProcedureInfo.Get(); + + tc.OpenItem((ItemInfo)_LastProcedureInfo); + if (_LastProcedureInfo.ItemAnnotationCount > 0) + { + if (!cbCmntDontPopup.Checked) + epComments.Expanded = true; + rtxbComment.Text = _LastProcedureInfo.ItemAnnotations[0].SearchText; + } + } + else if (node.VEObject.GetType() == typeof(SectionInfo)) + { + _LastSectionInfo = (SectionInfo)(_LastTreeNode.VEObject); + _LastSection = _LastSectionInfo.Get(); + tc.OpenItem((ItemInfo)_LastSectionInfo); + if (_LastSectionInfo.ItemAnnotationCount > 0) + { + if (!cbCmntDontPopup.Checked) + epComments.Expanded = true; + rtxbComment.Text = _LastSectionInfo.ItemAnnotations[0].SearchText; + } + } + else if (node.VEObject.GetType() == typeof(StepInfo)) + { + _LastStepInfo = (StepInfo)(_LastTreeNode.VEObject); + _LastStep = _LastStepInfo.Get(); + tc.OpenItem((ItemInfo)_LastStepInfo); + //if (_LastStepInfo.ItemAnnotationCount > 0) + //{ + // if (!cbCmntDontPopup.Checked) + // epComments.Expanded = true; + // rtxbComment.Text = _LastStepInfo.ItemAnnotations[0].SearchText; + itemAnnotationsBindingSource.DataSource = _LastStepInfo.ItemAnnotations; + // epComments.TitleStyle.BackColor1.Color = Color.Yellow; + //} + #region Sample Display Table Code + // display an exiting table in that rtf grid thing + //if ((_LastStepInfo.MyContent.Type == 20007) || (_LastStepInfo.MyContent.Type == 20009)) + //{ + // //MessageBox.Show("Source Grid"); + // //frmTable newtable1 = new frmTable(_LastStepInfo.MyContent.Text); + // //newtable1.ShowDialog(); + // //MessageBox.Show("IGrid"); + // //frmIGrid newtable2 = new frmIGrid(_LastStepInfo.MyContent.Text); + // //newtable2.ShowDialog(); + // //MessageBox.Show("GridView"); //standard Visual Studio Control + // //frmGridView newtable3 = new frmGridView(_LastStepInfo.MyContent.Text); + // //newtable3.ShowDialog(); + // MessageBox.Show("FlexCell"); + // frmFlexCell newtable4 = new frmFlexCell(_LastStepInfo.MyContent.Text); + // newtable4.ShowDialog(); + //} + #endregion + } + //break; + //default: + //break; + //} setupRibbonTabs(node); } } @@ -298,7 +302,7 @@ namespace VEPROMS bool IsFolder(VETreeNode veTreeNode) { - return (veTreeNode.VEObject.GetType().Name == "FolderInfo"); + return (veTreeNode.VEObject.GetType() == typeof(FolderInfo)); } void tv_NodeDragDrop(object sender, Volian.Controls.Library.vlnTreeEventArgs args) @@ -385,15 +389,12 @@ namespace VEPROMS VETreeNode tn = (VETreeNode)e.Node; while (tn != null) { - switch (tn.VEObject.GetType().Name) + if (tn.VEObject.GetType() == typeof(FolderInfo) || tn.VEObject.GetType() == typeof(DocVersionInfo)) { - case "FolderInfo": - case "DocVersionInfo": - if (caption.Equals("")) - caption = tn.Text; - else - caption = tn.Text + " - " + caption; - break; + if (caption.Equals("")) + caption = tn.Text; + else + caption = tn.Text + " - " + caption; } tn = (VETreeNode)tn.Parent; } @@ -478,7 +479,7 @@ namespace VEPROMS // // user didn't select a FolderInfo type of node. // // walk up the tree to find the first FolderInfo node type // VETreeNode tn = (VETreeNode)(tv.SelectedNode); - // while (tn != null && tn.VEObject.GetType().Name != "FolderInfo") + // while (tn != null && tn.VEObject.GetType() != typeof(FolderInfo)) // tn = (VETreeNode)tn.Parent; // _LastFolderInfo = (FolderInfo)(tn.VEObject); // _LastFolder = _LastFolderInfo.Get(); @@ -504,28 +505,29 @@ namespace VEPROMS { // Display a property page. (the ppStyle selects either a tabbed or button interface) VETreeNode tn = (VETreeNode)(tv.SelectedNode); - switch (tn.VEObject.GetType().Name) + if (tn.VEObject.GetType() == typeof(FolderInfo)) { - case "FolderInfo": - frmFolderProperties frmfld = new frmFolderProperties(_LastFolder.FolderConfig); - if (frmfld.ShowDialog() == DialogResult.OK) - _LastFolder.Save(); - break; - case "DocVersionInfo": - frmVersionsProperties frmver = new frmVersionsProperties(_LastDocVersion.DocVersionConfig); - if (frmver.ShowDialog() == DialogResult.OK) - _LastDocVersion.Save(); - break; - case "ProcedureInfo": - frmProcedureProperties frmproc = new frmProcedureProperties(_LastProcedure.ProcedureConfig); - if (frmproc.ShowDialog() == DialogResult.OK) - _LastProcedure.Save(); - break; - case "SectionInfo": - frmSectionProperties frmsec = new frmSectionProperties(_LastSection.SectionConfig); - if (frmsec.ShowDialog() == DialogResult.OK) - _LastSection.Save(); - break; + frmFolderProperties frmfld = new frmFolderProperties(_LastFolder.FolderConfig); + if (frmfld.ShowDialog() == DialogResult.OK) + _LastFolder.Save(); + } + else if (tn.VEObject.GetType() == typeof(DocVersionInfo)) + { + frmVersionsProperties frmver = new frmVersionsProperties(_LastDocVersion.DocVersionConfig); + if (frmver.ShowDialog() == DialogResult.OK) + _LastDocVersion.Save(); + } + else if (tn.VEObject.GetType() == typeof(ProcedureInfo)) + { + frmProcedureProperties frmproc = new frmProcedureProperties(_LastProcedure.ProcedureConfig); + if (frmproc.ShowDialog() == DialogResult.OK) + _LastProcedure.Save(); + } + else if (tn.VEObject.GetType() == typeof(SectionInfo)) + { + frmSectionProperties frmsec = new frmSectionProperties(_LastSection.SectionConfig); + if (frmsec.ShowDialog() == DialogResult.OK) + _LastSection.Save(); } } @@ -538,35 +540,36 @@ namespace VEPROMS VETreeNode tn = (VETreeNode)(tv.SelectedNode); frmPropGrid propGrid = null; string title = ""; - switch (tn.VEObject.GetType().Name) + if (tn.VEObject.GetType() == typeof(FolderInfo)) { - case "FolderInfo": - title = string.Format("{0} Properties", _LastFolder.FolderConfig.Name); - propGrid = new frmPropGrid(_LastFolder.FolderConfig, title); - if ( propGrid.ShowDialog() == DialogResult.OK) + title = string.Format("{0} Properties", _LastFolder.FolderConfig.Name); + propGrid = new frmPropGrid(_LastFolder.FolderConfig, title); + if (propGrid.ShowDialog() == DialogResult.OK) _LastFolder.Save(); - break; - case "DocVersionInfo": - title = string.Format("{0} Properties", _LastDocVersion.DocVersionConfig.Name); - propGrid = new frmPropGrid(_LastDocVersion.DocVersionConfig, title); - if ( propGrid.ShowDialog() == DialogResult.OK) + } + else if (tn.VEObject.GetType() == typeof(DocVersionInfo)) + { + title = string.Format("{0} Properties", _LastDocVersion.DocVersionConfig.Name); + propGrid = new frmPropGrid(_LastDocVersion.DocVersionConfig, title); + if (propGrid.ShowDialog() == DialogResult.OK) _LastDocVersion.Save(); - break; - case "ProcedureInfo": - title = string.Format("{0} {1} Properties", _LastProcedure.ProcedureConfig.Number, _LastProcedure.ProcedureConfig.Title); - propGrid = new frmPropGrid(_LastProcedure.ProcedureConfig, title); - if ( propGrid.ShowDialog() == DialogResult.OK) + } + else if (tn.VEObject.GetType() == typeof(ProcedureInfo)) + { + title = string.Format("{0} {1} Properties", _LastProcedure.ProcedureConfig.Number, _LastProcedure.ProcedureConfig.Title); + propGrid = new frmPropGrid(_LastProcedure.ProcedureConfig, title); + if (propGrid.ShowDialog() == DialogResult.OK) _LastProcedure.Save(); - break; - case "SectionInfo": - if (_LastSection.SectionConfig.Number.Length > 0) - title = string.Format("{0} {1} Properties", _LastSection.SectionConfig.Number, _LastSection.SectionConfig.Title); - else - title = string.Format("{0} Properties", _LastSection.SectionConfig.Title); - propGrid = new frmPropGrid(_LastSection.SectionConfig, title); - if ( propGrid.ShowDialog() == DialogResult.OK) + } + else if (tn.VEObject.GetType() == typeof(SectionInfo)) + { + if (_LastSection.SectionConfig.Number.Length > 0) + title = string.Format("{0} {1} Properties", _LastSection.SectionConfig.Number, _LastSection.SectionConfig.Title); + else + title = string.Format("{0} Properties", _LastSection.SectionConfig.Title); + propGrid = new frmPropGrid(_LastSection.SectionConfig, title); + if (propGrid.ShowDialog() == DialogResult.OK) _LastSection.Save(); - break; } } @@ -859,8 +862,8 @@ namespace VEPROMS /// private void btnSetBookMrk_Click(object sender, EventArgs e) { - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; - _MyBookMarks.Add(dtp.SelectedItem.MyItem); + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; + _MyBookMarks.Add(dtp.SelectedStepItem.MyItemInfo); RefreshBookMarkData(); //VETreeNode tn = (VETreeNode)(tv.SelectedNode); //AddToBookMarkList(tn); @@ -890,16 +893,16 @@ namespace VEPROMS // vlnCSLAPanel1.ItemSelect(item); //} - private void vlnCSLAPanel1_LinkClicked(object sender, Volian.Controls.Library.DisplayLinkEventArgs args) + private void vlnCSLAPanel1_LinkClicked(object sender, StepPanelLinkEventArgs args) { - switch (args.Type) + switch (args.MyParsedLinkType) { case ParsedLinkType.ReferencedObject: - MessageBox.Show(args.Roid, args.Type.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(args.Roid, args.MyParsedLinkType.ToString(), MessageBoxButtons.OK, MessageBoxIcon.Information); break; case ParsedLinkType.Transition: case ParsedLinkType.TransitionRange: - tc.OpenItem(args.MyTransition.MyItemToID); + tc.OpenItem(args.MyTransitionInfo.MyItemToID); break; } } @@ -1061,7 +1064,7 @@ namespace VEPROMS /// private void setupRibbonTabs(VETreeNode node) { - //switch (node.VEObject.GetType().Name) + //switch (node.VEObject.GetType().Name) // Change to else if & typeof //{ // case "FolderInfo": // rtabEdit.Visible = false; @@ -1131,43 +1134,43 @@ namespace VEPROMS { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabRO; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; ROFST rofst = new ROFST("g:\\vehlp\\ro\\ro.fst"); displayRO.MyROFST = rofst; - displayRO.MyRTB = dtp.MyPanel.DisplayItemSelected.MyDisplayRTB; + displayRO.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB; } #endregion #region InfoTabTransition private void infotabTransition_Click(object sender, EventArgs e) { - if (tc == null || tc.SelectedTab == null) return; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + if (tc == null || tc.SelectedDisplayTabItem == null) return; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; - displayTransition.MyRTB = dtp.MyPanel.DisplayItemSelected.MyDisplayRTB; + displayTransition.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB; displayTransition.CurTrans = null; } private void btnInsTrans_Click(object sender, EventArgs e) { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabTransition; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; displayTransition.MyRTB = _MyRTB; displayTransition.CurTrans = null; } #endregion - private void tc_ItemSelectedChanged(object sender, DisplayPanelEventArgs args) + private void tc_ItemSelectedChanged(object sender, StepPanelEventArgs args) { if (args == null) itemAnnotationsBindingSource.DataSource = null; else { - itemAnnotationsBindingSource.DataSource = args.MyDisplayItem.MyItem.ItemAnnotations; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + itemAnnotationsBindingSource.DataSource = args.MyStepItem.MyItemInfo.ItemAnnotations; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; - displayTransition.MyRTB = dtp.MyPanel.DisplayRTB; - displayRO.MyRTB = dtp.MyPanel.DisplayItemSelected.MyDisplayRTB; + displayTransition.MyRTB = dtp.MyStepPanel.SelectedStepRTB; + displayRO.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB; } } private void itemAnnotationsBindingSource_DataSourceChanged(object sender, EventArgs e) @@ -1190,7 +1193,7 @@ namespace VEPROMS { _MyRTB.SaveText(); } - private void tc_LinkActiveChanged(object sender, DisplayLinkEventArgs args) + private void tc_LinkActiveChanged(object sender, StepPanelLinkEventArgs args) { // determine if any infotabs are visisble, and if it is the Transition, // change the curitem for the transition to the current item. @@ -1199,39 +1202,39 @@ namespace VEPROMS displayTransition.CurTrans = null; } } - private void tc_LinkInsertTran(object sender, DisplayLinkEventArgs args) + private void tc_LinkInsertTran(object sender, StepPanelLinkEventArgs args) { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabTransition; displayTransition.CurTrans = null; } - private void tc_LinkInsertRO(object sender, DisplayLinkEventArgs args) + private void tc_LinkInsertRO(object sender, StepPanelLinkEventArgs args) { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabRO; ROFST rofst = new ROFST("g:\\vehlp\\ro\\ro.fst"); displayRO.MyROFST = rofst; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; - displayRO.MyRTB = dtp.MyPanel.DisplayItemSelected.MyDisplayRTB; + displayRO.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB; displayRO.CurROLink = null; } - private void tc_LinkModifyTran(object sender, DisplayLinkEventArgs args) + private void tc_LinkModifyTran(object sender, StepPanelLinkEventArgs args) { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabTransition; - displayTransition.CurTrans = args.MyTransition; + displayTransition.CurTrans = args.MyTransitionInfo; } - private void tc_LinkModifyRO(object sender, DisplayLinkEventArgs args) + private void tc_LinkModifyRO(object sender, StepPanelLinkEventArgs args) { infoPanel.Expanded = true; infoTabs.SelectedTab = infotabRO; ROFST rofst = new ROFST("g:\\vehlp\\ro\\ro.fst"); displayRO.MyROFST = rofst; - StepTabPanel dtp = ((DisplayTabItem)tc.SelectedTab).MyTabPanel; + StepTabPanel dtp = ((DisplayTabItem)tc.SelectedDisplayTabItem).MyStepTabPanel; if (dtp == null) return; - displayRO.MyRTB = dtp.MyPanel.DisplayItemSelected.MyDisplayRTB; + displayRO.MyRTB = dtp.MyStepPanel.SelectedStepItem.MyStepRTB; displayRO.CurROLink = args.RoUsageid; // this is wrong - use for now. } @@ -1272,7 +1275,7 @@ namespace VEPROMS private void lbxBookMarks_Click(object sender, EventArgs e) { MostRecentItem itm = lbxBookMarks.SelectedValue as MostRecentItem; - tc.OpenItem(itm.MyItem); + tc.OpenItem(itm.MyItemInfo); } } }