Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows;
|
---|
| 6 | using Microsoft.Research.DynamicDataDisplay.Common;
|
---|
| 7 |
|
---|
| 8 | namespace Microsoft.Research.DynamicDataDisplay.ViewportConstraints
|
---|
| 9 | {
|
---|
| 10 | /// <summary>
|
---|
| 11 | /// Represents a base class for all constraints that are being applied to viewport's visible rect.
|
---|
| 12 | /// </summary>
|
---|
| 13 | public abstract class ViewportConstraint
|
---|
| 14 | {
|
---|
| 15 | /// <summary>
|
---|
| 16 | /// Applies the constraint.
|
---|
| 17 | /// </summary>
|
---|
| 18 | /// <param name="previousDataRect">Previous data rectangle.</param>
|
---|
| 19 | /// <param name="proposedDataRect">Proposed data rectangle.</param>
|
---|
| 20 | /// <param name="viewport">The viewport, to which current restriction is being applied.</param>
|
---|
| 21 | /// <returns>New changed visible rectangle.</returns>
|
---|
| 22 | public abstract DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport);
|
---|
| 23 |
|
---|
| 24 | /// <summary>
|
---|
| 25 | /// Raises the changed event.
|
---|
| 26 | /// </summary>
|
---|
| 27 | protected void RaiseChanged()
|
---|
| 28 | {
|
---|
| 29 | Changed.Raise(this);
|
---|
| 30 | }
|
---|
| 31 | /// <summary>
|
---|
| 32 | /// Occurs when constraint changes.
|
---|
| 33 | /// Causes update of <see cref="Viewport"/>'s Visible property.
|
---|
| 34 | /// </summary>
|
---|
| 35 | public event EventHandler Changed;
|
---|
| 36 | }
|
---|
| 37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.