void EmbedResourceFile(string name, string fileName, ResourceAttributes attribute) { if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; try { FileStream s = new FileStream(fileName, FileMode.Open, FileAccess.Read); long len = s.Length; resources [p].data = new byte [len]; s.Read(resources [p].data, 0, (int)len); s.Close(); } catch { } }
private void AddResourceFile(string name, string fileName, ResourceAttributes attribute, bool fileNeedsToExists) { check_name_and_filename(name, fileName, fileNeedsToExists); // Resource files are created/searched under the assembly storage // directory if (dir != null) { fileName = Path.Combine(dir, fileName); } if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].filename = fileName; resources [p].attrs = attribute; }
internal void EmbedResource(string name, byte[] blob, ResourceAttributes attribute) { if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; resources [p].data = blob; }
public IResourceWriter DefineResource(string name, string description, ResourceAttributes attribute) { if (name == null) { throw new ArgumentNullException("name"); } if (name == String.Empty) { throw new ArgumentException("name cannot be empty"); } if (transient) { throw new InvalidOperationException("The module is transient"); } if (!assemblyb.IsSave) { throw new InvalidOperationException("The assembly is transient"); } ResourceWriter writer = new ResourceWriter(new MemoryStream()); if (resource_writers == null) { resource_writers = new Hashtable(); } resource_writers [name] = writer; // The data is filled out later if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; return(writer); }
public void DefineManifestResource(string name, Stream stream, ResourceAttributes attribute) { if (name == null) { throw new ArgumentNullException("name"); } if (name == String.Empty) { throw new ArgumentException("name cannot be empty"); } if (stream == null) { throw new ArgumentNullException("stream"); } if (transient) { throw new InvalidOperationException("The module is transient"); } if (!assemblyb.IsSave) { throw new InvalidOperationException("The assembly is transient"); } if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; resources [p].stream = stream; }
void EmbedResourceFile (string name, string fileName, ResourceAttributes attribute) { if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; try { FileStream s = new FileStream (fileName, FileMode.Open, FileAccess.Read); long len = s.Length; resources [p].data = new byte [len]; s.Read (resources [p].data, 0, (int)len); s.Close (); } catch { } }
private void AddResourceFile (string name, string fileName, ResourceAttributes attribute, bool fileNeedsToExists) { check_name_and_filename (name, fileName, fileNeedsToExists); // Resource files are created/searched under the assembly storage // directory if (dir != null) fileName = Path.Combine (dir, fileName); if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].filename = fileName; resources [p].attrs = attribute; }
public void DefineManifestResource (string name, Stream stream, ResourceAttributes attribute) { if (name == null) throw new ArgumentNullException ("name"); if (name == String.Empty) throw new ArgumentException ("name cannot be empty"); if (stream == null) throw new ArgumentNullException ("stream"); if (transient) throw new InvalidOperationException ("The module is transient"); if (!assemblyb.IsSave) throw new InvalidOperationException ("The assembly is transient"); if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; resources [p].stream = stream; }
public IResourceWriter DefineResource (string name, string description, ResourceAttributes attribute) { if (name == null) throw new ArgumentNullException ("name"); if (name == String.Empty) throw new ArgumentException ("name cannot be empty"); if (transient) throw new InvalidOperationException ("The module is transient"); if (!assemblyb.IsSave) throw new InvalidOperationException ("The assembly is transient"); ResourceWriter writer = new ResourceWriter (new MemoryStream ()); if (resource_writers == null) resource_writers = new Hashtable (); resource_writers [name] = writer; // The data is filled out later if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; return writer; }
internal void EmbedResource (string name, byte[] blob, ResourceAttributes attribute) { if (resources != null) { MonoResource[] new_r = new MonoResource [resources.Length + 1]; System.Array.Copy(resources, new_r, resources.Length); resources = new_r; } else { resources = new MonoResource [1]; } int p = resources.Length - 1; resources [p].name = name; resources [p].attrs = attribute; resources [p].data = blob; }