WFA_psychometric_chart.Form1_main.UniqueMixName C# (CSharp) Method

UniqueMixName() public method

public UniqueMixName ( ) : string
return string
        public string UniqueMixName()
        {
            indexRun1x = 1;
            int tx = menuStripNodeInfoValues.Count;
            //if (t > 0)
            //{
            //    indexRun1 = t + 1;
            //}
            //else 
            
            if (tx == 0)
            {
                indexRun1x = 1;
            }
            else
            { 
                foreach(var node in menuStripNodeInfoValues)
                {
                    if (node.temperature_source == "Mix")//either temperature or humidity source will have mix as property
                    {
                        indexRun1x++;
                    }

                }
            }

            //We also need to check if the value is present or not after setting 


            int indNodeRun1 = indexRun1x;
            string nodeName = "Mix" + indNodeRun1;//This is the node name
            for (int i = 0; i < menuStripNodeInfoValues.Count; i++)
            {
                if (menuStripNodeInfoValues[i].name == nodeName)
                {
                    indNodeRun1++;
                    nodeName = "Mix" + indNodeRun1;
                    i = 0;
                }

            }


            return nodeName;
        }
Form1_main