New Enhanced Document Properties
This commit is contained in:
@@ -8,10 +8,108 @@ using System.Xml;
|
||||
|
||||
namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
public partial class DVEnhancedDocuments : List<DVEnhancedDocument>
|
||||
{
|
||||
public void Add(string name, int type, int versionID, int pdfX, string pdfToken)
|
||||
{
|
||||
Add(new DVEnhancedDocument(name, type, versionID,pdfX,pdfToken));
|
||||
}
|
||||
public static DVEnhancedDocuments Load(XMLProperties _Xp)
|
||||
{
|
||||
DVEnhancedDocuments eds = new DVEnhancedDocuments();
|
||||
foreach (XmlNode xn in _Xp.XmlContents.SelectNodes("//Enhanced"))
|
||||
{
|
||||
eds.Add( xn.Attributes["Name"].Value,
|
||||
int.Parse(xn.Attributes["Type"].Value),
|
||||
int.Parse(xn.Attributes["VersionID"].Value),
|
||||
int.Parse(xn.Attributes["PdfX"].Value),
|
||||
xn.Attributes["PdfToken"].Value
|
||||
);
|
||||
}
|
||||
return eds;
|
||||
}
|
||||
public DVEnhancedDocument this[int type]
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (DVEnhancedDocument ed in this)
|
||||
if (ed.Type == type) return ed;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public DVEnhancedDocument this[string name]
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (DVEnhancedDocument ed in this)
|
||||
if (ed.Name == name) return ed;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
public partial class DVEnhancedDocument
|
||||
{
|
||||
private string _Name;
|
||||
public string Name
|
||||
{
|
||||
get { return _Name; }
|
||||
set { _Name = value; }
|
||||
}
|
||||
private int _Type;
|
||||
public int Type
|
||||
{
|
||||
get { return _Type; }
|
||||
set { _Type = value; }
|
||||
}
|
||||
private int _VersionID;
|
||||
public int VersionID
|
||||
{
|
||||
get { return _VersionID; }
|
||||
set { _VersionID = value; }
|
||||
}
|
||||
private int _PdfX;
|
||||
public int PdfX
|
||||
{
|
||||
get { return _PdfX; }
|
||||
set { _PdfX = value; }
|
||||
}
|
||||
private string _PdfToken;
|
||||
public string PdfToken
|
||||
{
|
||||
get { return _PdfToken; }
|
||||
set { _PdfToken = value; }
|
||||
}
|
||||
public DVEnhancedDocument() { ;}
|
||||
public DVEnhancedDocument(string name,int type, int versionID, int pdfX, string pdfToken)
|
||||
{
|
||||
Name = name;
|
||||
Type = type;
|
||||
VersionID = versionID;
|
||||
PdfX = pdfX;
|
||||
PdfToken = PdfToken;
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0}.ItemID={1}", Name,VersionID);
|
||||
}
|
||||
}
|
||||
[Serializable]
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public class DocVersionConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged
|
||||
{
|
||||
private DVEnhancedDocuments _MyEnhancedDocuments = null;
|
||||
public DVEnhancedDocuments MyEnhancedDocuments
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyEnhancedDocuments == null)
|
||||
{
|
||||
_MyEnhancedDocuments = DVEnhancedDocuments.Load(_Xp);
|
||||
}
|
||||
return _MyEnhancedDocuments;
|
||||
}
|
||||
set { _MyEnhancedDocuments = value; }
|
||||
}
|
||||
#region DynamicTypeDescriptor
|
||||
internal override bool IsReadOnly
|
||||
{
|
||||
|
Reference in New Issue
Block a user