Exemplo n.º 1
0
 public StringCollection GetElementsFrom(string line, string pattern) {
     StringCollection stringCollection = new ParserTextToStrings().Split(line, pattern);
     return stringCollection;
 }
Exemplo n.º 2
0
        public StoredObject Load(string fileName) {
            string fullFilePath = GetFullFilePath(fileName);
            if (!new FileInfo(fullFilePath).Exists)
                Save(fileName);
            ClearProperties();
            using (StreamReader reader = new StreamReader(fullFilePath, Encoding.Unicode)) {
                StringCollection stringCollection = new ParserTextToStrings().Split(reader.ReadToEnd(),
                                                                                    ELEMENTS_LINE_START_IDENTIFIER,
                                                                                    ELEMENTS_REGEX_OPTION_PATTERN);
//                ListLoader listLoader = new ListLoader();
                foreach (string line in stringCollection) {
                    StringCollection elementsList = GetElementsFrom(line, ELEMENTS_SPLITTER);
                    string typeName = ExtractObjectTypeNameFrom(elementsList);
//                    if(typeName.Equals(LIST_TYPE_NAME)){
//                        listLoader.StartLoadingListFor(ExtractExpectedListCountFrom(elementsList));
//                        continue;
//                    }
//                    if(listLoader.IsLoadingList) {
//                        
//                    }
//                        
                    AddObjectFromLine(elementsList, typeName);
                }
            }
            return this;
        }