Example #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));
 }
Example #2
0
 internal FolderViewModel(
     string name, int depth, IEnumerable <EntryParserModel> entries, IIdxManager idxManager) :
     base(name, EntryParserModel.GetEntries(entries.ToList(), depth, idxManager))
 {
     _idxManager   = idxManager;
     ExportCommand = new RelayCommand(_ =>
     {
         FileDialog.OnFolder(Extract);
     });
 }
Example #3
0
 internal FolderViewModel(
     string name, int depth, IEnumerable <EntryParserModel> entries, IIdxManager idxManager) :
     base(name, EntryParserModel.GetEntries(entries.ToList(), depth, idxManager))
 {
     _idxManager   = idxManager;
     ExportCommand = new RelayCommand(_ =>
                                      FileDialog.OnFolder(x =>
                                                          Task.Run(() =>
                                                                   ExtractProcessor.ShowProgress(progress =>
                                                                                                 Extract(x, progress)))));
 }
Example #4
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));
            }
        }
Example #5
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)))));
 }