Refacto Window initialize code
authorSeungkeun Lee <sngn.lee@samsung.com>
Mon, 19 Sep 2016 05:45:43 +0000 (14:45 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Tue, 20 Sep 2016 04:49:16 +0000 (13:49 +0900)
 - Move from OnRealized to Constructor
 - Orignally we add initialize code into OnRealized method to reuse with Sub class(WidgetWindow)
   But, Initialized code only for elm-window, not Widget window, So move to Constructor of Window
 - To deprecate OnRealized method

Change-Id: I7d4ddc8f04cdeb7e22acdd25d071e426a32a01e9

src/ElmSharp/ElmSharp/Window.cs

index 6ce44d21e717cf32420987afd0fbf708fc4df4b7..7f45245ff9c5faef365082804ac2eb165f2bc33d 100644 (file)
@@ -46,6 +46,12 @@ 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()
@@ -136,18 +142,6 @@ 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");