예제 #1
0
        public void AddFile(File file)
        {
            if (file == null)
            {
                throw new ArgumentNullException("File can not be null!");
            }

            if (this.files.Length == this.fileIndex)
            {
                ResizeFileContainer();
            }

            this.files[fileIndex] = file;
            this.fileIndex++;
        }
예제 #2
0
        private void ResizeFileContainer()
        {
            var doubleSize = this.files.Length * 2;
            var doubleSizedFileContainer = new File[doubleSize];
            for (int i = 0, len = this.files.Length; i < len; i++)
            {
                doubleSizedFileContainer[i] = this.files[i];
            }

            this.files = doubleSizedFileContainer;
        }