public CompilerResults CompileAssemblyFromDomBatch(CompilerParameters options, CodeCompileUnit[] compilationUnits) { Setup(options, ContainsLocalFunctions(compilationUnits)); foreach (var Unit in compilationUnits) { foreach (CodeAttributeDeclaration attribute in Unit.AssemblyCustomAttributes) { EmitAttribute(ABuilder, attribute); } EmitNamespace(ABuilder, Unit.Namespaces[0]); } ABuilder.SetEntryPoint(EntryPoint, PEFileKinds.WindowApplication); Save(); var results = new CompilerResults(new TempFileCollection()); string output = options.OutputAssembly; if (options.GenerateInMemory) { results.TempFiles.AddFile(output, false); byte[] raw = File.ReadAllBytes(output); results.CompiledAssembly = Assembly.Load(raw); File.Delete(output); } else { results.PathToAssembly = Path.GetFullPath(output); } return(results); }
public void Run() { ABuilder ab = new ABuilder(); ab .AddField1() .AddField2(); ConcreteProductA a = ab.Build(); }
public Actor Construct(ABuilder builder) { builder.BuildType(); builder.BuildGender(); builder.BuildFace(); builder.BuildCostume(); builder.BuildHairStyle(); Actor actor = builder.CreateActor(); return(actor); }
public Actor Construct(ABuilder builder) { builder.BuildType(); builder.BuildGender(); builder.BuildFace(); builder.BuildCostume(); if (!builder.IsBareHeaded()) { builder.BuildHairStyle(); } Actor actor = builder.CreateActor(); return(actor); }
static void Main(string[] args) { var container = new Container(); var obj = ABuilder.Build(container); var obj1 = container.GetByName("obj1"); }
public static ABuilder With(this ABuilder builder, Action <ABuilder> action) { action(builder); return(builder); }