/// <summary>
 /// Draw the field only if a condition is met.
 /// </summary>
 /// <param name="comparedPropertyName">The name of the property that is being compared (case sensitive).</param>
 /// <param name="comparedValue">The value that property is being compared to.</param>
 /// <param name="comparisonType">The type of comparison the values will be compared by.</param>
 /// <param name="disablingType">The type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.Hide.</param>
 public DrawIfAttribute(string comparedPropertyName, object comparedValue, ComparisonType comparisonType, DisablingType disablingType = DisablingType.Hide)
 {
     ComparedPropertyName = comparedPropertyName;
     ComparedValue        = comparedValue;
     ComparisonType       = comparisonType;
     DisablingType        = disablingType;
 }
示例#2
0
 /// <summary>
 /// Only draws the field only if a condition is met. Supports enum and bools.
 /// </summary>
 /// <param name="pComparedPropertyName">The name of the property that is being compared (case sensitive).</param>
 /// <param name="pComparedValue">The value the property is being compared to.</param>
 /// <param name="pDisablingType">The type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.DontDraw.</param>
 public DrawIfAttribute(string pComparedPropertyName, object pComparedValue, ComparisonType pComparisonType = ComparisonType.Equals, DisablingType pDisablingType = DisablingType.DontDraw)
 {
     ComparedPropertyName = pComparedPropertyName;
     ComparedValue        = pComparedValue;
     Comparison           = pComparisonType;
     DisablingType        = pDisablingType;
 }
示例#3
0
 /// <summary>
 /// Only draws the field only if a condition is met.
 /// </summary>
 /// <param name="comparedPropertyName">The name of the property that is being compared (case sensitive).</param>
 /// <param name="comparedValue">The value the property is being compared to.</param>
 /// <param name="comparisonType">The type of comperison the values will be compared by.</param>
 /// <param name="disablingType">The type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.DontDraw.</param>
 public DrawIfAttribute(string comparedPropertyName, object comparedValue, ComparisonType comparisonType, DisablingType disablingType = DisablingType.DontDraw)
 {
     this.comparedPropertyName = comparedPropertyName;
     this.comparedValue        = comparedValue;
     this.comparisonType       = comparisonType;
     this.disablingType        = disablingType;
 }
示例#4
0
 public DrawIfAttribute(string name, Type type, params object[] values)
 {
     this.name           = name;
     this.type           = type;
     this.comparisonType = ComparisonType.Or;
     this.disablingType  = DisablingType.DontDraw;
     this.values         = values;
 }
示例#5
0
 public DrawIfAttribute(string comparedPropertyName, DisablingType disablingType = DisablingType.DontDraw)
 {
     m_CompareList = new List <CompareData>()
     {
         new CompareData(comparedPropertyName, null)
     };
     m_DisablingType = disablingType;
 }
示例#6
0
 public DrawIfAttribute(string name, Type type, object value,
                        ComparisonType comparisonType = ComparisonType.Equals, DisablingType disablingType = DisablingType.DontDraw)
 {
     this.name           = name;
     this.type           = type;
     this.value          = value;
     this.comparisonType = comparisonType;
     this.disablingType  = disablingType;
 }
示例#7
0
        public DrawIfAttribute(string comparedPropertyName, DisablingType disablingType, params object[] comparedValue)
        {
            m_CompareList = new List <CompareData>(comparedValue.Length);
            foreach (var value in comparedValue)
            {
                m_CompareList.Add(new CompareData(comparedPropertyName, value));
            }

            m_DisablingType = disablingType;
        }
示例#8
0
 /// <summary>
 /// Only draws the field only if a condition is met. Supports enum and bools.
 /// </summary>
 /// <param name="comparedPropertyName">The name of the property that is being compared (case sensitive).</param>
 /// <param name="comparedValue">The value the property is being compared to.</param>
 /// <param name="disablingType">The type of disabling that should happen if the condition is NOT met. Defaulted to DisablingType.DontDraw.</param>
 public DrawIfAttribute(string comparedPropertyName, object comparedValue, DisablingType disablingType = DisablingType.DontDraw)
 {
     ComparedPropertyName = comparedPropertyName;
     ComparedValue        = comparedValue;
     DisablingMode        = disablingType;
 }
示例#9
0
 public DrawIfAttribute(DisablingType disablingType, params CompareData[] comparedValue)
 {
     m_CompareList   = new List <CompareData>(comparedValue);
     m_DisablingType = disablingType;
 }
示例#10
0
 public ShowIfAttribute(string comparedPropertyName, object comparedValue, DisablingType disablingType = DisablingType.Disabled)
 {
     this.comparedPropertyName = comparedPropertyName;
     this.comparedValue        = comparedValue;
     this.disablingType        = disablingType;
 }