diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-16 15:23:34 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-08-16 15:23:34 +0200 |
| commit | 8c7cd405658cbe7e4d64be189549b8125300964f (patch) | |
| tree | 409ce325828c665bd0b285a09d40a5a924d73419 /src/GraphicObjects/GraphicObject.cs | |
| parent | ea5ba40d536aa80b56db118c3e8e077790c24359 (diff) | |
Correct bug 'Instanciing from code instead of IML'
set currentInterface to default one if null
modifié : Crow.OpenTK.nuspec
modifié : src/CompilerServices/CompilerServices.cs
modifié : src/GraphicObjects/Container.cs
modifié : src/GraphicObjects/GraphicObject.cs
modifié : src/GraphicObjects/PrivateContainer.cs
modifié : src/GraphicObjects/TemplatedControl.cs
modifié : src/Interface.cs
Diffstat (limited to 'src/GraphicObjects/GraphicObject.cs')
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index bd96b76c..0cde106a 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -25,6 +25,21 @@ namespace Crow internal static ulong currentUid = 0; internal ulong uid = 0; + Interface currentInterface = null; + + public Interface CurrentInterface { + get { + if (currentInterface == null) { + currentInterface = Interface.CurrentInterface; + initialize (); + } + return currentInterface; + } + set { + currentInterface = value; + } + } + Rectangles clipping = new Rectangles(); public Rectangles Clipping { get { return clipping; }} @@ -41,23 +56,11 @@ namespace Crow { uid = currentUid; currentUid++; - -// if (CurrentInterface.XmlLoading) -// return; -// loadDefaultValues (); - } - public GraphicObject (Rectangle _bounds) - { -// if (!CurrentInterface.XmlLoading) -// loadDefaultValues (); - - Left = _bounds.Left; - Top = _bounds.Top; - Width = _bounds.Width; - Height = _bounds.Height; } #endregion - + internal protected virtual void initialize(){ + loadDefaultValues (); + } #region private fields LayoutingType registeredLayoutings = LayoutingType.All; ILayoutable logicalParent; @@ -729,7 +732,6 @@ namespace Crow if (RegisteredLayoutings == LayoutingType.None) CurrentInterface.EnqueueForRepaint (this); } - internal Interface CurrentInterface = null; #endregion #region Layouting |