Beispiel #1
0
        public override HexBufferFile[] CreateFiles(params BufferFileOptions[] options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }
            var newFiles = new HexBufferFileImpl[options.Length];

            for (int i = 0; i < newFiles.Length; i++)
            {
                var opts = options[i];
                if (opts.IsDefault)
                {
                    throw new ArgumentException();
                }
                if (!Span.Contains(opts.Span))
                {
                    throw new ArgumentOutOfRangeException();
                }
                newFiles[i] = new HexBufferFileImpl(this, structureProviderFactories, bufferFileHeadersProviderFactories, Buffer, opts.Span, opts.Name, opts.Filename, opts.Tags);
            }
            files.Add(newFiles.Select(a => new SpanData <HexBufferFileImpl>(a.Span, a)));
            BufferFilesAdded?.Invoke(this, new BufferFilesAddedEventArgs(newFiles));
            return(newFiles);
        }