public void Write(string fileName, WriterParameters parameters) { using (Stream fileStream = ModuleDefinition.GetFileStream(fileName, FileMode.Create, FileAccess.ReadWrite, FileShare.None)) { this.Write(fileStream, parameters); } }
public static ModuleDefinition ReadModule(string fileName, ReaderParameters parameters) { ModuleDefinition moduleDefinition; using (Stream fileStream = ModuleDefinition.GetFileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)) { moduleDefinition = ModuleDefinition.ReadModule(fileStream, parameters); } return(moduleDefinition); }