private async void TemplateForm_Load(object sender, EventArgs e) { if (ontologies == null) { try { ShowProgressBar(); lblCaption.Text = "努力加载中……"; var getAllOntology = new GetAllOntologies(); var client = new JsonServiceClient(serviceBaseUrl); var response = await client.GetAsync(getAllOntology); ontologies = response.Ontologies; foreach (var ontology in ontologies) { if (!ontology.IsSystem) { var pnl = new FlowLayoutPanel() { Tag = ontology, AutoScroll = true }; var tabPage = new TabPage() { Text = ontology.Name, Tag = pnl }; tabPage.Controls.Add(pnl); pnl.Dock = DockStyle.Fill; tabControl.TabPages.Add(tabPage); foreach (var element in ontology.Elements) { var chkb = new CheckBox() { Text = element.Name + "(" + element.Key + ")", Tag = element, Width = 150 }; chkb.CheckedChanged += chkb_CheckedChanged; pnl.Controls.Add(chkb); } } } HideProgressBar(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
public GetAllOntologiesResponse Any(GetAllOntologies request) { var ontologies = acDomain.NodeHost.Ontologies; var response = new GetAllOntologiesResponse() { Status = (int)Status.Ok, ReasonPhrase = Status.Ok.ToName() }; foreach (var ontology in ontologies.OrderBy(a => a.Ontology.SortCode)) { if (ontology.Ontology.IsEnabled == 1) { response.Ontologies.Add(ontology.ToOntologyData()); } } return(response); }
public GetAllOntologiesResponse Any(GetAllOntologies request) { var ontologies = acDomain.NodeHost.Ontologies; var response = new GetAllOntologiesResponse() { Status = (int)Status.Ok, ReasonPhrase = Status.Ok.ToName() }; foreach (var ontology in ontologies.OrderBy(a => a.Ontology.SortCode)) { if (ontology.Ontology.IsEnabled == 1) { response.Ontologies.Add(ontology.ToOntologyData()); } } return response; }