System.Reflection.CustomAttributeData.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string ToString()
        {
            string ctorArgs = "";
            for (int i = 0; i < ConstructorArguments.Count; i ++)
                ctorArgs += String.Format(CultureInfo.CurrentCulture, i == 0 ? "{0}" : ", {0}", ConstructorArguments[i]);

            string namedArgs = "";
            for (int i = 0; i < NamedArguments.Count; i ++)
                namedArgs += String.Format(CultureInfo.CurrentCulture, i == 0 && ctorArgs.Length == 0 ? "{0}" : ", {0}", NamedArguments[i]);

            return String.Format(CultureInfo.CurrentCulture, "[{0}({1}{2})]", Constructor.DeclaringType.FullName, ctorArgs, namedArgs);
        }
        public override int GetHashCode()

Usage Example

Esempio n. 1
0
 public static string Translate(Attribute a, CustomAttributeData d, Type context)
 {
     if (a is EcoElementAttribute)
         return TranslateEcoElementAttribute((EcoElementAttribute)a);
     else
         return d.ToString();
 }
All Usage Examples Of System.Reflection.CustomAttributeData::ToString