Ejemplo n.º 1
0
        protected PhpAssemblyBuilder(PhpAssembly /*!*/ assembly, AssemblyName assemblyName, string moduleName,
                                     string directory, string fileName, AssemblyKinds kind, ICollection <ResourceFileReference> resources, bool debug,
                                     bool force32bit, bool saveOnlyAssembly, Win32IconResource icon)
            : base(assembly)
        {
            this.kind       = kind;
            this.debuggable = debug;
            this.Force32Bit = force32bit;
            this.fileName   = fileName;
            this.directory  = directory;
            this.icon       = icon;
            this.resources  = resources;

#if SILVERLIGHT
            AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
            ModuleBuilder   module_builder   = (ModuleBuilder)assembly_builder.ManifestModule;         // SILVERLIGHT: hack? http://silverlight.org/forums/p/1444/3919.aspx#3919
#else
            AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, saveOnlyAssembly ? AssemblyBuilderAccess.Save : AssemblyBuilderAccess.RunAndSave, directory);
            ModuleBuilder   module_builder   = assembly_builder.DefineDynamicModule(moduleName, fileName, debug);
#endif
            DefineGlobalType(module_builder);
            assembly.WriteUp(module_builder, Path.Combine(directory, fileName));             // TODO: Combine can be avoided (pass path instead of directory + fileName)
        }
Ejemplo n.º 2
0
		protected PhpAssemblyBuilder(PhpAssembly/*!*/ assembly, AssemblyName assemblyName, string moduleName,
            string directory, string fileName, AssemblyKinds kind, ICollection<ResourceFileReference> resources, bool debug,
            bool force32bit, bool saveOnlyAssembly, Win32IconResource icon)
			: base(assembly)
		{
			this.kind = kind;
			this.debuggable = debug;
            this.Force32Bit = force32bit;
			this.fileName = fileName;
			this.directory = directory;
			this.icon = icon;
            this.resources = resources;

#if SILVERLIGHT
			AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
			ModuleBuilder module_builder = (ModuleBuilder)assembly_builder.ManifestModule; // SILVERLIGHT: hack? http://silverlight.org/forums/p/1444/3919.aspx#3919
#else

            AssemblyBuilder assembly_builder = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, saveOnlyAssembly ? AssemblyBuilderAccess.Save : AssemblyBuilderAccess.RunAndSave, directory);
			ModuleBuilder module_builder = assembly_builder.DefineDynamicModule(moduleName, fileName, debug);
#endif
			DefineGlobalType(module_builder);
			assembly.WriteUp(module_builder, Path.Combine(directory, fileName)); // TODO: Combine can be avoided (pass path instead of directory + fileName)
		}
Ejemplo n.º 3
0
 /// <summary>
 /// Used by the builder.
 /// </summary>
 protected PhpModule(CompilationUnitBase/*!*/ compilationUnit, PhpAssembly/*!*/ assembly)
     : base(assembly)
 {
     this._compilationUnit = compilationUnit;
 }
Ejemplo n.º 4
0
 public PhpAssemblyBuilderBase(PhpAssembly /*!*/ assembly)
 {
     this.assembly = assembly;
 }
Ejemplo n.º 5
0
		public PhpAssemblyBuilderBase(PhpAssembly/*!*/ assembly)
		{
			this.assembly = assembly;
		}