Example #1
0
		public void DefineIconResource(AssemblyBuilder/*!*/ builder, string/*!*/ tempFile)
		{
			if (builder == null)
				throw new ArgumentNullException("builder");
			if (tempFile == null)
				throw new ArgumentNullException("tempFile");

			MemoryStream mem = new MemoryStream();
			WriteToResFile(mem);
			byte[] b = mem.ToArray();
			//builder.DefineUnmanagedResource(b);

			using (FileStream fs = new FileStream(tempFile, FileMode.Create))
			{
				WriteToResFile(fs);
			}

			builder.DefineUnmanagedResource(tempFile);

			//			fs = new FileStream("sample2.res", FileMode.Open);
			//			byte[] q = new byte[fs.Length];
			//			fs.Read(q, 0, q.Length);
			//			builder.DefineUnmanagedResource(q);
		}