void schemaOrgTypeTree_SelectedNodeChanged(object sender, EventArgs e) { //close dialog and send back result string schemaOrgSelectedPropertyURI = schemaOrgTypeTree.SelectedNode.Value; string schemaOrgSelectedTypeURI = schemaOrgTypeTree.SelectedNode.ToolTip; SortedDictionary<string, SchemaOrgOwlType> allTypes = SchemaOrgRepository.GetSchemaOrgTypesCached(HttpContext.Current.Cache); string containerUri = string.Empty; string containerName = string.Empty; string isContainer = "0"; if (!string.IsNullOrEmpty(schemaOrgSelectedTypeURI)) { SchemaOrgOwlType selectedPropertyType = allTypes[schemaOrgSelectedTypeURI]; containerUri = selectedPropertyType.URI; containerName = selectedPropertyType.Name; if (selectedPropertyType.Properties.Count > 0) { //only expose as container/embedded if it is a complextype (has more properties) isContainer = "1"; } } SortedDictionary<string, SchemaOrgOwlProperty> allProps = SchemaOrgRepository.GetSchemaOrgPropertiesCached(HttpContext.Current.Cache); SchemaOrgOwlProperty selectedProperty = allProps[schemaOrgSelectedPropertyURI]; SchemaOrgItem result = new SchemaOrgItem() { URI = schemaOrgSelectedPropertyURI, Name = selectedProperty.Name + ";" + containerName + ";" + containerUri + ";" + isContainer, //concatenate data into value part. Ugly but needed so we can get all data through. we reuse code for Search Description = selectedProperty.Description }; WebDialogueContext.SendResult(result); }
void schemaOrgTypeTree_SelectedNodeChanged(object sender, EventArgs e) { if (schemaOrgTypeTree.SelectedNode != schemaOrgTypeTree.Nodes[0]) //the root node should not be selectable { recursiceRemoveSelectedItemImage(schemaOrgTypeTree.Nodes[0]); // schemaOrgTypeTree.SelectedNode.ImageUrl = propertyiconUrl; //close dialog and send back result string schemaOrgSelectedURI = schemaOrgTypeTree.SelectedNode.Value; SchemaOrgOwlType selectedType = _allTypes[schemaOrgSelectedURI]; SchemaOrgItem returnValue = new SchemaOrgItem() { URI = schemaOrgSelectedURI, Name = selectedType.Name, Description = selectedType.Description }; WebDialogueContext.SendResult(returnValue); } }