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.
19 using Tizen.NUI.Binding;
31 public int? KeyInt = null;
36 public string KeyString = null;
41 public PropertyValue TrueValue = null;
43 private string _key = null;
44 private object _originalValue = null;
45 private object _originalKey = null;
48 /// Default Constructor.
70 /// OriginalKey property.
72 /// <exception cref="ArgumentNullException"> Thrown when value is null. </exception>
73 public object OriginalKey
83 throw new ArgumentNullException(nameof(value));
87 if (value is int || value is Int32)
91 else if (value is string)
93 KeyString = value.ToString();
95 else if (value.GetType().Equals(typeof(int)) || value.GetType().Equals(typeof(Int32)))
99 else if (value.GetType().Equals(typeof(string)))
101 KeyString = value.ToString();
113 return _originalValue;
117 _originalValue = value;
118 TrueValue = PropertyValue.CreateFromObject(value);
123 /// IntergerValue property.
125 public int IntergerValue
129 TrueValue = new PropertyValue(value);
134 /// BooleanValue property.
136 public bool BooleanValue
140 TrueValue = new PropertyValue(value);
145 /// SingleValue property.
147 public float SingleValue
151 TrueValue = new PropertyValue(value);
156 /// StringValue property.
158 public string StringValue
162 TrueValue = new PropertyValue(value);
167 /// Vector2Value property.
169 public Vector2 Vector2Value
173 TrueValue = new PropertyValue(value);
178 /// Vector3Value property.
180 public Vector3 Vector3Value
184 TrueValue = new PropertyValue(value);
189 /// Vector4Value property.
191 public Vector4 Vector4Value
195 TrueValue = new PropertyValue(value);
200 /// PositionValue property.
202 public Position PositionValue
206 TrueValue = new PropertyValue(value);
211 /// Position2DValue property.
213 public Position2D Position2DValue
217 TrueValue = new PropertyValue(value);
222 /// SizeValue property.
224 public Size SizeValue
228 TrueValue = new PropertyValue(value);
233 /// Size2DValue property.
235 public Size2D Size2DValue
239 TrueValue = new PropertyValue(value);
244 /// ColorValue property.
246 public Color ColorValue
250 TrueValue = new PropertyValue(value);
255 /// RectangleValue property.
257 public Rectangle RectangleValue
261 TrueValue = new PropertyValue(value);
266 /// RotationValue property.
268 public Rotation RotationValue
272 TrueValue = new PropertyValue(value);
277 /// RelativeVector2Value property.
279 public RelativeVector2 RelativeVector2Value
283 TrueValue = new PropertyValue(value);
288 /// RelativeVector3Value property.
290 public RelativeVector3 RelativeVector3Value
294 TrueValue = new PropertyValue(value);
299 /// RelativeVector4Value property.
301 public RelativeVector4 RelativeVector4Value
305 TrueValue = new PropertyValue(value);
310 /// ExtentsValue property.
312 public Extents ExtentsValue
316 TrueValue = new PropertyValue(value);
321 /// PropertyArrayValue property.
323 public PropertyArray PropertyArrayValue
327 TrueValue = new PropertyValue(value);
332 /// PropertyMapValue property.
334 public PropertyMap PropertyMapValue
338 TrueValue = new PropertyValue(value);
342 private void ParseKey(string key)
345 if (VisualExtension.KeyDictionary.ContainsKey(key))
347 VisualExtension.KeyDictionary.TryGetValue(key, out v);