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
Removed debug print
This commit is contained in:
Rich 2009-10-08 14:27:03 +00:00
parent 533baae01c
commit 6396b53eeb
2 changed files with 27 additions and 27 deletions

View File

@ -32,14 +32,14 @@ namespace VEPROMS.CSLA.Library
get { return _Xp.ParentLookup; } get { return _Xp.ParentLookup; }
set { _Xp.ParentLookup = value; } set { _Xp.ParentLookup = value; }
} }
private bool _AncestorLookup; //private bool _AncestorLookup;
//PROPGRID: Hide AncestorLookup ////PROPGRID: Hide AncestorLookup
[Browsable(false)] //[Browsable(false)]
public bool AncestorLookup //public bool AncestorLookup
{ //{
get { return _AncestorLookup; } // get { return _AncestorLookup; }
set { _AncestorLookup = value; } // set { _AncestorLookup = value; }
} //}
private DocVersion _DocVersion; private DocVersion _DocVersion;
public DocVersionConfig(DocVersion docVersion) public DocVersionConfig(DocVersion docVersion)
{ {
@ -47,25 +47,13 @@ namespace VEPROMS.CSLA.Library
string xml = docVersion.Config; string xml = docVersion.Config;
if (xml == string.Empty) xml = "<Config/>"; if (xml == string.Empty) xml = "<Config/>";
_Xp = new XMLProperties(xml); _Xp = new XMLProperties(xml);
if (docVersion.MyFolder != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder); if (docVersion.MyDocVersionInfo.MyFolder != null) _Xp.LookInAncestor += new XMLPropertiesEvent(Xp_LookInAncestorFolder);
} }
private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args) private string Xp_LookInAncestorFolder(object sender, XMLPropertiesArgs args)
{ {
if (_AncestorLookup || ParentLookup) if (args.AncestorLookup || ParentLookup)
{ {
for (Folder folder = _DocVersion.MyFolder; folder != null; folder = folder.MyParent) for (FolderInfo folder = _DocVersion.MyDocVersionInfo.MyFolder; folder != null; folder = folder.MyParent)
{
string 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)
{
for (FolderInfo folder = _DocVersionInfo.MyFolder; folder != null; folder = folder.MyParent)
{ {
string retval = folder.FolderConfig.GetValue(args.Group, args.Item); string retval = folder.FolderConfig.GetValue(args.Group, args.Item);
if (retval != string.Empty) return retval; if (retval != string.Empty) return retval;
@ -73,6 +61,18 @@ namespace VEPROMS.CSLA.Library
} }
return string.Empty; return string.Empty;
} }
//private string Xp_LookInAncestorFolderInfo(object sender, XMLPropertiesArgs args)
//{
// if (args.AncestorLookup || ParentLookup)
// {
// for (FolderInfo folder = _DocVersionInfo.MyFolder; folder != null; folder = folder.MyParent)
// {
// string retval = folder.FolderConfig.GetValue(args.Group, args.Item);
// if (retval != string.Empty) return retval;
// }
// }
// return string.Empty;
//}
private DocVersionInfo _DocVersionInfo; private DocVersionInfo _DocVersionInfo;
public DocVersionConfig(DocVersionInfo docVersionInfo) public DocVersionConfig(DocVersionInfo docVersionInfo)
{ {
@ -131,7 +131,7 @@ namespace VEPROMS.CSLA.Library
if (_DocVersion != null) if (_DocVersion != null)
{ {
_DocVersion.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set _DocVersion.MyFormat = FormatList.ToFormat(value); // Can only be set if _DocVersion is set
_DocVersion.ActiveFormat = null; //_DocVersion.ActiveFormat = null;
} }
} }
} }
@ -143,8 +143,8 @@ namespace VEPROMS.CSLA.Library
{ {
get get
{ {
if (_DocVersion != null && _DocVersion.MyFolder != null && _DocVersion.MyFolder.ActiveParent != null) return _DocVersion.MyFolder.ActiveFormat.FullName; if (_DocVersion != null && _DocVersion.MyDocVersionInfo.MyFolder != null && _DocVersion.MyDocVersionInfo.MyFolder.ActiveFormat != null) return _DocVersion.MyDocVersionInfo.MyFolder.ActiveFormat.FullName;
if (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveParent != null) return _DocVersionInfo.MyFolder.ActiveFormat.FullName; if (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveFormat != null) return _DocVersionInfo.MyFolder.ActiveFormat.FullName;
return null; return null;
} }
} }

View File

@ -35,7 +35,7 @@ namespace DescriptiveEnum
/// <returns>The description, if any, else it's .ToString()</returns> /// <returns>The description, if any, else it's .ToString()</returns>
public static string GetEnumDescription(Enum value) public static string GetEnumDescription(Enum value)
{ {
Console.WriteLine("{0}", value); //Console.WriteLine("{0}", value);
FieldInfo fi = value.GetType().GetField(value.ToString()); FieldInfo fi = value.GetType().GetField(value.ToString());
DescriptionAttribute[] attributes = DescriptionAttribute[] attributes =
(DescriptionAttribute[])fi.GetCustomAttributes( (DescriptionAttribute[])fi.GetCustomAttributes(