Removed AncestorLookup property
Changed logic to use Info version of parent Changed Ancestor Lookup to use Info objects Removed ActiveFormat from editable object Changed DefaultFormatSelection to use info objects
This commit is contained in:
parent
4bdc127c87
commit
10f55d09fd
@ -33,14 +33,14 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
//PROPGRID: Needed to comment out [NonSerialized] in order to hide AncestorLookup from property grid
|
||||
//[NonSerialized]
|
||||
private bool _AncestorLookup;
|
||||
//PROPGRID: Hide AncestorLookup
|
||||
[Browsable(false)]
|
||||
public bool AncestorLookup
|
||||
{
|
||||
get { return _AncestorLookup; }
|
||||
set { _AncestorLookup = value; }
|
||||
}
|
||||
//private bool _AncestorLookup;
|
||||
////PROPGRID: Hide AncestorLookup
|
||||
//[Browsable(false)]
|
||||
//public bool AncestorLookup
|
||||
//{
|
||||
// get { return _AncestorLookup; }
|
||||
// set { _AncestorLookup = value; }
|
||||
//}
|
||||
private Procedure _Procedure;
|
||||
private ProcedureInfo _ProcedureInfo;
|
||||
public ProcedureConfig(Procedure procedure)
|
||||
@ -49,39 +49,23 @@ namespace VEPROMS.CSLA.Library
|
||||
string xml = procedure.MyContent.Config;
|
||||
if (xml == string.Empty) xml = "<config/>";
|
||||
_Xp = new XMLProperties(xml);
|
||||
if (procedure.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
|
||||
if (procedure.MyProcedureInfo.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
|
||||
}
|
||||
private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args)
|
||||
{
|
||||
if (_AncestorLookup || ParentLookup)
|
||||
if (args.AncestorLookup || ParentLookup)
|
||||
{
|
||||
string retval;
|
||||
Procedure proc = _Procedure;
|
||||
while (proc.ActiveParent.GetType() == typeof(Procedure))
|
||||
ProcedureInfo proc = _Procedure.MyProcedureInfo;
|
||||
while (proc.ActiveParent.GetType() == typeof(ProcedureInfo))
|
||||
{
|
||||
retval = proc.ProcedureConfig.GetValue(args.Group, args.Item);
|
||||
if (retval != string.Empty) return retval;
|
||||
proc = (Procedure)proc.ActiveParent;
|
||||
proc = (ProcedureInfo)proc.ActiveParent;
|
||||
}
|
||||
DocVersion docVersion = (DocVersion)proc.ActiveParent;
|
||||
DocVersionInfo docVersion = (DocVersionInfo)proc.ActiveParent;
|
||||
retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item);
|
||||
if (retval != string.Empty) return retval;
|
||||
for (Folder folder = docVersion.MyFolder; folder != null; folder = folder.MyParent)
|
||||
{
|
||||
retval = folder.FolderConfig.GetValue(args.Group, args.Item);
|
||||
if (retval != string.Empty) return retval;
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
|
||||
{
|
||||
if (_AncestorLookup || ParentLookup)
|
||||
{
|
||||
|
||||
DocVersionInfo docVersion = (DocVersionInfo)_Procedure.ActiveParent;
|
||||
string retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item);
|
||||
if (retval != string.Empty) return retval;
|
||||
for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent)
|
||||
{
|
||||
retval = folder.FolderConfig.GetValue(args.Group, args.Item);
|
||||
@ -90,6 +74,22 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
//private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
|
||||
//{
|
||||
// if (args.AncestorLookup || ParentLookup)
|
||||
// {
|
||||
|
||||
// DocVersionInfo docVersion = (DocVersionInfo)_Procedure.ActiveParent;
|
||||
// string retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item);
|
||||
// if (retval != string.Empty) return retval;
|
||||
// for (FolderInfo folder = docVersion.MyFolder; folder != null; folder = folder.MyParent)
|
||||
// {
|
||||
// retval = folder.FolderConfig.GetValue(args.Group, args.Item);
|
||||
// if (retval != string.Empty) return retval;
|
||||
// }
|
||||
// }
|
||||
// return string.Empty;
|
||||
//}
|
||||
public ProcedureConfig(ProcedureInfo procedureInfo)
|
||||
{
|
||||
_ProcedureInfo = procedureInfo;
|
||||
@ -164,7 +164,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (_Procedure != null)
|
||||
{
|
||||
_Procedure.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set
|
||||
_Procedure.ActiveFormat = null;
|
||||
//_Procedure.ActiveFormat = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -176,8 +176,8 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Procedure != null && _Procedure.ActiveParent != null && _Procedure.ActiveParent.ActiveFormat != null) return _Procedure.ActiveParent.ActiveFormat.PlantFormat.FormatData.Name;
|
||||
if (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.PlantFormat.FormatData.Name;
|
||||
if (_Procedure != null && _Procedure.MyProcedureInfo.ActiveParent != null && _Procedure.MyProcedureInfo.ActiveParent.ActiveFormat != null) return _Procedure.MyProcedureInfo.ActiveParent.ActiveFormat.FullName;
|
||||
if (_ProcedureInfo != null && _ProcedureInfo.MyParent != null && _ProcedureInfo.MyParent.ActiveFormat != null) return _ProcedureInfo.MyParent.ActiveFormat.FullName;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user