public bool LoadData(string path) { randomlyFlag = 0; if (NodesList != null) { NodesList.Clear(); } NodesList = new List <Node>(); StreamReader streamCheck = new StreamReader(path); string[] lineCheck = streamCheck.ReadLine().Split(' '); streamCheck.Close(); if (lineCheck.Length < 2) { LoadTestData(path); calcDistances(); return(true); } else { LoadPolishRoadData(path); return(false); } UnvisitedNodesList = new List <Node>(NodesList); }
private void BindgingSettingNodeToNodeTlv(IXmlSetting currentXmlSetting, string strSelectedItemText) { if (SelectType != "") { NodesList.Clear(); foreach (IXmlSettingNode tempNode in currentXmlSetting.GetNodes) { tempNode.IdtAttributes = tempNode.identifier(); if (tempNode.compare_flag) { tempNode.Compare_flag = "1"; tempNode.CompareImage = System.IO.Directory.GetCurrentDirectory() + "\\Images\\compare_flag_true.png"; } else { tempNode.Compare_flag = "0"; tempNode.CompareImage = System.IO.Directory.GetCurrentDirectory() + "\\Images\\compare_flag_false.png"; } tempNode.NameImage = System.IO.Directory.GetCurrentDirectory() + "\\Images\\node.png"; NodesList.Add(tempNode); if (tempNode.name == strSelectedItemText) { // neoItem.Selected = true; } } } }
private void InfoUpdate(object sender, EventArgs e) { InQueueCount.Content = replicationNode.MessagesQueueProc.InMessagesQueue.Count; OutQueueCount.Content = replicationNode.MessagesQueueProc.OutMessagesQueue.Count; Counter.Content = replicationNode.CheckCounter; NodesList.Clear(); if (replicationNode.NodesInfo != null) { foreach (var value in replicationNode.NodesInfo) { NodesList.AppendText( $"Id={value.NodeId},Role={value.Role},State={value.State},Count={value.CheckCounter},PCount={value.CheckCounterPrev} \r\n"); } } }