コード例 #1
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            //call the service and calculate the shortest path and display it
            GraphServiceClient client = new GraphServiceClient();
            var start = Convert.ToInt32(cbFromNode.SelectedValue);
            var finish = Convert.ToInt32(cbToNode.SelectedValue);
            List<int> list =  client.ShortestPath(start, finish , vertices);

            List<string> path =  new List<string>();

            foreach (var i in list)
            {
                path.Add(nodeList[i]);
            }

            txtPath.Text = string.Join(" -> ", path);
        }
コード例 #2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            //call the service and calculate the shortest path and display it
            GraphServiceClient client = new GraphServiceClient();
            var        start          = Convert.ToInt32(cbFromNode.SelectedValue);
            var        finish         = Convert.ToInt32(cbToNode.SelectedValue);
            List <int> list           = client.ShortestPath(start, finish, vertices);

            List <string> path = new List <string>();

            foreach (var i in list)
            {
                path.Add(nodeList[i]);
            }

            txtPath.Text = string.Join(" -> ", path);
        }