Set CLSCompliant to true as default
authorKangho Hur <kangho.hur@samsung.com>
Thu, 8 Sep 2016 01:47:25 +0000 (10:47 +0900)
committerKangho Hur <kangho.hur@samsung.com>
Thu, 8 Sep 2016 01:47:25 +0000 (10:47 +0900)
* Including Window's call sequence change to support for Window derrived class.

Change-Id: I54a9cbd542889a06e0f93cbe9c1861e3a1aa0f88

src/ElmSharp/ElmSharp/Window.cs
src/ElmSharp/Properties/AssemblyInfo.cs

index 744ae86..6ce44d2 100644 (file)
@@ -37,6 +37,7 @@ namespace ElmSharp
     {
         Interop.SmartEvent _deleteRequest;
         Interop.SmartEvent _rotationChanged;
+
         public Window(string name) : this(null, name)
         {
         }
@@ -45,13 +46,10 @@ namespace ElmSharp
         {
             Name = name;
             Realize(parent);
-            Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */);
-
-            _deleteRequest = new Interop.SmartEvent(this, Handle, "delete,request");
-            _rotationChanged = new Interop.SmartEvent(this, Handle, "wm,rotation,changed");
+        }
 
-            _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
-            _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
+        protected Window()
+        {
         }
 
         public event EventHandler CloseRequested;
@@ -138,6 +136,18 @@ namespace ElmSharp
             Interop.Elementary.elm_win_resize_object_add(Handle, obj);
         }
 
+        protected override void OnRealized()
+        {
+            base.OnRealized();
+            Interop.Elementary.elm_win_indicator_mode_set(Handle, 2 /* ELM_WIN_INDICATOR_SHOW */);
+
+            _deleteRequest = new Interop.SmartEvent(this, Handle, "delete,request");
+            _rotationChanged = new Interop.SmartEvent(this, Handle, "wm,rotation,changed");
+
+            _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
+            _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
+        }
+
         protected override IntPtr CreateHandle(EvasObject parent)
         {
             Interop.Elementary.elm_config_accel_preference_set("3d");
index 8648f95..e1f34b3 100644 (file)
@@ -1,4 +1,5 @@
-using System.Reflection;
+using System;
+using System.Reflection;
 using System.Runtime.CompilerServices;
 using System.Runtime.InteropServices;
 
@@ -18,6 +19,7 @@ using System.Runtime.InteropServices;
 // to COM components.  If you need to access a type in this assembly from 
 // COM, set the ComVisible attribute to true on that type.
 [assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
 
 // The following GUID is for the ID of the typelib if this project is exposed to COM
 [assembly: Guid("bfb6195c-3271-45e8-96fa-5872fa23c920")]