Exemple #1
0
 private void UpdateUrl()
 {
     propertyMap[ImageVisualProperty.URL] = PropertyValue.CreateWithGuard(url);
     OnPropertyChanged?.Invoke(this);
 }
Exemple #2
0
        /// <summary>
        /// Retrieves a property value.
        /// </summary>
        /// <param name="index">The index of the property.</param>
        /// <returns>The property value.</returns>
        /// <since_tizen> 3 </since_tizen>
        public PropertyValue GetProperty(int index)
        {
            PropertyValue ret = Tizen.NUI.Object.GetProperty(swigCPtr, index);

            return(ret);
        }
Exemple #3
0
 private void UpdateBorder()
 {
     propertyMap[ImageVisualProperty.Border] = PropertyValue.CreateWithGuard(border);
     OnPropertyChanged?.Invoke(this);
 }
Exemple #4
0
        /// <summary>
        /// Adds a key frame.
        /// </summary>
        /// <param name="progress">A progress value between 0.0 and 1.0.</param>
        /// <param name="value">A value</param>
        /// <param name="alpha">The alpha function used to blend to the next keyframe.</param>
        /// <since_tizen> 3 </since_tizen>
        public void Add(float progress, object value, AlphaFunction alpha)
        {
            PropertyValue val = PropertyValue.CreateFromObject(value);

            Add(progress, val, alpha);
        }
Exemple #5
0
 /// <summary>
 /// Sets the value of an existing property.
 /// </summary>
 /// <param name="index">The index of the property.</param>
 /// <param name="propertyValue">The new value of the property.</param>
 /// <since_tizen> 3 </since_tizen>
 public void SetProperty(int index, PropertyValue propertyValue)
 {
     Tizen.NUI.Object.SetProperty(swigCPtr, index, propertyValue);
 }
Exemple #6
0
        /// <summary>
        /// An extension to the property value class that allows us to create a
        /// Property value from a C# object, for example, integer, float, or string.<br />
        /// </summary>
        /// <param name="obj">An object to create.</param>
        /// <returns>The created value.</returns>
        /// <exception cref="global::System.ArgumentNullException"> Thrown when obj is null. </exception>
        /// <since_tizen> 3 </since_tizen>
        static public PropertyValue CreateFromObject(System.Object obj)
        {
            if (null == obj)
            {
                throw new global::System.ArgumentNullException(nameof(obj));
            }

            System.Type   type = obj.GetType();
            PropertyValue value;

            if (type.IsEnum)
            {
                value = new PropertyValue((int)obj);//Enum.Parse(type, str);
            }
            else if (type.Equals(typeof(int)))
            {
                value = new PropertyValue((int)obj);
            }
            else if (type.Equals(typeof(System.Int32)))
            {
                value = new PropertyValue((int)obj);
            }
            else if (type.Equals(typeof(bool)))
            {
                value = new PropertyValue((bool)obj);
            }
            else if (type.Equals(typeof(float)))
            {
                value = new PropertyValue((float)obj);
            }
            else if (type.Equals(typeof(string)))
            {
                value = new PropertyValue((string)obj);
            }
            else if (type.Equals(typeof(Vector2)))
            {
                value = new PropertyValue((Vector2)obj);
            }
            else if (type.Equals(typeof(Vector3)))
            {
                value = new PropertyValue((Vector3)obj);
            }
            else if (type.Equals(typeof(Vector4)))
            {
                value = new PropertyValue((Vector4)obj);
            }
            else if (type.Equals(typeof(Position)))
            {
                value = new PropertyValue((Position)obj);
            }
            else if (type.Equals(typeof(Position2D)))
            {
                value = new PropertyValue((Position2D)obj);
            }
            else if (type.Equals(typeof(Size)))
            {
                value = new PropertyValue((Size)obj);
            }
            else if (type.Equals(typeof(Size2D)))
            {
                value = new PropertyValue((Size2D)obj);
            }
            else if (type.Equals(typeof(Color)))
            {
                value = new PropertyValue((Color)obj);
            }
            else if (type.Equals(typeof(Rotation)))
            {
                value = new PropertyValue((Rotation)obj);
            }
            else if (type.Equals(typeof(RelativeVector2)))
            {
                value = new PropertyValue((RelativeVector2)obj);
            }
            else if (type.Equals(typeof(RelativeVector3)))
            {
                value = new PropertyValue((RelativeVector3)obj);
            }
            else if (type.Equals(typeof(RelativeVector4)))
            {
                value = new PropertyValue((RelativeVector4)obj);
            }
            else if (type.Equals(typeof(Extents)))
            {
                value = new PropertyValue((Extents)obj);
            }
            else if (type.Equals(typeof(Rectangle)))
            {
                value = new PropertyValue((Rectangle)obj);
            }
            else
            {
                throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name);
            }
            return(value);
        }
Exemple #7
0
        /// <summary>
        /// Adds a key frame.
        /// </summary>
        /// <param name="progress">A progress value between 0.0 and 1.0.</param>
        /// <param name="value">A value.</param>
        /// <since_tizen> 3 </since_tizen>
        public void Add(float progress, object value)
        {
            PropertyValue val = PropertyValue.CreateFromObject(value);

            Add(progress, val);
        }
Exemple #8
0
 /// <summary>
 /// Creates a PropertyValue value.
 /// </summary>
 /// <param name="value">A PropertyValue value.</param>
 /// <since_tizen> 3 </since_tizen>
 public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.NewPropertyValueValue(PropertyValue.getCPtr(value)), true)
 {
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Exemple #9
0
        /// <summary>
        /// Returns the style constant set for a specific key.
        /// </summary>
        /// <param name="key">The key of the constant.</param>
        /// <param name="valueOut">The value of the constant if it exists.</param>
        /// <returns></returns>
        /// <since_tizen> 3 </since_tizen>
        public bool GetConstant(string key, PropertyValue valueOut)
        {
            bool ret = Interop.StyleManager.StyleManager_GetStyleConstant(swigCPtr, key, PropertyValue.getCPtr(valueOut));

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #10
0
        /// <summary>
        /// Adds an element to the array.
        /// </summary>
        /// <param name="value">The value to add at the end of the array.</param>
        /// <since_tizen> 3 </since_tizen>
        public PropertyArray Add(PropertyValue value)
        {
            PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value)), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #11
0
        /// <summary>
        /// Adds an keyvalue to the array.
        /// This function should be first
        /// </summary>
        /// <param name="value">The value to add at the end of the array.</param>
        /// <exception cref="global::System.ArgumentNullException"> Thrown when value is null. </exception>
        public PropertyArray Add(KeyValue value)
        {
            if (null == value)
            {
                throw new global::System.ArgumentNullException(nameof(value));
            }
            PropertyArray ret = new PropertyArray(Interop.Property.ArrayAdd(SwigCPtr, PropertyValue.getCPtr(value.TrueValue)), false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Exemple #12
0
 private void UpdateColor()
 {
     propertyMap[ColorVisualProperty.MixColor] = PropertyValue.CreateWithGuard(color);
     OnPropertyChanged?.Invoke(this);
 }