-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathAltSourceTypeEditor.cs
More file actions
41 lines (41 loc) · 1.05 KB
/
Copy pathAltSourceTypeEditor.cs
File metadata and controls
41 lines (41 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using SmartQuant.Providers;
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
namespace OpenQuant.API.Design
{
internal class AltSourceTypeEditor : ObjectSelectorEditor
{
public override bool IsDropDownResizable
{
get
{
return true;
}
}
protected override void FillTreeWithData(ObjectSelectorEditor.Selector selector, ITypeDescriptorContext context, IServiceProvider provider)
{
if (context != null && context.Instance != null)
{
AltIDGroup altIDGroup = (AltIDGroup)context.Instance;
selector.Clear();
foreach (IProvider provider2 in SmartQuant.Providers.ProviderManager.Providers)
{
selector.AddNode(provider2.Name, provider2.Name, null);
}
selector.Sort();
foreach (ObjectSelectorEditor.SelectorNode selectorNode in selector.Nodes)
{
if (selectorNode.value.Equals(altIDGroup.AltSource))
{
selector.SelectedNode = selectorNode;
break;
}
}
selector.Width = 144;
return;
}
base.FillTreeWithData(selector, context, provider);
}
}
}