Example #1
0
 /// <summary>
 /// Arguments for Property
 /// </summary>
 /// <param name="args">Other Arguments for Property</param>
 public PropertyArgsAttribute(PropertyArgsAttribute args)
 {
     this.tip         = args.tip;
     this.label       = args.label;
     this.lines       = args.lines;
     this.noLabel     = args.noLabel;
     this.callbacks   = args.callbacks;
     this.hideIfEmpty = args.hideIfEmpty;
 }
Example #2
0
    private void setArgs(MemberInfo propertyInfo = null)
    {
        if (propertyInfo == null)
        {
            propertyInfo = this.fieldInfo;
        }
        PropertyArgsAttribute args = new PropertyArgsAttribute();

        object[] propertyAttributes = propertyInfo.GetCustomAttributes(typeof(PropertyArgsAttribute), true);
        foreach (object propertyAttribute in propertyAttributes)
        {
            PropertyArgsAttribute a = (PropertyArgsAttribute)propertyAttribute;
            if (!string.IsNullOrEmpty(a.tip))
            {
                args.tip = a.tip;
            }

            if (!string.IsNullOrEmpty(a.label))
            {
                args.label = a.label;
            }

            if (a.lines > 0)
            {
                args.lines = a.lines;
            }

            args.noLabel = a.noLabel;
            if (a.callbacks != null)
            {
                args.callbacks = args.callbacks == null ? a.callbacks : args.callbacks.Concat(a.callbacks).ToArray();
            }
            if (!string.IsNullOrEmpty(a.hideIfEmpty))
            {
                args.hideIfEmpty = a.hideIfEmpty;
            }
        }
        _args = args;
    }