Esempio n. 1
0
        /// <summary>
        /// splits the file using custom options
        /// </summary>
        /// <param name="sOptions"></param>
        public void Split(SplitOptions sOptions)
        {
            _options  = sOptions;
            _wordsMax = _options.WordsCount;

            ValidateFields();

            // if EgualParts - get words count for a file
            if (_options.Criterion == SplitOptions.SplitType.EqualParts)
            {
                SetWordsCount(_options.PartsCount);
                if (_wordsMax < 1)
                {
                    throw new ArgumentOutOfRangeException(string.Format(Properties.StringResource.errWordCalcOutOfRange,
                                                                        _fPath,
                                                                        _options.PartsCount));
                }
            }
            else if (_options.Criterion == SplitOptions.SplitType.SegmentNumbers)
            {
                _warnings        = new List <Warning>();
                _segmentIDsFound = new List <string>();
            }

            DoSplit();

            if (_options.Criterion == SplitOptions.SplitType.SegmentNumbers)
            {
                CheckFoundSegments();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// splits the file using default options (word-count, 1000)
        /// </summary>
        public void Split()
        {
            _options  = new SplitOptions();
            _wordsMax = _options.WordsCount;

            ValidateFields();

            DoSplit();
        }