Ejemplo n.º 1
0
 public RootViewModel(string name, List <Idx.Entry> entries, IIdxManager idxManager) :
     base(name, EntryParserModel.GetChildren(entries, idxManager))
 {
     _idxManager           = idxManager;
     ExportCommand         = new RelayCommand(_ => FileDialog.OnFolder(Extract));
     ExportAndMergeCommand = new RelayCommand(_ => FileDialog.OnFolder(ExtractAndMerge));
 }
Ejemplo n.º 2
0
        private static IEnumerable <EntryViewModel> GetChildren(string idxName, IIdxManager idxManager)
        {
            var idxStream = idxManager.OpenFileFromIdx(idxName);

            if (idxStream == null)
            {
                return(new EntryViewModel[0]);
            }

            using (idxStream)
            {
                return(EntryParserModel.GetChildren(Idx.Read(idxStream), idxManager));
            }
        }
Ejemplo n.º 3
0
 public RootViewModel(string name, List <Idx.Entry> entries, IIdxManager idxManager) :
     base(name, EntryParserModel.GetChildren(entries, idxManager))
 {
     _idxManager   = idxManager;
     ExportCommand = new RelayCommand(_ =>
                                      FileDialog.OnFolder(x =>
                                                          Task.Run(() =>
                                                                   ExtractProcessor.ShowProgress(progress =>
                                                                                                 Extract(x, progress)))));
     ExportAndMergeCommand = new RelayCommand(_ =>
                                              FileDialog.OnFolder(x =>
                                                                  Task.Run(() =>
                                                                           ExtractProcessor.ShowProgress(progress =>
                                                                                                         ExtractAndMerge(x, progress)))));
 }