Example #1
0
        public WinDirStatViewModel()
        {
            model                            = new WinDirStatModel();
            settings                         = new WinDirStatSettings(this);
            extensions                       = new ExtensionRecordsViewModel(this);
            icons                            = new IconCache(this);
            fileComparer                     = new FileComparer();
            extensionComparer                = new ExtensionComparer();
            selectedFiles                    = new ObservableCollection <FileNodeViewModel>();
            selectedExtension                = null;
            model.PropertyChanged           += OnModelPropertyChanged;
            selectedFiles.CollectionChanged += OnSelectedFilesChanged;
            settings.PropertyChanged        += OnSettingsPropertyChanged;
            ramTimer                         = new DispatcherTimer(
                settings.RAMInterval,
                DispatcherPriority.Normal,
                OnRAMUsageTick,
                Application.Current.Dispatcher);
            statusTimer = new DispatcherTimer(
                settings.StatusInterval,
                DispatcherPriority.Normal,
                OnStatusTick,
                Application.Current.Dispatcher);
            statusTimer.Stop();
            validateTimer = new DispatcherTimer(
                settings.ValidateInterval,
                DispatcherPriority.Background,
                OnValidateTick,
                Application.Current.Dispatcher);
            validateTimer.Stop();

            ramUsage = GC.GetTotalMemory(false);
        }
 public RootNode(WinDirStatModel model, FileSystemInfo info, bool isAbsoluteRoot)
     : base(info, GetFileType(info.FullName), GetRootType(isAbsoluteRoot))
 {
     this.model = model;
     rootPath   = System.IO.Path.GetFullPath(info.FullName);
     if (Type == FileNodeType.Volume)
     {
         if (!rootPath.EndsWith(@"\") && !rootPath.EndsWith("/"))
         {
             rootPath += '\\';
         }
     }
     SetupDrive();
 }
 // Duplicate tree for faster iteration
 public RootNode(RootNode node) : base(node, null)
 {
     rootPath  = node.rootPath;
     model     = node.model;
     freeSpace = node.freeSpace;
 }
        /*internal string displayName = null;
         *
         *
         * public string DisplayName {
         *      get => displayName ?? $"({PathUtils.TrimSeparatorEnd(Name)})";
         * }*/

        public RootNode(WinDirStatModel model)
            : base(ComputerName, FileNodeType.Computer, FileNodeFlags.AbsoluteRootType)
        {
            //displayName = "My Computer";
            this.model = model;
        }
 public ExtensionRecords(WinDirStatModel model)
 {
     this.model    = model;
     sortedRecords = new List <ExtensionRecord>();
     records       = new Dictionary <string, ExtensionRecord>(StringComparer.OrdinalIgnoreCase);
 }