Пример #1
0
 internal PluginFileOutput(string filePath, PluginFile plugin)
 {
     this.filePath = filePath;
     this.plugin   = plugin;
     fileStream    = File.OpenWrite(filePath);
     fileWriter    = new BinaryWriter(fileStream);
 }
Пример #2
0
 public void Add(PluginFile file, MainRecord record)
 {
     if (!_plugins.ContainsKey(file))
     {
         AddMap(file);
     }
     _plugins[file].Add(record);
 }
Пример #3
0
        internal PluginFileSource(string filePath, PluginFile plugin)
        {
            this.filePath = filePath;
            this.plugin   = plugin;
            fileInfo      = new FileInfo(filePath);
            plugin.source = this;
            var baseStream = new FileStream(
                filePath, FileMode.Open,
                FileAccess.Read, FileShare.ReadWrite
                );

            file = MemoryMappedFile.CreateFromFile(
                baseStream, null, 0, MemoryMappedFileAccess.Read,
                HandleInheritability.None, false
                );
            fileStream = file.CreateViewStream(
                0, 0, MemoryMappedFileAccess.Read
                );
            fileReader = new BinaryReader(stream);
        }
Пример #4
0
 public FormIdMap GetMap(PluginFile file)
 {
     return(_plugins[file]);
 }
Пример #5
0
 public void AddMap(PluginFile file)
 {
     _plugins[file] = new FormIdMap();
 }