private void UpdateNodeListBox() { lstNodes.Items.Clear(); //lstNodes.Invalidate(); Dictionary <NodeInstance, double> rankedNodesDict = NodePrioritizer.PrioritizeNodes(nodes); foreach (KeyValuePair <NodeInstance, double> nodeRanking in rankedNodesDict) { lstNodes.Items.Add(nodeRanking.Key.Name + " - rank: " + Math.Round(nodeRanking.Value, 2).ToString()); } }
private void AIRankForm_Load(object sender, EventArgs e) { nodes = new List <NodeInstance>(); nodes.Add(new NodeInstance("James", 0, @"C:\Users\james\Documents", 5368709120, 2952790016)); nodes.Add(new NodeInstance("Alan", 3, @"C:\Users\alan\Documents", 7516192768, 4831838208)); nodes.Add(new NodeInstance("Tom", 7, @"C:\Users\tom\Documents", 2147483648, 2000083648)); nodes.Add(new NodeInstance("Patrick", 5, @"C:\Users\patrick\Documents", 4294967296, 3221225472)); nodes.Add(new NodeInstance("Shane", 2, @"C:\Users\shane\Documents", 21474836480, 16106127360)); Dictionary <NodeInstance, double> rankedNodesDict = NodePrioritizer.PrioritizeNodes(nodes); foreach (KeyValuePair <NodeInstance, double> nodeRanking in rankedNodesDict) { lstNodes.Items.Add(nodeRanking.Key.Name + " - rank: " + Math.Round(nodeRanking.Value, 2).ToString()); } rand = new Random((int)DateTime.Now.Ticks); timer1.Start(); }