SmartQuant.FinChart.Pad.MouseDown C# (CSharp) Method

MouseDown() public method

public MouseDown ( MouseEventArgs evnt ) : void
evnt MouseEventArgs
return void
        public virtual void MouseDown(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;
            foreach (IChartDrawable primitive in this.simplePrimitives)
            {
                if (primitive is DSView)
                {
                    var d = primitive.Distance(evnt.X, WorldY(evnt.Y));
                    if (d != null)
                    {
                        this.chart.UnSelectAll();
                        if (d.DX < num1 && d.DY < num2)
                        {
                            primitive.Select();
                            this.chart.ContentUpdated = true;
                            this.chart.Invalidate();
                            this.chart.ShowProperties(primitive as DSView, this, false);
                            SelectedPrimitive = primitive;
                            if (this.chart.ContextMenuEnabled && evnt.Button == System.Windows.Forms.MouseButtons.Right)
                                ShowContextMenu(primitive, this.chart, evnt);
                            break;
                        }
                    }
                }
            }
        }