コード例 #1
0
        public ModuleSection(L5KReadStream readings)
            : base(readings, readings.ModuleTypeSecStart, readings.ModuleTypeSecEnd)
        {
            _childrenName = "$NoName";

            _modules = new List <Module>();//This separates the content in Modules
            var moduleIndexes = _content.FindAllIndex(x => x.StartsWith(" " + _initializer) && !x.Contains(_childrenName));

            //This section reads each Index that has been found and builds a Module object for each
            for (var i = 0; i < moduleIndexes.Count; i++)
            {
                var index = moduleIndexes[i];
                if (i + 1 != moduleIndexes.Count)
                {
                    var count = moduleIndexes[i + 1] - index;
                    _modules.Add(new Module(_content.GetRange(index, count)));
                }
                else
                {
                    var count = _content.Count - index;
                    _modules.Add(new Module(_content.GetRange(index, count)));
                }
            }
            _needed = new List <Module>();
        }
コード例 #2
0
 public L5Ksection(L5KReadStream readings, int startSec, int endSec)
 {
     _content = new List <string>();
     for (int i = startSec; i <= endSec; i++)
     {
         _content.Add(readings[i]);
     }
     //_content.FindAllIndex(x => x.StartsWith(_initializer));//probably will have to use this in a
     //child class
     _projectName = readings.ProjectName;
 }
コード例 #3
0
ファイル: TagSection.cs プロジェクト: memo1195/L5K
 public TagSection(L5KReadStream readings)
     : base(readings, readings.TagSecStart, readings.TagSecEnd)
 {
     _needed          = new HashSet <Tag>();
     _initializer     = readings.TagInit;
     _localTagSection = false;
     //debbuging
     //foreach(var line in _content)
     //{
     //    Console.WriteLine(line);
     //}
 }
コード例 #4
0
ファイル: DataTypeSection.cs プロジェクト: memo1195/L5K
        public DataTypeSection(L5KReadStream readings)
            : base(readings, readings.DataTypeSecStart, readings.DataTypeSecEnd)
        {
            var datatypeIndexes = _content.FindAllIndex(x => x.StartsWith(" " + _initializer));//probably need to change this

            _datatypes = new Dictionary <string, int[]>();
            for (var i = 0; i < datatypeIndexes.Count; i++)
            {
                var index = datatypeIndexes[i];
                if (i + 1 != datatypeIndexes.Count)
                {
                    _datatypes.Add(_GetNameBetweenElements(_content[index], _initializer.Length + 1, ' ')
                                   , new int[] { index, datatypeIndexes[i + 1] });
                }
                else
                {
                    _datatypes.Add(_GetNameBetweenElements(_content[index], _initializer.Length + 1, ' ')
                                   , new int[] { index, _content.Count - 1 });
                }
            }
            _needed = new HashSet <string>();
        }
コード例 #5
0
ファイル: IntroSection.cs プロジェクト: memo1195/L5K
 public IntroSection(L5KReadStream readings) :
     base(readings, readings.BegginingSecStart, readings.BegginingSecEnd)
 {
 }
コード例 #6
0
 public ControllerSection(L5KReadStream readings)
     : base(readings, readings.ControllerSecStart, readings.ControllerSecEnd)
 {
     _initializer    = readings.ControllerInit;
     _mainController = new Controller(_content);
 }