Added timing logic

Changed menu text
Support Procedure and ProcedureInfo
Added ChangeBar support
Fixed Ancestor Inheritance
This commit is contained in:
Rich 2010-05-25 16:09:40 +00:00
parent f2c571b113
commit f21a49d75e
5 changed files with 37 additions and 5 deletions

View File

@ -367,7 +367,7 @@ namespace VEPROMS.CSLA.Library
[TypeConverter(typeof(EnumDescConverter))] [TypeConverter(typeof(EnumDescConverter))]
public enum PrintChangeBar : int public enum PrintChangeBar : int
{ {
[Description("Select Before Printing")] [Description("No Default, Select Before Printing")]
SelectBeforePrinting = 0, SelectBeforePrinting = 0,
[Description("Without Change Bars")] [Description("Without Change Bars")]
Without, Without,

View File

@ -56,7 +56,8 @@ namespace VEPROMS.CSLA.Library
if (args.AncestorLookup || ParentLookup) if (args.AncestorLookup || ParentLookup)
{ {
string retval; string retval;
ProcedureInfo proc = _Procedure.MyProcedureInfo; //ProcedureInfo proc = _Procedure.MyProcedureInfo;
ProcedureInfo proc = _Procedure != null ? _Procedure.MyProcedureInfo : _ProcedureInfo;
while (proc.ActiveParent.GetType() == typeof(ProcedureInfo)) while (proc.ActiveParent.GetType() == typeof(ProcedureInfo))
{ {
retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); retval = proc.ProcedureConfig.GetValue(args.Group, args.Item);
@ -96,6 +97,8 @@ namespace VEPROMS.CSLA.Library
string xml = procedureInfo.MyContent.Config; string xml = procedureInfo.MyContent.Config;
if (xml == string.Empty) xml = "<config/>"; if (xml == string.Empty) xml = "<config/>";
_Xp = new XMLProperties(xml); _Xp = new XMLProperties(xml);
_Xp.AncestorLookup = true;
if (procedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
} }
public ProcedureConfig(string xml) public ProcedureConfig(string xml)
{ {

View File

@ -173,6 +173,25 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("Step_CBOverride"); OnPropertyChanged("Step_CBOverride");
} }
} }
public string Step_MultipleChangeID
{
get
{
string s = _Xp["Step", "MultipleChangeID"];
if (s == string.Empty) return null;
return s;
}
set
{
string s = _Xp["Step", "MultipleChangeID"];
if (value != null && value.ToString() == s) return;
if (value == null && s != null) _Xp["Step", "MultipleChangeID"] = null;
else _Xp["Step", "MultipleChangeID"] = value.ToString();
OnPropertyChanged("Step_MultipleChangeID");
}
}
#endregion #endregion
} }
} }

View File

@ -18,6 +18,14 @@ namespace VEPROMS.CSLA.Library
return string.Empty; return string.Empty;
} }
#endregion #endregion
private bool _AncestorLookup=false;
public bool AncestorLookup
{
get { return _AncestorLookup; }
set { _AncestorLookup = value; }
}
#region Constructors #region Constructors
public XMLProperties() public XMLProperties()
{ {
@ -83,11 +91,11 @@ namespace VEPROMS.CSLA.Library
get get
{ {
if (_ParentLookup) if (_ParentLookup)
return OnLookInAncestor(this, new XMLPropertiesArgs(group, item)); return OnLookInAncestor(this, new XMLPropertiesArgs(group, item, AncestorLookup));
XmlNode xn = GetGroup(group); XmlNode xn = GetGroup(group);
if (xn == null) return OnLookInAncestor(this,new XMLPropertiesArgs(group,item)); if (xn == null) return OnLookInAncestor(this, new XMLPropertiesArgs(group, item, AncestorLookup));
XmlNode xa = GetItem(xn, item); XmlNode xa = GetItem(xn, item);
if (xa == null) return OnLookInAncestor(this, new XMLPropertiesArgs(group, item)); if (xa == null) return OnLookInAncestor(this, new XMLPropertiesArgs(group, item, AncestorLookup));
return xa.InnerText; return xa.InnerText;
} }
set set

View File

@ -75,10 +75,12 @@ namespace PrintMSWord
_ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>(); _ElapsedTime = new Dictionary<PromsPrinterStatusType, TimeSpan>();
DateTime tStart = DateTime.Now; DateTime tStart = DateTime.Now;
string pdfFile = pp.Print(@"C:\TEMP\32Bit", _MyProms2010Print, null, this); string pdfFile = pp.Print(@"C:\TEMP\32Bit", _MyProms2010Print, null, this);
DateTime tEnd = DateTime.Now;
_ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart); _ElapsedTime.Add(PromsPrinterStatusType.Total, DateTime.Now - tStart);
MyStatus = pdfFile + " created."; MyStatus = pdfFile + " created.";
this.Cursor = saveCursor; this.Cursor = saveCursor;
ShowElapsedTime(); ShowElapsedTime();
MyStatus = string.Format("{0} created in {1:0.} milliseconds",pdfFile,(TimeSpan.FromTicks(tEnd.Ticks - tStart.Ticks).TotalMilliseconds));
} }
private void ShowElapsedTime() private void ShowElapsedTime()
{ {