WFA_psychometric_chart.Form_handler.LineDeterctOnMouseMove C# (CSharp) 메소드

LineDeterctOnMouseMove() 개인적인 메소드

private LineDeterctOnMouseMove ( MouseEventArgs e ) : void
e MouseEventArgs
리턴 void
        private void LineDeterctOnMouseMove(MouseEventArgs e)
        {
            HitTestResult hit = chart1.HitTest(e.X, e.Y);
            // Text = "Element: " + hit.ChartElementType;
            DataPoint dp = null;
            if (hit.ChartElementType == ChartElementType.DataPoint)
                dp = hit.Series.Points[hit.PointIndex];

            //lb_test.Text = "nothing ";

            if (dp != null)
            {
                //  Text += " Point #" + hit.PointIndex  + " x-value:" + dp.XValue + " y-value: " + dp.YValues[0]+" series name = "+hit.Series.Name;

                if (menuStripNodeLineInfoValues.Count > 0)
                {
                    for (int i = 0; i < menuStripNodeLineInfoValues.Count; i++)
                    {

                        if (hit.Series.Name != null)
                        {
                            if ((string)hit.Series.Name == (string)menuStripNodeLineInfoValues[i].lineSeriesID.Name)
                            {
                                //--lets store previous color first
                                storeColor = menuStripNodeLineInfoValues[i].lineColorValue;
                                flagForColor = 1;
                                tempSeries = hit.Series;

                                //--Logging the index so that it could be used for futher processing later...
                                indexOfPrevPointForLineMovement = menuStripNodeLineInfoValues[i].prevNodeId;//This gets the previous node id value...
                                indexOfLineInTheList = i;//This index is used for updating the line when the line is moved...
                                hit.Series.Color = Color.Black;
                                disconnectLineToolStripMenuItem.Enabled = true;
                                // lb_test.Text = Text;
                            }

                        }

                    }
                }//CLOSE OF IF MENUSTRIP

            }//CLOSE of if dp
            else
            {
                if (flagForColor == 1)
                    tempSeries.Color = storeColor;

            }
        }