WFA_psychometric_chart.Form_handler.chart1_MouseClick C# (CSharp) Method

chart1_MouseClick() private method

private chart1_MouseClick ( object sender, MouseEventArgs e ) : void
sender object
e MouseEventArgs
return void
        private void chart1_MouseClick(object sender, MouseEventArgs e)
        {
            if (flagForDisconnectClick == 1)
            {
                ////--Creating temporary line..
                //Series addDottedSeries = new Series();
                //addDottedSeries.ChartType = SeriesChartType.Line;
                //addDottedSeries.Color = Color.Black;

                //addDottedSeries.Points.Add(menust)

                if (flagNodeSelectedForConnect == 1)
                {
                    //--Here we need to do the resetting of the datas in the arraylist and replotting it ....
                    //--This function does the resetting the line properties...

                    ResettingLines();//--Calling the resetting the lines..

                    ReDrawingLineAndNode();

                    //--Again resetting the values as well ..
                    chart1.Series.Remove(addDottedSeries);//--lets remove the indicator if present
                    flagForDisconnectClick = 0;
                    flagNodeSelectedForConnect = 0;

                    //This for closing the insert node while the disconnect is selected
                    insertNodeToolStripMenuItem.Enabled = true;

                }

            }
            else {

                //--This function is used for nodeSelection and releasing node to desired place
                //--This gets triggered based on mouse select and release..

                if (flagForInsertOrUpdateDataToDB == 1)
                {
                    for (int x = 0; x < menuStripNodeInfoValues.Count; x++)
                    {
                        UpdateNodeInfoToDB(menuStripNodeInfoValues[x].id, menuStripNodeInfoValues[x].xVal, menuStripNodeInfoValues[x].yVal, menuStripNodeInfoValues[x].source, menuStripNodeInfoValues[x].name, menuStripNodeInfoValues[x].label, menuStripNodeInfoValues[x].colorValue, menuStripNodeInfoValues[x].showItemText);
                    }
                }

                NodeSelectionAndRelease(e);

            }
        }