This commit is contained in:
Kathy Ruffing 2008-10-03 11:25:33 +00:00
parent 27b8dc52f3
commit 3b5e898cea
4 changed files with 93 additions and 1 deletions

View File

@ -156,6 +156,8 @@ namespace VEPROMS.CSLA.Library
return null;
}
}
public DocVersion MyDocVersion
{ get { return _DocVersion; } }
#endregion
#region ToString
public override string ToString()

View File

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace VEPROMS.CSLA.Library
{
[Serializable]
[TypeConverter(typeof(ExpandableObjectConverter))]
public class DocumentConfig : DynamicTypeDescriptor, INotifyPropertyChanged
{
#region Events
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(String info)
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(info));
}
#endregion
#region XML
private XMLProperties _Xp;
private XMLProperties Xp
{
get { return _Xp; }
}
#endregion
#region Constructors
public Document _Document;
private DocumentInfo _DocumentInfo;
public DocumentConfig(Document document)
{
_Document = document;
string xml = _Document.Config;
if (xml == string.Empty) xml = "<config/>";
_Xp = new XMLProperties(xml);
}
public DocumentConfig(DocumentInfo documentInfo)
{
_DocumentInfo = documentInfo;
string xml = _DocumentInfo.Config;
if (xml == string.Empty) xml = "<config/>";
_Xp = new XMLProperties(xml);
}
internal string GetValue(string group, string item)
{
return _Xp[group, item];
}
#endregion
#region Properties
[Category("General")]
[DisplayName("Name")]
[Description("Name")]
public string Name
{
get { return (_Document != null ? _Document.LibTitle : _DocumentInfo.LibTitle); }
set { if (_Document != null) _Document.LibTitle = value; }
}
[Category("General")]
[DisplayName("Comment")]
[RefreshProperties(RefreshProperties.All)]
[Description("Comment")]
public string LibDoc_Comment
{
get
{
string s = _Xp["LibDoc", "Comment"];// get the saved value
return s;
}
set
{
_Xp["LibDoc", "Comment"] = value;
OnPropertyChanged("LibDoc_Comment");
}
}
#endregion
#region ToString
public override string ToString()
{
string s = _Xp.ToString();
if (s == "<Config/>" || s == "<Config></Config>") return string.Empty;
return s;
}
#endregion
}
}

View File

@ -179,6 +179,8 @@ namespace VEPROMS.CSLA.Library
return null;
}
}
public Folder MyFolder
{ get { return _Folder; } }
#endregion
#region ToString
public override string ToString()

View File

@ -50,7 +50,8 @@ namespace VEPROMS.CSLA.Library
set { _AncestorLookup = value; }
}
private Section _Section;
private SectionInfo _SectionInfo;
private SectionInfo _SectionInfo;
public SectionConfig(Section section)
{
_Section = section;
@ -527,6 +528,7 @@ namespace VEPROMS.CSLA.Library
OnPropertyChanged("LibDoc_Comment");
}
}
#endregion
}
}