public virtual void MouseMove(MouseEventArgs evnt)
{
if (this.chart.MainSeries == null || this.chart.MainSeries.Count == 0 || evnt.X <= X1 || evnt.X >= X2)
return;
double num1 = 10.0;
double num2 = (MaxValue - MinValue) / 20.0;
int x = evnt.X;
double y = this.WorldY(evnt.Y);
bool flag = false;
string caption = "";
this.onPrimitive = false;
foreach (IChartDrawable drawable in this.simplePrimitives)
{
if (DrawItems || drawable is SeriesView)
{
Distance distance = drawable.Distance(x, y);
if (distance != null && distance.DX < num1 && distance.DY < num2)
{
if (drawable.ToolTipEnabled)
{
if (caption != "")
caption = caption + "\n\n";
caption = caption + distance.ToolTipText;
flag = true;
}
this.onPrimitive = true;
this.chart.SetCursor(ChartCursorType.Hand);
// #if GTK
// this.chart.GdkWindow.Cursor = UserControl.HandCursor;
// #else
// Cursor.Current = Cursors.Hand;
// #endif
}
}
}
if (DrawItems)
{
int num3 = 0;
int index1 = this.chart.MainSeries.GetIndex(GetDateTime(evnt.X), IndexOption.Null);
DateTime dateTime1 = this.chart.MainSeries.GetDateTime(index1);
if (index1 != 0)
{
DateTime dateTime2 = this.chart.MainSeries.GetDateTime(index1 - 1);
num3 = this.rangeList.GetNextIndex(dateTime2);
if (this.rangeList.Contains(dateTime2))
++num3;
}
int prevIndex = this.rangeList.GetPrevIndex(dateTime1);
if (num3 != -1 && prevIndex != -1)
{
for (int index2 = num3; index2 <= prevIndex; ++index2)
{
foreach (IChartDrawable drawable in this.rangeList[index2])
{
var distance = drawable.Distance(x, y);
if (distance != null && distance.DX < num1 && distance.DY < num2)
{
if (drawable.ToolTipEnabled)
{
if (caption != "")
caption = caption + "\n\n";
caption = caption + distance.ToolTipText;
flag = true;
}
this.onPrimitive = true;
this.chart.SetCursor(ChartCursorType.Hand);
// #if GTK
// #else
// Cursor.Current = Cursors.Hand;
// #endif
}
}
}
}
}
if (flag)
{
this.chart.ToolTip.SetToolTip(this.chart, caption);
this.chart.ToolTip.Active = true;
}
else
this.chart.ToolTip.Active = false;
}