Ejemplo 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)})]"));
        }
Ejemplo n.º 2
0
 public static CodeBlockBuilder AttributeGenerated(this CodeBlockBuilder builder, Assembly assebmly) => builder.Attribute($"[System.CodeDom.Compiler.GeneratedCode(\"{assebmly.GetName().Name}\", \"{assebmly.GetName().Version}\")]");
Ejemplo n.º 3
0
 public static CodeBlockBuilder AttributeHideEditor(this CodeBlockBuilder builder) => builder.Attribute("[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]");