private void LoadContentByCurrentKey(string currentKey) { var a = UnhandledEntries.ToList(); UnhandledEntries = a; NewText = FindStringByKey(currentKey); }
public void InitAdd() { SumOfNewEntries = documentComparer.AddList.Count(); HandledNewEntries = 0; UnhandledEntries = documentComparer.AddList .Select(p => p.Split(new string[] { "=>" }, StringSplitOptions.None).Last()).ToList(); CurrentKey = UnhandledEntries.First(); LoadContentByCurrentKey(documentComparer.AddList.First()); }
public AddViewModel(IFileParser parser, IDocumentComparer comparer) { this.fileParser = parser; this.documentComparer = comparer; SumOfNewEntries = documentComparer.ConflictList.Count(); HandledNewEntries = 0; UnhandledEntries = documentComparer.AddList .Select(p => p.Split(new string[] { "=>" }, StringSplitOptions.None).Last()).ToList(); CurrentKey = UnhandledEntries.First(); InitAdd(); }
private void ContinueProcessing() { var nextkey = UnhandledEntries.FirstOrDefault(); if (nextkey != null) { CurrentKey = nextkey; LoadContentByCurrentKey(nextkey); HandledNewEntries++; } else { MessageBox.Show($"File saved to project folder, file name is{documentComparer.SaveResultDict()}"); Environment.Exit(-1); } }
private void HandleCurrentEntry() { //if any text exists in the input pane, //we would ignore whether the new item was selected, just commit changes made in edit pane. var parser = ServiceLocator.Current.GetInstance <IFileParser>(); var kvPairs = parser.ParseLinesToKVPair(NewText); foreach (var kv in kvPairs) { if (kv.Key == null) { continue; } documentComparer.ResultDict.Add(kv.Key, kv.Value); } UnhandledEntries.Remove(CurrentKey); }
private void DiscardCurrentEntry() { UnhandledEntries.Remove(CurrentKey); }