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.Collections.Generic;
18 using System.ComponentModel;
19 using Tizen.NUI.BaseComponents;
20 using Tizen.NUI.Binding;
22 namespace Tizen.NUI.Components
25 /// ControlStyle is a base class of NUI.Components style.
27 /// <since_tizen> 6 </since_tizen>
28 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
29 [EditorBrowsable(EditorBrowsableState.Never)]
30 public class ControlStyle : ViewStyle, global::System.IDisposable
33 /// A Flag to check if it is already disposed.
35 [EditorBrowsable(EditorBrowsableState.Never)]
36 protected bool disposed = false;
38 private bool isDisposeQueued = false;
40 static ControlStyle () { }
43 /// Creates a new instance of a ControlStyle.
45 /// <since_tizen> 6 </since_tizen>
46 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
47 [EditorBrowsable(EditorBrowsableState.Never)]
48 public ControlStyle() : base()
55 /// Creates a new instance of a ControlStyle with style.
57 /// <param name="style">Create ControlStyle by style customized by user.</param>
58 /// <since_tizen> 6 </since_tizen>
59 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
60 [EditorBrowsable(EditorBrowsableState.Never)]
61 public ControlStyle(ControlStyle style) : base(style)
63 if(null == style) return;
71 [EditorBrowsable(EditorBrowsableState.Never)]
76 isDisposeQueued = true;
77 DisposeQueue.Instance.Add(this);
84 [EditorBrowsable(EditorBrowsableState.Never)]
87 //Throw excpetion if Dispose() is called in separate thread.
88 if (!Window.IsInstalled())
90 throw new global::System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
95 Dispose(DisposeTypes.Implicit);
99 Dispose(DisposeTypes.Explicit);
100 global::System.GC.SuppressFinalize(this);
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 protected virtual void Dispose(DisposeTypes type)
115 if (type == DisposeTypes.Explicit)
118 //Release your own managed resources here.
119 //You should release all of your own disposable objects here.
125 private void InitSubstyle()
129 private void SubStyleCalledEvent(object sender, global::System.EventArgs e)