c# Programming Glossary: attribs
How to have userfriendly names for enumerations? [duplicate] http://stackoverflow.com/questions/1331487/how-to-have-userfriendly-names-for-enumerations field value.GetType .GetField value.ToString object attribs field.GetCustomAttributes typeof DescriptionAttribute true if.. typeof DescriptionAttribute true if attribs.Length 0 return DescriptionAttribute attribs 0 .Description.. true if attribs.Length 0 return DescriptionAttribute attribs 0 .Description return string.Empty Used like so MyEnum val MyEnum.Black..
Retrieve AssemblyCompanyName from Class Library http://stackoverflow.com/questions/1626801/retrieve-assemblycompanyname-from-class-library Assembly currentAssem typeof CurrentClass .Assembly object attribs currentAssem.GetCustomAttributes typeof AssemblyCompanyAttribute.. typeof AssemblyCompanyAttribute true if attribs.Length 0 string company AssemblyCompanyAttribute attribs 0 .Company..
Reflection. What can we achieve using it? http://stackoverflow.com/questions/1897712/reflection-what-can-we-achieve-using-it type.GetField shapeName.ToString ShapeDescriptionAttribute attribs fieldInfo.GetCustomAttributes typeof ShapeDescriptionAttribute.. false as ShapeDescriptionAttribute return attribs null attribs.Length 0 attribs 0 new ShapeDescriptionAttribute.. false as ShapeDescriptionAttribute return attribs null attribs.Length 0 attribs 0 new ShapeDescriptionAttribute ShapeType.NotSet..
Enforce Attribute Decoration of Classes/Methods http://stackoverflow.com/questions/19454/enforce-attribute-decoration-of-classes-methods PropertyInfo property in type.GetProperties object attribs property.GetCustomAttributes typeof XmlElementAttribute false.. typeof XmlElementAttribute false Assert.IsTrue attribs.Count 0 Missing XmlElementAttribute on property property.Name..
Extending Enums, Overkill? http://stackoverflow.com/questions/3015893/extending-enums-overkill Get the stringvalue attributes StringValueAttribute attribs fieldInfo.GetCustomAttributes typeof StringValueAttribute false.. Return the first if there was a match. return attribs.Length 0 attribs 0 .StringValue null public static string GetDisplayText.. the first if there was a match. return attribs.Length 0 attribs 0 .StringValue null public static string GetDisplayText this..
Inlining CSS in C# http://stackoverflow.com/questions/3679213/inlining-css-in-c-sharp trunk src css2xpath.js var regexReplaces new add @ for attribs new RegexReplace Regex new Regex @ ^ ~ ^ ^ RegexOptions.Multiline..
Minimum C# code to extract from .CAB archives or InfoPath XSN files, in memory http://stackoverflow.com/questions/8533105/minimum-c-sharp-code-to-extract-from-cab-archives-or-infopath-xsn-files-in-mem IntPtr hf public short date public short time public short attribs public short setID public short iCabinet public short iFolder..
|