private void FindNodeInHierarchy(TreeNodeCollection nodes, string strSearchValue) { for (int i = 0; i < nodes.Count; i++) { //if (nodes[i].Text.ToUpper().Contains(strSearchValue.ToUpper())) //{ // lbxSearchResult.Items.Add(nodes[i]); //} foreach (string item in keywords.GetKeys()) { if (item.ToUpperInvariant().Contains(strSearchValue)) { if (!lbxSearchResult.Items.Contains(keywords[item])) { lbxSearchResult.Items.Add(keywords[item]); } } } if (nodes[i].Nodes.Count > 0) { FindNodeInHierarchy(nodes[i].Nodes, strSearchValue); } } }
public static void LoadFrom <T>(this GeoCollection <T> sourceCollection, GeoCollection <T> targetCollection) { sourceCollection.Clear(); foreach (var key in targetCollection.GetKeys()) { sourceCollection.Add(key, targetCollection[key]); } }
private void UserControl_Load(object sender, EventArgs e) { filenames = new GeoCollection <string>(); filenames.Add("ShortestPath", "ShortestPath"); filenames.Add("FastestPath", "FastestPath"); filenames.Add("DallasWithOneWayRoad", "DallasWithOneWayRoad"); filenames.Add("OptimizeHighway", "OptimizeHighway"); cmbPurpose.DataSource = filenames.GetKeys(); RtgRoutingSource.BuildingRoutingData += new EventHandler <BuildingRoutingDataRtgRoutingSourceEventArgs>(RtgRoutingSource_BuildingRoadData); RenderMap(); }