private void lstSymbols_SelectedIndexChanged(object sender, EventArgs e) { btnDelete.Enabled = (lstSymbols.SelectedItems.Count == 1); if (btnDelete.Enabled) { var symRef = lstSymbols.SelectedItems[0].Tag as ISimpleSymbolReferenceBase; if (symRef != null) { splitContainer1.Panel2.Controls.Clear(); if (symRef.Type == SimpleSymbolReferenceType.Inline) { var ctrl = new SimpleSymbolDefinitionEditorCtrl(); ctrl.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(ctrl); var inline = (ISimpleSymbolInlineReference)symRef; ctrl.Bind(new SymbolEditorService(_edSvc, inline.SimpleSymbolDefinition)); } else if (symRef.Type == SimpleSymbolReferenceType.Library) { var ctrl = new SimpleSymbolReferenceCtrl(_edSvc, (ISimpleSymbolLibraryReference)symRef); ctrl.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(ctrl); } } } }
private void lstSymbols_SelectedIndexChanged(object sender, EventArgs e) { btnDelete.Enabled = (lstSymbols.SelectedItems.Count == 1); if (btnDelete.Enabled) { var symRef = lstSymbols.SelectedItems[0].Tag as ISimpleSymbolReferenceBase; if (symRef != null) { splitContainer1.Panel2.Controls.Clear(); if (symRef.Type == SimpleSymbolReferenceType.Inline) { var ctrl = new SimpleSymbolDefinitionEditorCtrl(); ctrl.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(ctrl); var inline = (ISimpleSymbolInlineReference)symRef; ctrl.Bind(new SymbolEditorService(_edSvc, inline.SimpleSymbolDefinition)); } else if (symRef.Type == SimpleSymbolReferenceType.Library) { var ctrl = new SimpleSymbolReferenceCtrl(_edSvc.ResourceService, (ISimpleSymbolLibraryReference)symRef); ctrl.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(ctrl); } } } }