62 lines
1.0 KiB
C#
62 lines
1.0 KiB
C#
using System;
|
|
using System.Diagnostics;
|
|
using CPF.ReoGrid.Interaction;
|
|
|
|
namespace CPF.ReoGrid.Drawing
|
|
{
|
|
[Serializable]
|
|
public abstract class SelectableFloatingObject : FloatingObject, IUserVisual, ISelectableVisual
|
|
{
|
|
public abstract void Invalidate();
|
|
|
|
//[DebuggerBrowsable(DebuggerBrowsableState.Never)]
|
|
public event EventHandler SelectionChanged;
|
|
|
|
public virtual bool IsSelected
|
|
{
|
|
get
|
|
{
|
|
return this.isSelected;
|
|
}
|
|
set
|
|
{
|
|
bool flag = this.isSelected != value;
|
|
if (flag)
|
|
{
|
|
this.isSelected = value;
|
|
bool flag2 = this.isSelected;
|
|
if (flag2)
|
|
{
|
|
this.OnSelect();
|
|
}
|
|
else
|
|
{
|
|
this.OnDeselect();
|
|
}
|
|
this.Invalidate();
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual void OnSelect()
|
|
{
|
|
bool flag = this.SelectionChanged != null;
|
|
if (flag)
|
|
{
|
|
this.SelectionChanged(this, null);
|
|
}
|
|
}
|
|
|
|
public virtual void OnDeselect()
|
|
{
|
|
bool flag = this.SelectionChanged != null;
|
|
if (flag)
|
|
{
|
|
this.SelectionChanged(this, null);
|
|
}
|
|
}
|
|
|
|
private bool isSelected;
|
|
}
|
|
}
|