コード例 #1
0
        protected CodeRegion(String regionName, Words sourceCode)
        {
            _isEmpty        = true;
            _name           = regionName;
            _lines          = sourceCode;
            _startLineIndex = _lines.IndexOf(s => s.Contains("#region {0}".FormatX(_name), StringComparison.OrdinalIgnoreCase));
            if (_startLineIndex > 0)
            {
                _endLineIndex = _lines.IndexOf(s => s.Contains("#endregion", StringComparison.OrdinalIgnoreCase), _startLineIndex + 1);

                if (_endLineIndex > _startLineIndex)
                {
                    _lines   = _lines.GetWords(_startLineIndex + 1, LineIndexCount - 1);
                    _isEmpty = _lines.Count == 0;
                }
            }
        }
コード例 #2
0
        public static Words GetWords(String value, String delimiter, Int32 startIndex, Int32?count = null)
        {
            var words = new Words(value, delimiter);

            return(words.GetWords(startIndex, count));
        }