Ejemplo n.º 1
0
        /// <summary>
        /// Initializes new instance of type <see cref="EditorProperty" />.
        /// </summary>
        /// <param name="name">         Name of the property. </param>
        /// <param name="description">  Description of the property. </param>
        /// <param name="defaultValue"> Default value of the property. </param>
        /// <param name="type">         Type of the property. </param>
        /// <param name="limits">       Limitations applied to the property. </param>
        /// <param name="flags">        Flags assigned to the property. </param>
        public EditorProperty(string name, string description, string defaultValue, EditorPropertyType type,
                              EditorPropertyLimits limits, int flags = 0)
            : this(name, description, defaultValue, type)
        {
            if (Math.Abs(limits.Max) < MathHelpers.ZeroTolerance &&
                Math.Abs(limits.Min) < MathHelpers.ZeroTolerance)
            {
                this.Limits.Max = Sandbox.UserInterfaceConstants.MaxSliderValue;
            }
            else
            {
                this.Limits.Max = limits.Max;
                this.Limits.Min = limits.Min;
            }

            this.Flags = flags;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes new instance of type <see cref="EditorProperty" />.
        /// </summary>
        /// <param name="name">         Name of the property. </param>
        /// <param name="description">  Description of the property. </param>
        /// <param name="defaultValue"> Default value of the property. </param>
        /// <param name="type">         Type of the property. </param>
        /// <param name="limits">       Limitations applied to the property. </param>
        /// <param name="flags">        Flags assigned to the property. </param>
        public EditorProperty(string name, string description, string defaultValue, EditorPropertyType type,
            EditorPropertyLimits limits, int flags = 0)
            : this(name, description, defaultValue, type)
        {
            if (Math.Abs(limits.Max) < MathHelpers.ZeroTolerance &&
                Math.Abs(limits.Min) < MathHelpers.ZeroTolerance)
            {
                this.Limits.Max = Sandbox.UserInterfaceConstants.MaxSliderValue;
            }
            else
            {
                this.Limits.Max = limits.Max;
                this.Limits.Min = limits.Min;
            }

            this.Flags = flags;
        }