This commit is contained in:
2008-10-03 11:32:56 +00:00
parent 9ee8986e50
commit 722e41b25e
9 changed files with 1312 additions and 1376 deletions

View File

@@ -265,211 +265,30 @@ namespace VEPROMS
}
else if (args.SectionConfig != null)
{
//// If this is a word document, close any edit sessions...
//ItemInfo ii = null;
//using (Section tmp = args.SectionConfig.MySection)
//{
// ii = ItemInfo.Get(tmp.ItemID);
// if (!ii.IsStepSection) tc.CloseWordItem(ii);
//}
frmSectionProperties frmsec = new frmSectionProperties(args.SectionConfig);
dr = frmsec.ShowDialog();
if (dr == DialogResult.OK && displayLibDocs.LibDocList != null)
{
displayLibDocs.LibDocListFillIn(tc);
}
}
}
this.Cursor = Cursors.Default;
return dr;
}
void tv_NodeFolderProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
{
FolderInfo fi = ((VETreeNode)args.Node).VEObject as FolderInfo;
DialogResult dr = DialogResult.Cancel;
if (dr == DialogResult.OK) fi.Get().Save();
}
void tv_NodeDocVersionProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
{
this.Cursor = Cursors.WaitCursor;
DocVersionInfo dvi = ((VETreeNode)args.Node).VEObject as DocVersionInfo;
if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid)
{
frmPropGrid propGrid = new frmPropGrid(dvi.DocVersionConfig, string.Format("{0} Properties", dvi.DocVersionConfig.Name));
if (propGrid.ShowDialog() == DialogResult.OK)
dvi.Get().Save();
}
else
{
frmVersionsProperties frmver = new frmVersionsProperties(dvi.DocVersionConfig);
if (frmver.ShowDialog() == DialogResult.OK)
dvi.Get().Save();
}
this.Cursor = Cursors.Default;
}
void tv_NodeProcProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
{
this.Cursor = Cursors.WaitCursor;
ProcedureInfo pi = ((VETreeNode)args.Node).VEObject as ProcedureInfo;
if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid)
{
frmPropGrid propGrid = new frmPropGrid(pi.ProcedureConfig, string.Format("{0} {1} Properties", pi.ProcedureConfig.Number, pi.ProcedureConfig.Title));
if (propGrid.ShowDialog() == DialogResult.OK)
pi.Get().Save();
}
else
{
frmProcedureProperties frmproc = new frmProcedureProperties(pi.ProcedureConfig);
if (frmproc.ShowDialog() == DialogResult.OK)
pi.Get().Save();
}
this.Cursor = Cursors.Default;
}
void tv_NodeSectProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
{
this.Cursor = Cursors.WaitCursor;
SectionInfo si = ((VETreeNode)args.Node).VEObject as SectionInfo;
if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid)
{
string title = null;
if (si.SectionConfig.Number.Length > 0)
title = string.Format("{0} {1} Properties", si.SectionConfig.Number, si.SectionConfig.Title);
else
title = string.Format("{0} Properties", si.SectionConfig.Title);
frmPropGrid propGrid = new frmPropGrid(si.SectionConfig, title);
if (propGrid.ShowDialog() == DialogResult.OK)
si.Get().Save();
}
else
{
frmSectionProperties frmsec = new frmSectionProperties(si.SectionConfig);
if (frmsec.ShowDialog() == DialogResult.OK)
si.Get().Save();
}
this.Cursor = Cursors.Default;
}
private void btnProperties_Click(object sender, EventArgs e)
{
if (tv.SelectedNode == null) MessageBox.Show("Must select a node on the Tree to get properties");
//Determine type of selected tree view node & handle based on that.
VETreeNode tn = (VETreeNode)(tv.SelectedNode);
if ((tn.VEObject as FolderInfo) != null)
tv_NodeFolderProperties(null, new vlnTreeEventArgs(tv.SelectedNode));
else if ((tn.VEObject as DocVersionInfo) != null)
tv_NodeDocVersionProperties(null, new vlnTreeEventArgs(tv.SelectedNode));
else if ((tn.VEObject as ProcedureInfo) != null)
tv_NodeProcProperties(null, new vlnTreeEventArgs(tv.SelectedNode));
else if ((tn.VEObject as SectionInfo) != null)
tv_NodeSectProperties(null, new vlnTreeEventArgs(tv.SelectedNode));
else
MessageBox.Show("Properties not available for this Tree selection");
}
/// <summary>
// this is used by tv_NodeProperties() and by ribbonFilePropertes_Click()
// the type of the args parameter for these two functions is different and
// type casting didn't work, so I put the guts in this function.
/// </summary>
// TODO: DeleteMe
//void tv_NodeProperties(object sender, Volian.Controls.Library.vlnTreeEventArgs args)
//{
// DisplayProperties();
//}
//private void DisplayProperties()
//{
// // check the user's preference on the style of poperty dialogs "PropPageStyle"
// // 1 - Button dialog interface
// // 2 - Tab dialog interface
// // 3 - Property Grid interface
// //SetLastValues((VETreeNode)(tv.SelectedNode));
// this.Cursor = Cursors.WaitCursor;
// if ((int)Settings.Default["PropPageStyle"] == (int)PropPgStyle.Grid)
// DoPropertyGrid(); // Will display a Property Grid interface
// else
// DoPropertyPages(); // Will display either a Button or a Tab dialog
// this.Cursor = Cursors.Default;
//}
/// <summary>
/// Display a Property Page for the current tree node
/// </summary>
//private void DoPropertyPages()
//{
// // Display a property page. (the ppStyle selects either a tabbed or button interface)
// VETreeNode tn = (VETreeNode)(tv.SelectedNode);
// if ((tn.VEObject as FolderInfo) != null)
// {
// FolderInfo fi = tn.VEObject as FolderInfo;
// frmFolderProperties frmfld = new frmFolderProperties(fi.FolderConfig);
// if (frmfld.ShowDialog() == DialogResult.OK)
// fi.Get().Save();
// }
// else if ((tn.VEObject as DocVersionInfo) != null)
// {
// DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
// frmVersionsProperties frmver = new frmVersionsProperties(dvi.DocVersionConfig);
// if (frmver.ShowDialog() == DialogResult.OK)
// dvi.Get().Save();
// }
// else if ((tn.VEObject as ProcedureInfo) != null)
// {
// ProcedureInfo pi = tn.VEObject as ProcedureInfo;
// frmProcedureProperties frmproc = new frmProcedureProperties(pi.ProcedureConfig);
// if (frmproc.ShowDialog() == DialogResult.OK)
// pi.Get().Save();
// }
// else if ((tn.VEObject as SectionInfo) != null)
// {
// SectionInfo si = tn.VEObject as SectionInfo;
// frmSectionProperties frmsec = new frmSectionProperties(si.SectionConfig);
// if (frmsec.ShowDialog() == DialogResult.OK)
// si.Get().Save();
// }
//}
/// <summary>
/// Display a property grid for the current tree node
/// </summary>
//private void DoPropertyGrid()
//{
// // Display a property grid
// VETreeNode tn = (VETreeNode)(tv.SelectedNode);
// frmPropGrid propGrid = null;
// string title = "";
// if ((tn.VEObject as FolderInfo) != null)
// {
// FolderInfo fi = tn.VEObject as FolderInfo;
// title = string.Format("{0} Properties", fi.FolderConfig.Name);
// propGrid = new frmPropGrid(fi.FolderConfig, title);
// if (propGrid.ShowDialog() == DialogResult.OK)
// fi.Get().Save();
// }
// else if ((tn.VEObject as DocVersionInfo) != null)
// {
// DocVersionInfo dvi = tn.VEObject as DocVersionInfo;
// title = string.Format("{0} Properties", dvi.DocVersionConfig.Name);
// propGrid = new frmPropGrid(dvi.DocVersionConfig, title);
// if (propGrid.ShowDialog() == DialogResult.OK)
// dvi.Get().Save();
// }
// else if ((tn.VEObject as ProcedureInfo) != null)
// {
// ProcedureInfo pi = tn.VEObject as ProcedureInfo;
// title = string.Format("{0} {1} Properties", pi.ProcedureConfig.Number, pi.ProcedureConfig.Title);
// propGrid = new frmPropGrid(pi.ProcedureConfig, title);
// if (propGrid.ShowDialog() == DialogResult.OK)
// pi.Get().Save();
// }
// else if ((tn.VEObject as SectionInfo) != null)
// {
// SectionInfo si = tn.VEObject as SectionInfo;
// if (si.SectionConfig.Number.Length > 0)
// title = string.Format("{0} {1} Properties", si.SectionConfig.Number, si.SectionConfig.Title);
// else
// title = string.Format("{0} Properties", si.SectionConfig.Title);
// propGrid = new frmPropGrid(si.SectionConfig, title);
// if (propGrid.ShowDialog() == DialogResult.OK)
// si.Get().Save();
// }
//}
/// <summary>
/// Button from the Ribbon Bar
/// </summary>
/// <param name="sender">object</param>
/// <param name="e">EventArgs</param>
}
#endregion
#endregion
#region ColorStuff
/// <summary>
#endregion
#region ColorStuff
/// <summary>
/// Get a System.Drawing.Color from an Argb or color name
/// </summary>
/// <param name="strColor">Color Name or "[(alpha,)red,green,blue]"</param>
@@ -1014,7 +833,6 @@ namespace VEPROMS
}
#endregion
private ItemInfo _CurrentItem = null;
private void tc_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
if (args == null)
@@ -1311,5 +1129,15 @@ namespace VEPROMS
tv.tv_NodeNew(vlnTreeView.MenuSelections.Folder);
}
#endregion
private void tabItemLibDocs_Click(object sender, EventArgs e)
{
displayLibDocs.LibDocListFillIn(tc);
}
private void tv_SectionShouldClose(object sender, vlnTreeSectionInfoEventArgs args)
{
if (!args.MySectionInfo.IsStepSection) tc.CloseWordItem(args.MySectionInfo);
}
}
}