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 provider1 in FreeQuant.Providers.ProviderManager.Providers)
         {
             selector.AddNode(provider1.Name, (object)provider1.Name, (ObjectSelectorEditor.SelectorNode)null);
         }
         selector.Sort();
         foreach (ObjectSelectorEditor.SelectorNode selectorNode in selector.Nodes)
         {
             if (selectorNode.value.Equals((object)altIdGroup.AltSource))
             {
                 selector.SelectedNode = (TreeNode)selectorNode;
                 break;
             }
         }
         selector.Width = 144;
     }
     else
     {
         base.FillTreeWithData(selector, context, provider);
     }
 }
Beispiel #2
0
        protected override object SetItems(object editValue, object[] value)
        {
            AltIDGroupList altIDGroupList = editValue as AltIDGroupList;

            altIDGroupList.instrument.instrument.SecurityAltIDGroup.Clear();
            for (int i = 0; i < value.Length; i++)
            {
                AltIDGroup altIDGroup = (AltIDGroup)value[i];
                altIDGroupList.instrument.instrument.SecurityAltIDGroup.Add(altIDGroup.group);
            }
            return(altIDGroupList);
        }
Beispiel #3
0
        public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
        {
            if (!(destinationType == typeof(string)) || !(value is AltIDGroup))
            {
                return(base.ConvertTo(context, culture, value, destinationType));
            }
            AltIDGroup altIDGroup = (AltIDGroup)value;

            if (string.IsNullOrWhiteSpace(altIDGroup.AltExchange) && string.IsNullOrWhiteSpace(altIDGroup.AltSymbol))
            {
                return(string.Empty);
            }
            return(string.Format("{0}@{1}", altIDGroup.AltSymbol, altIDGroup.AltExchange));
        }
Beispiel #4
0
 protected override object CreateInstance(Type itemType)
 {
     if (itemType == typeof(AltIDGroup))
     {
         AltIDGroup[]  result        = null;
         AltSourceForm altSourceForm = new AltSourceForm();
         if (altSourceForm.ShowDialog() == DialogResult.OK)
         {
             AltIDGroup altIDGroup = this.instrument.AltIDGroups.Add(altSourceForm.AltSource);
             result = new AltIDGroup[]
             {
                 altIDGroup
             };
         }
         return(result);
     }
     return(base.CreateInstance(itemType));
 }
		protected override object CreateInstance(Type itemType)
		{
			if (itemType == typeof(AltIDGroup))
			{
				AltIDGroup[] result = null;
				AltSourceForm altSourceForm = new AltSourceForm();
				if (altSourceForm.ShowDialog() == DialogResult.OK)
				{
					AltIDGroup altIDGroup = this.instrument.AltIDGroups.Add(altSourceForm.AltSource);
					result = new AltIDGroup[]
					{
						altIDGroup
					};
				}
				return result;
			}
			return base.CreateInstance(itemType);
		}
Beispiel #6
0
        protected override object CreateInstance(System.Type itemType)
        {
            if (!(itemType == typeof(AltIDGroup)))
            {
                return(base.CreateInstance(itemType));
            }
            AltIDGroup[]  altIdGroupArray = (AltIDGroup[])null;
            AltSourceForm altSourceForm   = new AltSourceForm();

            if (altSourceForm.ShowDialog() == DialogResult.OK)
            {
                altIdGroupArray = new AltIDGroup[1]
                {
                    this.instrument.AltIDGroups.Add(altSourceForm.AltSource)
                }
            }
            ;
            return((object)altIdGroupArray);
        }
Beispiel #7
0
 public AltIDGroupPropertyDescriptor(AltIDGroup group, int index)
     : base(group.AltSource, (Attribute[])null)
 {
     this.group = group;
     this.index = index;
 }
		public AltIDGroupPropertyDescriptor(AltIDGroup group, int index) : base(group.AltSource, null)
		{
			this.group = group;
			this.index = index;
		}