/// <summary>Constructs the <see cref="SettingsService"/>.</summary>
 public SettingsService(UIService ui,
                        TreemapRendererFactory treemapFactory)
 {
     this.ui = ui;
     treemap = treemapFactory.Create();
     Reset();
 }
 /// <summary>Constructs the <see cref="SettingsService"/>.</summary>
 public SettingsService(IUIService ui,
                        IBitmapFactory bitmapFactory,
                        TreemapRendererFactory treemapFactory)
 {
     this.ui            = ui;
     this.bitmapFactory = bitmapFactory;
     treemap            = treemapFactory.Create();
     Reset();
 }
Exemple #3
0
        /// <summary>Constructs the <see cref="FileGraphViewModel"/>.</summary>
        public FileGraphViewModel(SettingsService settings,
                                  TreemapRendererFactory treemapFactory,
                                  UIService ui)
        {
            Settings = settings;
            Treemap  = treemapFactory.Create();
            UI       = ui;

            Settings.PropertyChanged += OnSettingsPropertyChanged;

            resizeTimer = UI.CreateTimer(TimeSpan.FromSeconds(0.05), true, OnResizeTick);
        }
        /// <summary>Constructs the <see cref="GraphViewModel"/>.</summary>
        public GraphViewModel(SettingsService settings,
                              TreemapRendererFactory treemapFactory,
                              UIService ui)
        {
            this.settings = settings;
            treemap       = treemapFactory.Create();
            this.ui       = ui;

            this.settings.PropertyChanged += OnSettingsPropertyChanged;

            resizeTimer = this.ui.CreateTimer(TimeSpan.FromSeconds(0.05), true, OnResizeTick);
            isEnabled   = true;
        }
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel(SettingsService settings,
                             ScanningService scanning,
                             IIconCacheService iconCache,
                             IUIService ui,
                             IBitmapFactory bitmapFactory,
                             ImagesServiceBase images,
                             IClipboardService clipboard,
                             IOSService os,
                             IWindowDialogService dialogs,
                             TreemapRendererFactory treemapFactory,
                             IShortcutsService shortcuts,
                             RelayCommandService relayFactory)
        {
            Settings      = settings;
            Scanning      = scanning;
            IconCache     = iconCache;
            UI            = ui;
            BitmapFactory = bitmapFactory;
            Images        = images;
            Clipboard     = clipboard;
            OS            = os;
            Dialogs       = dialogs;
            Shortcuts     = shortcuts;
            Treemap       = treemapFactory.Create();

            Settings.PropertyChanged += OnSettingsPropertyChanged;
            Scanning.PropertyChanged += OnScanningPropertyChanged;

            Extensions = new ExtensionItemViewModelCollection(this);

            SelectedFiles = new ObservableCollection <FileItemViewModel>();
            SelectedFiles.CollectionChanged += OnSelectedFilesChanged;

            FileComparer      = new FileComparer();
            ExtensionComparer = new ExtensionComparer();
            UpdateEmptyRecycleBin();

            GCRAMUsage = GC.GetTotalMemory(false);
            if (IsInDesignMode)
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                // Code runs "for real"
                ramTimer    = UI.StartTimer(Settings.RAMInterval, true, OnRAMUsageTick);
                statusTimer = UI.CreateTimer(Settings.StatusInterval, true, OnStatusTick);
            }
        }