Esempio n. 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++;
        }
Esempio n. 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;
        }