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:
parent
533baae01c
commit
6396b53eeb
@ -32,14 +32,14 @@ namespace VEPROMS.CSLA.Library
|
||||
get { return _Xp.ParentLookup; }
|
||||
set { _Xp.ParentLookup = value; }
|
||||
}
|
||||
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 DocVersion _DocVersion;
|
||||
public DocVersionConfig(DocVersion docVersion)
|
||||
{
|
||||
@ -47,25 +47,13 @@ namespace VEPROMS.CSLA.Library
|
||||
string xml = docVersion.Config;
|
||||
if (xml == string.Empty) xml = "<Config/>";
|
||||
_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)
|
||||
{
|
||||
if (_AncestorLookup || ParentLookup)
|
||||
if (args.AncestorLookup || ParentLookup)
|
||||
{
|
||||
for (Folder folder = _DocVersion.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)
|
||||
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;
|
||||
@ -73,6 +61,18 @@ namespace VEPROMS.CSLA.Library
|
||||
}
|
||||
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;
|
||||
public DocVersionConfig(DocVersionInfo docVersionInfo)
|
||||
{
|
||||
@ -131,7 +131,7 @@ namespace VEPROMS.CSLA.Library
|
||||
if (_DocVersion != null)
|
||||
{
|
||||
_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
|
||||
{
|
||||
if (_DocVersion != null && _DocVersion.MyFolder != null && _DocVersion.MyFolder.ActiveParent != null) return _DocVersion.MyFolder.ActiveFormat.FullName;
|
||||
if (_DocVersionInfo != null && _DocVersionInfo.MyFolder != null && _DocVersionInfo.MyFolder.ActiveParent != null) return _DocVersionInfo.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.ActiveFormat != null) return _DocVersionInfo.MyFolder.ActiveFormat.FullName;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace DescriptiveEnum
|
||||
/// <returns>The description, if any, else it's .ToString()</returns>
|
||||
public static string GetEnumDescription(Enum value)
|
||||
{
|
||||
Console.WriteLine("{0}", value);
|
||||
//Console.WriteLine("{0}", value);
|
||||
FieldInfo fi = value.GetType().GetField(value.ToString());
|
||||
DescriptionAttribute[] attributes =
|
||||
(DescriptionAttribute[])fi.GetCustomAttributes(
|
||||
|
Loading…
x
Reference in New Issue
Block a user