Ejemplo n.º 1
0
        /// <summary>
        /// Prevents a default instance of the <see cref="SnapshotManagerViewModel"/> class from being created.
        /// </summary>
        private SnapshotManagerViewModel() : base("Snapshot Manager")
        {
            // Note: Not async to avoid updates slower than the perception threshold
            this.ClearSnapshotsCommand = new RelayCommand(() => SnapshotManager.ClearSnapshots(), () => true);
            this.UndoSnapshotCommand   = new RelayCommand(() => SnapshotManager.UndoSnapshot(), () => true);
            this.RedoSnapshotCommand   = new RelayCommand(() => SnapshotManager.RedoSnapshot(), () => true);

            DockingViewModel.GetInstance().RegisterViewModel(this);
        }
        /// <summary>
        /// Prevents a default instance of the <see cref="SnapshotManagerViewModel"/> class from being created.
        /// </summary>
        private SnapshotManagerViewModel() : base("Snapshot Manager")
        {
            this.ContentId = SnapshotManagerViewModel.ToolContentId;

            // Note: Not async to avoid updates slower than the perception threshold
            this.ClearSnapshotsCommand = new RelayCommand(() => this.ClearSnapshots(), () => true);
            this.UndoSnapshotCommand = new RelayCommand(() => this.UndoSnapshot(), () => true);
            this.RedoSnapshotCommand = new RelayCommand(() => this.RedoSnapshot(), () => true);

            Task.Run(() => DockingViewModel.GetInstance().RegisterViewModel(this));
            Task.Run(() => SnapshotManager.GetInstance().Subscribe(this));
        }
 /// <summary>
 /// Redoes the most recent snapshot.
 /// </summary>
 private void RedoSnapshot()
 {
     SnapshotManager.GetInstance().RedoSnapshot();
 }
 /// <summary>
 /// Undoes the most recent snapshot.
 /// </summary>
 private void UndoSnapshot()
 {
     SnapshotManager.GetInstance().UndoSnapshot();
 }
 /// <summary>
 /// Clears all snapshots.
 /// </summary>
 private void ClearSnapshots()
 {
     SnapshotManager.GetInstance().ClearSnapshots();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Reads all memory for every region contained in this snapshot. TODO: This is not parallel, nor does it track progress.
 /// </summary>
 public void ReadAllMemory()
 {
     this.TimeSinceLastUpdate = DateTime.Now;
     this.Intersect(SnapshotManager.GetInstance().CreateSnapshotFromSettings());
     this.SnapshotRegions?.ForEach(x => x.ReadAllMemory(keepValues: true, readSuccess: out _));
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Unconditionally expands all regions in this snapshot by the specified size.
 /// </summary>
 /// <param name="expandSize">The size by which to expand the snapshot regions.</param>
 public void ExpandAllRegions(UInt64 expandSize)
 {
     this.SnapshotRegions?.ForEach(x => x.Expand(expandSize));
     this.Intersect(SnapshotManager.GetInstance().CreateSnapshotFromSettings());
 }
Ejemplo n.º 8
0
 private void SnapshotManagerOnSnapshotsUpdatedEvent(SnapshotManager snapshotManager)
 {
     this.RaisePropertyChanged(nameof(this.Snapshots));
     this.RaisePropertyChanged(nameof(this.DeletedSnapshots));
 }