Files
DynamicDataDisplay/Backup/ViewportRestrictions/ViewportRestriction.cs
2024-02-23 09:29:44 -05:00

42 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using Microsoft.Research.DynamicDataDisplay.Common;
namespace Microsoft.Research.DynamicDataDisplay.ViewportRestrictions
{
/// <summary>
/// Represents a base class for all restrictions that are being applied to viewport's visible rect.
/// </summary>
public abstract class ViewportRestriction
{
#region IViewportRestriction Members
/// <summary>
/// Applies the restriction.
/// </summary>
/// <param name="previousDataRect">Previous data rectangle.</param>
/// <param name="proposedDataRect">Proposed data rectangle.</param>
/// <param name="viewport">The viewport, to which current restriction is being applied.</param>
/// <returns>New changed visible rectangle.</returns>
public abstract DataRect Apply(DataRect previousDataRect, DataRect proposedDataRect, Viewport2D viewport);
/// <summary>
/// Raises the changed event.
/// </summary>
protected void RaiseChanged()
{
Changed.Raise(this);
}
/// <summary>
/// Occurs when restriction changes.
/// Causes update of <see cref="Viewport"/>'s Visible property.
/// </summary>
public event EventHandler Changed;
#endregion
}
}