diff options
| author | j-p <jp.bruyere@live.be> | 2018-04-14 12:15:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-14 12:15:08 +0200 |
| commit | 907358fed63b4a89e8dee5184cc9901a7107ab9f (patch) | |
| tree | 18c473a86b553dbe9f08cfe345b6278c71e9594e /src/GraphicObjects/TemplatedControl.cs | |
| parent | 7c735fa149bf23223eda734f19d5547797ca8ac2 (diff) | |
| parent | 5a06966fd4be89263988d0838556b78a7988b5a9 (diff) | |
Merge pull request #40 from jpbruyere/devel
Devel
Diffstat (limited to 'src/GraphicObjects/TemplatedControl.cs')
| -rw-r--r-- | src/GraphicObjects/TemplatedControl.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs index 34e4ce07..54991a41 100644 --- a/src/GraphicObjects/TemplatedControl.cs +++ b/src/GraphicObjects/TemplatedControl.cs @@ -43,6 +43,20 @@ namespace Crow /// </summary> public abstract class TemplatedControl : PrivateContainer { + #if DESIGN_MODE + public bool design_inlineTemplate = false; + public override void getIML (System.Xml.XmlDocument doc, System.Xml.XmlNode parentElem) + { + if (this.design_isTGItem) + return; + base.getIML (doc, parentElem); + if (child == null || !design_inlineTemplate) + return; + XmlElement xe = doc.CreateElement("Template"); + child.getIML (doc, xe); + parentElem.LastChild.AppendChild (xe); + } + #endif #region CTOR protected TemplatedControl() : base(){} public TemplatedControl (Interface iface) : base(iface){} @@ -66,7 +80,7 @@ namespace Crow if (string.IsNullOrEmpty(_template)) loadTemplate (); else - loadTemplate (CurrentInterface.Load (_template)); + loadTemplate (IFace.Load (_template)); } } /// <summary> @@ -133,9 +147,9 @@ namespace Crow this.ClearTemplateBinding(); if (template == null) { - if (!Interface.DefaultTemplates.ContainsKey (this.GetType ().FullName)) + if (!IFace.DefaultTemplates.ContainsKey (this.GetType ().FullName)) throw new Exception (string.Format ("No default template found for '{0}'", this.GetType ().FullName)); - this.SetChild (CurrentInterface.Load (Interface.DefaultTemplates[this.GetType ().FullName])); + this.SetChild (IFace.Load (IFace.DefaultTemplates[this.GetType ().FullName])); }else this.SetChild (template); } |