ResolveStreamEventArgs is used for applying a patch.
It is the responsibility to provide a valid stream.
Inheritance: System.EventArgs, IDisposable
コード例 #1
0
 private MpqArchive()
 {
     this.syncRoot = new object();
     this.resolveStreamEventArgs = new ResolveStreamEventArgs();
     this.fileCollection         = new MpqFileCollection(this);
     this.listFileParsed         = false;
 }
コード例 #2
0
ファイル: MpqFileSystem.cs プロジェクト: jhurliman/d3research
        private void ResolveBaseFile(object sender, ResolveStreamEventArgs e)
        {
            var file = sender as MpqFile;

            if (file == null)
            {
                throw new InvalidOperationException();
            }

            bool archiveFound = false;

            foreach (var archive in archiveList)
            {
                if (!archiveFound)
                {
                    if (archive == file.Archive)
                    {
                        archiveFound = true;
                    }
                    continue;
                }

                var foundFile = archive.FindFile(file.Name);

                if (foundFile != null)
                {
                    e.Stream = foundFile.Open();
                    return;
                }
            }
        }