Ejemplo n.º 1
0
        /// <summary>
        /// Reads all memory for every region contained in this snapshot.
        /// </summary>
        public void ReadAllMemory()
        {
            Boolean readSuccess;

            this.TimeSinceLastUpdate = DateTime.Now;
            this.MaskRegions(SnapshotManager.GetInstance().CollectSnapshotRegions(useSettings: false));
            this.SnapshotRegions?.ForEach(x => x.ReadAllRegionMemory(out readSuccess, keepValues: true));
        }
        /// <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(() => MainViewModel.GetInstance().Subscribe(this));
            Task.Run(() => SnapshotManager.GetInstance().Subscribe(this));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds snapshot regions to the regions contained in this snapshot. Will automatically merge and sort regions.
        /// </summary>
        /// <param name="snapshotRegions">The snapshot regions to add.</param>
        public void AddSnapshotRegions(IEnumerable <SnapshotRegion> snapshotRegions)
        {
            if (this.SnapshotRegions == null)
            {
                this.SnapshotRegions = snapshotRegions.ToList();
            }
            else
            {
                snapshotRegions?.ForEach(x => this.SnapshotRegions.Add(x));
            }

            // Re-update type and alignment, so that the newly added regions receive updates
            this.ElementType = this.ElementType;
            this.Alignment   = this.Alignment;

            this.MaskRegions(SnapshotManager.GetInstance().CollectSnapshotRegions(useSettings: false));
        }
 /// <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.º 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(Int32 expandSize)
 {
     this.SnapshotRegions?.ForEach(x => x.Expand(expandSize));
     this.MaskRegions(SnapshotManager.GetInstance().CollectSnapshotRegions(useSettings: false));
 }