diff --git a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs index 8aa7d1d0..695dfc8c 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/SectionConfig.cs @@ -35,12 +35,12 @@ namespace VEPROMS.CSLA.Library //[NonSerialized] private bool _AncestorLookup; //PROPGRID: Hide AncestorLookup - [Browsable(false)] - public bool AncestorLookup - { - get { return _AncestorLookup; } - set { _AncestorLookup = value; } - } + //[Browsable(false)] + //public bool AncestorLookup + //{ + // get { return _AncestorLookup; } + // set { _AncestorLookup = value; } + //} private Section _Section; private SectionInfo _SectionInfo; @@ -50,51 +50,29 @@ namespace VEPROMS.CSLA.Library string xml = section.MyContent.Config; if (xml == string.Empty) xml = ""; _Xp = new XMLProperties(xml); - if (section.ActiveParent != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); + if (section.MySectionInfo.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; - Section sect = _Section; - while (sect.ActiveParent.GetType() == typeof(Section)) + SectionInfo sect = _Section.MySectionInfo; + while (sect.ActiveParent.GetType() == typeof(SectionInfo)) { retval = sect.SectionConfig.GetValue(args.Group, args.Item); if (retval != string.Empty) return retval; - sect = (Section)sect.ActiveParent; + sect = (SectionInfo)sect.ActiveParent; } - Procedure proc = (Procedure)sect.ActiveParent; - while (proc.ActiveParent.GetType() == typeof(Procedure)) + ProcedureInfo proc = (ProcedureInfo)sect.ActiveParent; + retval = proc.ProcedureConfig.GetValue(args.Group, args.Item); + if (retval != string.Empty) return retval; + 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; - 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) - { - string retval; - Section sect = _Section; - while (sect.ActiveParent.GetType() == typeof(Section)) - { - //retval = sect.SectionConfig.GetValue(args.Group, args.Item); - //if (retval != string.Empty) return retval; - sect = (Section)sect.ActiveParent; - } - Procedure proc = (Procedure)sect.ActiveParent; DocVersionInfo docVersion = (DocVersionInfo)proc.ActiveParent; retval = docVersion.DocVersionConfig.GetValue(args.Group, args.Item); if (retval != string.Empty) return retval; @@ -182,7 +160,7 @@ namespace VEPROMS.CSLA.Library if (_Section != null) { _Section.MyContent.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set - _Section.ActiveFormat = null; + //_Section.ActiveFormat = null; DocStyleListConverter.MySection = _Section; } } @@ -213,7 +191,7 @@ namespace VEPROMS.CSLA.Library { get { - if (_Section != null && _Section.ActiveParent != null && _Section.ActiveParent.ActiveFormat != null) return _Section.ActiveParent.ActiveFormat.FullName; + if (_Section != null && _Section.MySectionInfo.ActiveParent != null && _Section.MySectionInfo.ActiveParent.ActiveFormat != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat.FullName; if (_SectionInfo != null && _SectionInfo.MyParent != null && _SectionInfo.MyParent.ActiveFormat != null) return _SectionInfo.MyParent.ActiveFormat.FullName; return null; } @@ -223,11 +201,7 @@ namespace VEPROMS.CSLA.Library { get { - if (_Section != null) - { - SectionInfo sectionInfo = SectionInfo.Get(_Section.ItemID); - return sectionInfo.ActiveParent.ActiveFormat; - } + if (_Section != null) return _Section.MySectionInfo.ActiveParent.ActiveFormat; return _SectionInfo.ActiveParent.ActiveFormat; } } diff --git a/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs index 19383279..7e0a4a5a 100644 --- a/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs +++ b/PROMS/VEPROMS.CSLA.Library/Config/StepConfig.cs @@ -33,14 +33,14 @@ namespace VEPROMS.CSLA.Library } //PROPGRID: Had to comment out NonSerialized 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 Step _Step; private StepInfo _StepInfo; public StepConfig(Step step)