Enhanced Documents – various improvements

Enhanced Documents – existing docversion properties UI
This commit is contained in:
Kathy Ruffing 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);
@ -922,6 +966,8 @@ namespace VEPROMS
return tc.PasteRTBItem(args.MyItemInfo, args.CopyStartID, args.PasteType, (int)args.Type);
}
private void frmVEPROMS_FormClosing(object sender, FormClosingEventArgs e)
{
if (MyParent == null)
{
if (MyActivityTimer != null) MyActivityTimer.Dispose();
if (MySessionInfo != null) MySessionInfo.EndSession();
@ -940,6 +986,7 @@ namespace VEPROMS
Volian.Base.Library.DebugPagination.Close();
Volian.Base.Library.DebugText.Close();
}
}
void frmVEPROMS_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e)
{
// Close any open documents
@ -947,6 +994,8 @@ 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.
if (MyParent == null)
{
try
{
System.Diagnostics.Process.GetCurrentProcess().Kill();
@ -956,6 +1005,7 @@ namespace VEPROMS
_MyLog.Warn("Attempting to Close", ex);
}
}
}
// Get the "Procedures" Panel Heading (title).
// by default the heading is "Procedures" (handled in the getting from the config)
// the heading is stored in the "title" field of the folder config.
@ -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,14 +1263,14 @@ namespace VEPROMS
tmrCloseTabItems.Enabled = true;
CloseSessionsNoLongerActive();
MySessionInfo = SessionInfo.BeginSession(Environment.MachineName, System.Diagnostics.Process.GetCurrentProcess().Id);
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();
}
this.LastContentChange = MySessionInfo.LastContentChange;
_MyLog.WarnFormat("Original last content change {0}", this.LastContentChange);
RefreshLastChange();
tc.MySessionInfo = MySessionInfo;
tv.MySessionInfo = MySessionInfo;
System.Threading.AutoResetEvent autoEvent = new System.Threading.AutoResetEvent(false);
@ -1253,12 +1312,15 @@ 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 (MyParent == null)
{
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);
tc.SyncEnhancedDocuments = Properties.Settings.Default.SyncEnhancedDocuments;
@ -1280,6 +1342,7 @@ namespace VEPROMS
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);
@ -1309,11 +1372,33 @@ namespace VEPROMS
// dlgCI.ShowDialog(this);
//}
// 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;
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 child_FormClosed(object sender, FormClosedEventArgs e)
{
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.MyItemInfo.MyProcedure.MyDocVersion.VersionID, rc.ConvertToString(frm.DesktopBounds));
string str = string.Format("{0}~{1}", frm.MyDocVersion.VersionID, rc.ConvertToString(frm.DesktopBounds));
MyVersionWindowList.Add(new VersionWindow(str));
}
void frm_FormClosed(object sender, FormClosedEventArgs e)
{
tc.dicEnhancedDocuments.Remove((sender as frmEnhanced).MyItemInfo.MyProcedure.MyDocVersion);
}
private bool HasSetAdministrator(UserInfo ui)
{
DocVersionInfoList dvil = DocVersionInfoList.Get();
@ -1646,6 +1777,8 @@ namespace VEPROMS
Membership.MakeMembership(u, g, null, "");
}
}
if (MyParent == null)
{
if (VlnSettings.GetCommandFlag("VeauLeeAnn" + GetSecurityKey()) || VlnSettings.GetCommandFlag("VeauLeeAnnXYZZY"))
{
//pop up user list to select from
@ -1657,6 +1790,7 @@ namespace VEPROMS
}
VlnSettings.UserID = proxyUser;
}
}
lblUser.Text = VlnSettings.UserID;
lblUser.MouseDown += new MouseEventHandler(lblUser_MouseDown);
}
@ -2152,12 +2286,23 @@ namespace VEPROMS
//_MyLog.DebugFormat("tv_BeforeExpand \n{0}",Volian.Base.Library.vlnStackTrace.StackToStringLocal(2,10));
_ExpandingTree = true;
VETreeNode tn = ((VETreeNode)e.Node);
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);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,7 @@ namespace VEPROMS
{
private List<MiniConfig> _Apples;
private List<MiniConfig> _DeletedApples;
private List<EnhancedMiniConfig> _Enhanced;
private bool _Initializing = false;
private DocVersionConfig _DocVersionConfig;
@ -138,6 +139,27 @@ namespace VEPROMS
}
}
}
if (_Enhanced != null)
{
foreach (EnhancedMiniConfig emc in _Enhanced)
{
if (emc.IsDirty)
{
foreach (DVEnhancedDocument dved in _DocVersionConfig.MyEnhancedDocuments)
{
if (dved.Type == Convert.ToInt32(emc.Type))
{
// pdfxoffset must be int? how to check
dved.Name = emc.Name;
dved.PdfToken = emc.PdfToken;
dved.PdfX = Convert.ToInt32(emc.PdfXOffset);
}
}
}
}
_DocVersionConfig.SaveDVEnhancedDocuments();
}
_DocVersionConfig.Print_UnitNumberForPageList = ppTxbxUnitNum.Text;
docVersionConfigBindingSource.EndEdit();
@ -367,11 +389,150 @@ namespace VEPROMS
ppTxtBxPDFLoc.TextChanged += new EventHandler(ppTxtBxPDFLoc_TextChanged);
//end add new applicability stuff
lblProcSetRev.Visible = ppRTxtProcSetRev.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.MyStepSectionPrintData.UseXtraRevNumber;
_Initializing = false;
// the phone list button is only visible if the format has the print/phonelist format flag.
btnPhoneList.Visible = _DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.SectData.PrintPhoneList;
InitEnhanced();
_Initializing = false;
}
private void InitEnhanced()
{
// first determine if enhanced tab should be turned off: KBR HOW?
// get enhanced tab's data if:
// 1) hasEnhancedPO: this is source and format file has the purchase options for enhanced deviation or enhanced background
// 2) isEnhanced: this docversion has a config/enhanced node that defines it as an enhanced document.
bool hasEnhancedPO = true; // for now all can be enhanced
bool isEnhanced = (_DocVersionConfig.MyEnhancedDocuments != null && _DocVersionConfig.MyEnhancedDocuments.Count == 1 && _DocVersionConfig.MyEnhancedDocuments[0].Type == 0);
// isEnhanced is an already existing enhanced document. Only allow the user to change the Pdf settings:
if (isEnhanced)
{
_Enhanced = new List<EnhancedMiniConfig>();
// only display the data from the config setting. And only allow modify of PdfID and PdfXoffset
lbEnhanced.Visible = false;
lblEnhSet.Visible = false;
DocVersionInfo dvi = DocVersionInfo.Get(_DocVersionConfig.MyEnhancedDocuments[0].VersionID);
DVEnhancedDocument dvedUseData = _DocVersionConfig.MyEnhancedDocuments[0];
DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig;
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dvedUseData.Name, dvedUseData.Type.ToString(), dvedUseData.PdfToken, dvedUseData.PdfX.ToString());
cbxEnhVersions.Items.Add(dvi.SearchDVPath);
tbEnhName.Enabled = false;
tbEnhType.Enabled = false;
_Enhanced.Add(ecfg);
bsMiniEnhanced.DataSource = _Enhanced;
cbxEnhVersions.SelectedIndex = 0;
cbxEnhVersions.Enabled = false;
}
// This is a source document that already has settings KBR ? - Can additions can be made
else if (hasEnhancedPO)
{
// first set up existing enhanced linked documents (this is a listbox on left of form)
_Enhanced = new List<EnhancedMiniConfig>();
lbEnhanced.Visible = true;
lblEnhSet.Visible = true;
foreach (DVEnhancedDocument dved in _DocVersionConfig.MyEnhancedDocuments)
{
DocVersionInfo dvi = DocVersionInfo.Get(dved.VersionID);
DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig;
EnhancedMiniConfig ecfg = new EnhancedMiniConfig(0, dvi.VersionID, "?", dvi.SearchDVPath, dved.Name, dved.Type.ToString(), dved.PdfToken, dved.PdfX.ToString());
cbxEnhVersions.Items.Add(dvi.SearchDVPath);
_Enhanced.Add(ecfg);
}
tbEnhName.Enabled = true;
tbEnhType.Enabled = false;
cbxEnhVersions.Enabled = false;
bsEnhanced.DataSource = _Enhanced;
if (cbxEnhVersions.Items.Count>0) cbxEnhVersions.SelectedIndex = 0;
if (lbEnhanced.Items.Count > 0) lbEnhanced.SelectedIndex = 0;
bsMiniEnhanced.DataSource = bsEnhanced.Current as EnhancedMiniConfig;
}
}
//private void InitEnhancedOld()
//{
// // get enhanced tab's data if:
// // 1) hasEnhancedPO: this is source and format file has the purchase options for enhanced deviation or enhanced background
// // 2) isEnhanced: this docversion has a config/enhanced node that defines it as an enhanced document.
// bool hasEnhancedPO = true;
// //if (((_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedDeviations) == E_PurchaseOptions.EnhancedDeviations)
// // || ((_DocVersionConfig.MyDocVersion.MyDocVersionInfo.ActiveFormat.PlantFormat.FormatData.PurchaseOptions.Value & E_PurchaseOptions.EnhancedBackgrounds) == E_PurchaseOptions.EnhancedBackgrounds)) hasEnhancedPO = true;
// bool isEnhanced = (_DocVersionConfig.MyEnhancedDocuments != null && _DocVersionConfig.MyEnhancedDocuments.Count == 1 && _DocVersionConfig.MyEnhancedDocuments[0].Type == 0);
// if (hasEnhancedPO || isEnhanced)
// {
// // need to filter the list and add only those that are set for the current doc version whose properties
// // we are working with, or that have no setting. (If the docversion has a source that is not this one, don't list)
// DocVersionInfoList dvil = DocVersionInfoList.Get();
// _Enhanced = new List<EnhancedMiniConfig>();
// DVEnhancedDocument dvedUseData = null;
// int indxDataSource = 0;
// for (int ie = 0; ie < dvil.Count; ie++)
// {
// DocVersionInfo dvi = dvil[ie];
// // get config items for filling in the data:
// DocVersionConfig dvc = dvi.MyConfig as DocVersionConfig;
// // need to see if it should be include
// bool includeit = false;
// if (isEnhanced && dvi.VersionID == _DocVersionConfig.MyDocVersion.VersionID)
// {
// dvedUseData = dvc.MyEnhancedDocuments[0];
// includeit = true;
// }
// if (hasEnhancedPO && !isEnhanced)
// {
// // if this docversion has no relationships, include it:
// if (dvc.MyEnhancedDocuments == null || dvc.MyEnhancedDocuments.Count == 0)
// includeit = true;
// else
// {
// //DVEnhancedDocuments dveds = _DocVersionConfig.MyEnhancedDocuments;
// //foreach (EnhancedDocument ed in sc.MyEnhancedDocuments)
// //{
// // DVEnhancedDocument dved = dveds[ed.Type];
// // AddLinkToEnhancedDocument(cb, yLocation, ed.ItemID, dved.PdfToken, dved.PdfX);
// //}
// foreach (DVEnhancedDocument ed in dvc.MyEnhancedDocuments) // config for enhanced
// {
// if (ed.VersionID == _DocVersionConfig.MyDocVersion.VersionID)
// {
// // the displayed data is the enhanced config item pointing to this one:
// foreach (DVEnhancedDocument sed in _DocVersionConfig.MyEnhancedDocuments)
// {
// if (sed.VersionID == dvi.VersionID)
// {
// dvedUseData = sed;
// break;
// }
// }
// if (dvedUseData != null)
// {
// includeit = true;
// break;
// }
// }
// }
// }
// }
// if (includeit)
// {
// // get config items for filling in the data:
// EnhancedMiniConfig ecfg = null;
// if (dvedUseData != null)
// ecfg = new EnhancedMiniConfig(indxDataSource, dvi.VersionID, "?", dvi.SearchDVPath, dvedUseData.Name, dvedUseData.Type.ToString(), dvedUseData.PdfToken, dvedUseData.PdfX.ToString());
// else
// ecfg = new EnhancedMiniConfig(indxDataSource, dvi.VersionID, "?", dvi.SearchDVPath, "", "", "", "");
// indxDataSource++;
// _Enhanced.Add(ecfg);
// dvedUseData = null;
// includeit = false;
// if (isEnhanced) break;
// }
// }
// bsEnhanced.DataSource = _Enhanced;
// }
//}
void btnPC_Click(object sender, EventArgs e)
{
@ -1153,8 +1314,115 @@ namespace VEPROMS
dlgPhoneList dlgPL = new dlgPhoneList(_DocVersionConfig);
dlgPL.ShowDialog();
}
private void btnEnhanced_Click(object sender, EventArgs e)
{
ProcessButtonClick(tiEnhanced, btnEnhanced);
}
private void lbEnhanced_SelectedIndexChanged(object sender, EventArgs e)
{
if (!_Initializing && lbEnhanced.SelectedIndex > -1)
{
bsMiniEnhanced.DataSource = bsEnhanced.Current as EnhancedMiniConfig;
cbxEnhVersions.SelectedIndex = lbEnhanced.SelectedIndex;
}
}
}
[XmlRoot("Enhanced")]
public class EnhancedMiniConfig
{
private static int lastindex = 0;
private bool _isDeleted;
[XmlIgnore]
public bool IsDeleted
{
get { return _isDeleted; }
set { _isDeleted = value; }
}
private bool _isDirty;
[XmlIgnore]
public bool IsDirty
{
get { return _isDirty; }
set { _isDirty = value; }
}
private int _index;
[XmlAttribute("index")]
public int Index
{
get { return _index; }
set { _index = value; IsDirty = true; }
}
private int _versionID;
[XmlAttribute("VersionID")]
public int VersionID
{
get { return _versionID; }
set { _versionID = value; IsDirty = true; }
}
private string _versionPathName;
[XmlAttribute("VersionPathName")]
public string VersionPathName
{
get { return _versionPathName; }
set { _versionPathName = value; IsDirty = true; }
}
private string _name;
[XmlAttribute("Name")]
public string Name
{
get { return _name; }
set { _name = value; IsDirty = true; }
}
private string _type;
[XmlAttribute("Type")]
public string Type
{
get { return _type; }
set { _type = value; IsDirty = true; }
}
private string _pdfToken;
[XmlAttribute("PdfToken")]
public string PdfToken
{
get { return _pdfToken; }
set { _pdfToken = value; IsDirty = true; }
}
private string _pdfXOffset;
[XmlAttribute("PdfXOffset")]
public string PdfXOffset
{
get { return _pdfXOffset; }
set { _pdfXOffset = value; IsDirty = true; }
}
public EnhancedMiniConfig()
{
_index = --lastindex;
_versionID = -1;
_versionPathName = string.Empty;
_name = string.Empty;
_type = string.Empty;
_pdfToken = string.Empty;
_pdfXOffset = string.Empty;
_isDirty = false;
}
public EnhancedMiniConfig(int index, int versionid, string id, string versionPathName, string name, string type, string pdftoken, string pdfxoffset)
{
_index = index;
_versionID = versionid;
_versionPathName = versionPathName;
_name = name;
_type = type;
_pdfToken = pdftoken;
_pdfXOffset = pdfxoffset;
_isDirty = false;
}
public override string ToString()
{
return Name;
}
}
[XmlRoot("Slave")]
public class MiniConfig
{

View File

@ -154,7 +154,7 @@ Check "Show Default Settings" to display the "default" Change Bar Custom Message
Check "Show Default Settings" to display the "default" Change Bar Custom Message (below the Line One selection box).</value>
</data>
<metadata name="imageCodecInfoBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
<value>789, 65</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="ppBtnPDFLoc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -188,7 +188,16 @@ Check "Show Default Settings" to display the "default" duplexing setting (below
- Type in your own text to be placed next to the change bars.</value>
</data>
<metadata name="dlgROFolder.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 56</value>
<value>17, 113</value>
</metadata>
<metadata name="bsMiniEnhanced.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 65</value>
</metadata>
<metadata name="bsEnhanced.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>817, 17</value>
</metadata>
<metadata name="documentInfoListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>181, 113</value>
</metadata>
<data name="btnRoDbProperties.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
@ -206,9 +215,6 @@ Check "Show Default Settings" to display the "default" duplexing setting (below
gg==
</value>
</data>
<metadata name="documentInfoListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>357, 56</value>
</metadata>
<metadata name="bsMiniApple.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>118, 17</value>
</metadata>
@ -219,12 +225,12 @@ Check "Show Default Settings" to display the "default" duplexing setting (below
<value>238, 17</value>
</metadata>
<metadata name="PDFLocationBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>770, 17</value>
<value>213, 65</value>
</metadata>
<metadata name="formatInfoListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>969, 17</value>
<value>495, 65</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>87</value>
<value>118</value>
</metadata>
</root>