Exemplo n.º 1
0
        private void LoadContentByCurrentKey(string currentKey)
        {
            var a = UnhandledEntries.ToList();

            UnhandledEntries = a;
            NewText          = FindStringByKey(currentKey);
        }
Exemplo n.º 2
0
 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());
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
        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);
            }
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 private void DiscardCurrentEntry()
 {
     UnhandledEntries.Remove(CurrentKey);
 }