From 9931c454f30a0055eef695b736298ed3c2d71c75 Mon Sep 17 00:00:00 2001 From: Rich Date: Tue, 5 Apr 2016 16:04:21 +0000 Subject: [PATCH] Added config support for AnnotationType --- .../Config/AnnotationTypeConfig.cs | 92 +++++++++++++++++++ .../Extension/AnnotationExt.cs | 27 ++++++ 2 files changed, 119 insertions(+) create mode 100644 PROMS/VEPROMS.CSLA.Library/Config/AnnotationTypeConfig.cs diff --git a/PROMS/VEPROMS.CSLA.Library/Config/AnnotationTypeConfig.cs b/PROMS/VEPROMS.CSLA.Library/Config/AnnotationTypeConfig.cs new file mode 100644 index 00000000..da139446 --- /dev/null +++ b/PROMS/VEPROMS.CSLA.Library/Config/AnnotationTypeConfig.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.ComponentModel; + +namespace VEPROMS.CSLA.Library +{ + [Serializable] + [TypeConverter(typeof(ExpandableObjectConverter))] + public class AnnotationTypeConfig : ConfigDynamicTypeDescriptor, INotifyPropertyChanged + { + private XMLProperties _Xp; + private XMLProperties Xp + { + get { return _Xp; } + } + public AnnotationTypeConfig(string xml) + { + if (xml == string.Empty) xml = ""; + _Xp = new XMLProperties(xml); + } + public AnnotationTypeConfig(AnnotationTypeInfo ati) + { + string xml = ati.Config; + if (xml == string.Empty) xml = ""; + _Xp = new XMLProperties(xml); + } + public AnnotationTypeConfig(AnnotationType t) + { + string xml = t.Config; + if (xml == string.Empty) xml = ""; + _Xp = new XMLProperties(xml); + } + public AnnotationTypeConfig() + { + _Xp = new XMLProperties(); + } + public override string ToString() + { + string s = _Xp.ToString(); + if (s == "" || s == "") return string.Empty; + return s; + } + #region AnnotationTypeConfigProperties + [Category("Integration")] // Special Editor for Annotation Type + [DisplayName("Executable")] + [RefreshProperties(RefreshProperties.All)] + [Description("Executable")] + public string Integration_Executable + { + get + { + return _Xp["Integration", "Executable"]; + } + set + { + _Xp["Integration", "Executable"] = value; + } + } + [Category("Integration")] // Pipe from PROMs to Special Editor + [DisplayName("PipeOut")] + [RefreshProperties(RefreshProperties.All)] + [Description("PipeOut")] + public string Integration_PipeOut + { + get + { + return _Xp["Integration", "PipeOut"]; + } + set + { + _Xp["Integration", "PipeOut"] = value; + } + } + [Category("Integration")] // Pipe to PROMs from Special Editor + [DisplayName("PipeIn")] + [RefreshProperties(RefreshProperties.All)] + [Description("PipeIn")] + public string Integration_PipeIn + { + get + { + return _Xp["Integration", "PipeIn"]; + } + set + { + _Xp["Integration", "PipeIn"] = value; + } + } + #endregion + } +} diff --git a/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs b/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs index 6b567049..86f7e66d 100644 --- a/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs +++ b/PROMS/VEPROMS.CSLA.Library/Extension/AnnotationExt.cs @@ -53,9 +53,36 @@ namespace VEPROMS.CSLA.Library { return _Name; } + [NonSerialized] + private AnnotationTypeConfig _AnnotationTypeConfig; + public AnnotationTypeConfig AnnotationTypeConfig + { + get + { + if (_AnnotationTypeConfig == null) + { + _AnnotationTypeConfig = new AnnotationTypeConfig(this); + } + return _AnnotationTypeConfig; + } + } + } public partial class AnnotationTypeInfo { + [NonSerialized] + private AnnotationTypeConfig _AnnotationTypeConfig; + public AnnotationTypeConfig AnnotationTypeConfig + { + get + { + if (_AnnotationTypeConfig == null) + { + _AnnotationTypeConfig = new AnnotationTypeConfig(this); + } + return _AnnotationTypeConfig; + } + } public static List AllList() { //return _AllList;