2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using System.ComponentModel;
18 using Tizen.NUI.BaseComponents;
20 namespace Tizen.NUI.Components
23 /// ControlStyle is a base class of NUI.Components style.
25 /// <since_tizen> 6 </since_tizen>
26 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
27 [EditorBrowsable(EditorBrowsableState.Never)]
28 public class ControlStyle : ViewStyle, global::System.IDisposable
30 private bool isDisposeQueued = false;
34 ThemeManager.AddPackageTheme(new DefaultThemeCreator());
38 /// Creates a new instance of a ControlStyle.
40 /// <since_tizen> 6 </since_tizen>
41 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
42 [EditorBrowsable(EditorBrowsableState.Never)]
43 public ControlStyle() : base()
49 /// Creates a new instance of a ControlStyle with style.
51 /// <param name="style">Create ControlStyle by style customized by user.</param>
52 /// <since_tizen> 6 </since_tizen>
53 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public ControlStyle(ControlStyle style) : base(style)
62 [EditorBrowsable(EditorBrowsableState.Never)]
67 isDisposeQueued = true;
68 DisposeQueue.Instance.Add(this);
73 /// A Flag to check if it is already disposed.
75 [EditorBrowsable(EditorBrowsableState.Never)]
76 protected bool Disposed { get; set; }
81 [EditorBrowsable(EditorBrowsableState.Never)]
84 //Throw excpetion if Dispose() is called in separate thread.
85 if (!Window.IsInstalled())
87 throw new global::System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
92 Dispose(DisposeTypes.Implicit);
96 Dispose(DisposeTypes.Explicit);
97 global::System.GC.SuppressFinalize(this);
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 protected virtual void Dispose(DisposeTypes type)
112 if (type == DisposeTypes.Explicit)
115 //Release your own managed resources here.
116 //You should release all of your own disposable objects here.
122 private void SubStyleCalledEvent(object sender, global::System.EventArgs e)