internal static FileItemViewModel CreateFileItemVM(FileItemModel fileItemModel,
                                                    IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
                                                    IConfiguration configuration,
                                                    IExplorerTreeItemViewModel parentItemVM)
 {
     return(new FileItemViewModel(fileItemModel, explorerTreeItemModelViewModelParser, configuration, parentItemVM));
 }
 internal static DriveItemViewModel CreateDriveItemVM
     (DriveItemModel driveItemModel,
     IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
     IConfiguration configuration)
 {
     return(new DriveItemViewModel(driveItemModel, explorerTreeItemModelViewModelParser, configuration));
 }
 internal static DirectoryItemViewModel CreateDirectoryItemVM
     (DirectoryItemModel directoryItemModel,
     IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
     IConfiguration configuration,
     IExplorerTreeItemViewModel parentItemVM)
 {
     return(new DirectoryItemViewModel(directoryItemModel, explorerTreeItemModelViewModelParser, configuration, parentItemVM));
 }
 private static DriveItemViewModel CreateDriveItemViewModel(
     FakeDriveItemModel fakeDriveItemModel = null,
     IExplorerTreeItemModelViewModelParser fakeExplorerTreeItemModelViewModelParser = null,
     IConfiguration fakeConfiguration          = null,
     IExplorerTreeItemViewModel fakeParentItem = null)
 {
     fakeDriveItemModel = fakeDriveItemModel ?? new FakeDriveItemModel();
     fakeExplorerTreeItemModelViewModelParser = fakeExplorerTreeItemModelViewModelParser ?? Substitute.For <IExplorerTreeItemModelViewModelParser>();
     fakeConfiguration = fakeConfiguration ?? CreateConfiguration();
     return(new DriveItemViewModel(fakeDriveItemModel, fakeExplorerTreeItemModelViewModelParser, fakeConfiguration));
 }
Beispiel #5
0
 /// <summary>
 ///
 /// <para>
 /// Exclusively use <see cref="ExplorerTreeItemViewModelsFactory"/>
 /// to instantiate this class.
 /// -> Except for test purposes.
 /// </para>
 /// </summary>
 internal DriveItemViewModel(DriveItemModel driveItemModel,
                             IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
                             IConfiguration configuration)
 {
     this.Configuration    = configuration;
     this.ChildTreeItemVMs = new ObservableCollection <AExplorerTreeChildItemViewModel>();
     this.DriveType        = driveItemModel.DriveType;
     this.DriveItemModel   = driveItemModel;
     this.ExplorerTreeItemModelViewModelParser = explorerTreeItemModelViewModelParser;
     this.ExplorerTreeVM = configuration.ExplorerTreeVM;
     this.FontVM         = new FontViewModel(this.Configuration.Drive.Font);
     this.IsExpanded     = false;
     this.IsSelected     = false;
     this.IconVM         = new IconViewModel(this.DriveItemModel.IconModel, this.Configuration.Drive.Icon);
     this.Name           = this.DriveItemModel.Name;
     this.AddDummyTreeViewItemToBeExpandable();
     this.InitVisibilityAccordingToConfiguration();
 }
Beispiel #6
0
 /// <summary>
 ///
 /// <para>
 /// Exclusively use <see cref="ExplorerTreeItemViewModelsFactory"/>
 /// to instantiate this class.
 /// -> Except for test purposes.
 /// </para>
 /// </summary>
 internal FileItemViewModel(FileItemModel fileItemModel,
                            IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
                            IConfiguration configuration,
                            IExplorerTreeItemViewModel parentItemVM) : base()
 {
     this.Configuration    = configuration;
     this.ChildTreeItemVMs = new ObservableCollection <AExplorerTreeChildItemViewModel>();
     this.ExplorerTreeItemModelViewModelParser = explorerTreeItemModelViewModelParser;
     this.ExplorerTreeVM = configuration.ExplorerTreeVM;
     this.FileItemModel  = fileItemModel;
     this.FontVM         = new FontViewModel(this.Configuration.File.Font);
     this.FullName       = fileItemModel.FullName;
     this.IsExpanded     = false;
     this.IsSelected     = false;
     this.IsHidden       = fileItemModel.IsHidden;
     this.IconVM         = new IconViewModel(fileItemModel.IconModel, this.Configuration.File.Icon);
     this.Name           = fileItemModel.Name;
     this.ParentItem     = parentItemVM;
     this.SetVisibilityAccordingToConfigruation(configuration.HiddenOverall);
 }
 /// <summary>
 ///
 /// <para>
 /// Exclusively use <see cref="ExplorerTreeItemViewModelsFactory"/>
 /// to instantiate this class.
 /// -> Except for test purposes.
 /// </para>
 /// </summary>
 internal DirectoryItemViewModel
     (DirectoryItemModel directoryItemModel,
     IExplorerTreeItemModelViewModelParser explorerTreeItemModelViewModelParser,
     IConfiguration configuration,
     IExplorerTreeItemViewModel parentItemVM) : base()
 {
     this.Configuration      = configuration;
     this.ChildTreeItemVMs   = new ObservableCollection <AExplorerTreeChildItemViewModel>();
     this.DirectoryItemModel = directoryItemModel;
     this.ExplorerTreeItemModelViewModelParser = explorerTreeItemModelViewModelParser;
     this.ExplorerTreeVM = configuration.ExplorerTreeVM;
     this.FontVM         = new FontViewModel(configuration.Directory.Font);
     this.FullName       = directoryItemModel.FullName;
     this.IsExpanded     = false;
     this.IsSelected     = false;
     this.IsHidden       = directoryItemModel.IsHidden;
     this.IconVM         = new IconViewModel(directoryItemModel.IconModel, configuration.Directory.Icon);
     this.Name           = directoryItemModel.Name;
     this.ParentItem     = parentItemVM;
     this.AddDummyTreeViewItemToBeExpandable();
     this.SetVisibilityAccordingToConfigruation(configuration.HiddenOverall);
 }