Esempio n. 1
0
        public static CodeBlockBuilder AttributeMethodImpl(this CodeBlockBuilder builder, MethodImplOptions options)
        {
            var flags        = Enum.GetValues(typeof(MethodImplOptions)).Cast <Enum>().Where(options.HasFlag);
            var fullFlagName = flags.Select(x => $"System.Runtime.CompilerServices.MethodImplOptions.{x}");

            return(builder.Attribute($"[System.Runtime.CompilerServices.MethodImpl({string.Join(", ", fullFlagName)})]"));
        }
Esempio n. 2
0
 public static CodeBlockBuilder AttributeGenerated(this CodeBlockBuilder builder, Assembly assebmly) => builder.Attribute($"[System.CodeDom.Compiler.GeneratedCode(\"{assebmly.GetName().Name}\", \"{assebmly.GetName().Version}\")]");
Esempio n. 3
0
 public static CodeBlockBuilder AttributeHideEditor(this CodeBlockBuilder builder) => builder.Attribute("[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]");