public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
{
if (context != null && context.Instance != null && provider != null)
{
edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
if (edSvc != null)
{
ChannelAnalogic channelAnalogic = context.Instance as ChannelAnalogic;
GraphBuilderBase graphBuilder = MainForm.Form.GraphBuilder;
if (graphBuilder is GraphBuilderWDM)
{
GraphBuilderWDM graphBuilderWDM = graphBuilder as GraphBuilderWDM;
if (graphBuilderWDM.Crossbar != null)
{
System.Windows.Forms.ListBox vListBox = new ListBox();
vListBox.BorderStyle = BorderStyle.None;
vListBox.Click += new EventHandler(List_Click);
vListBox.Items.Add("");
//int numberOfInput = graphBuilderWDM.WDMCrossbar.GetAudioInputCount();
//for (int i = 0; i < numberOfInput; i++)
// vListBox.Items.Add(graphBuilderWDM.WDMCrossbar.GetAudioName(i));
foreach (CrossbarHelper.Routing routing in graphBuilderWDM.WDMCrossbar.AudioRoutingList)
vListBox.Items.Add(routing.inputName);
vListBox.SelectedItem = (string)value;
edSvc.DropDownControl(vListBox);
return vListBox.SelectedItem;
}
}
return value;
}
}
return null;
}