private void AdapterManagementOperatorControl_Load(object sender, EventArgs e)
        {
            if (this.DesignMode)
            {
                return;
            }

            _adapterTypes = ReflectionHelper.GatherTypeChildrenTypesFromAssemblies(typeof(IIntegrationAdapter), false, false,
                                                                                   ReflectionHelper.GetApplicationEntryAssemblyAndReferencedAssemblies(), null);

            foreach (Type type in _adapterTypes)
            {
                toolStripComboBoxAdapterType.Items.Add(UserFriendlyNameAttribute.GetTypeAttributeName(type));
            }

            if (_adapterTypes.Count == 0)
            {
                toolStripComboBoxAdapterType.Enabled = false;
                toolStripButtonCreate.Enabled        = false;
            }
            else
            {
                toolStripComboBoxAdapterType.SelectedIndex = 0;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public IntegrationAdapter()
            : base("Integration Adapter", false)
        {
            this.Name = UserFriendlyNameAttribute.GetTypeAttributeName(this.GetType());

            base.DefaultTimeOut = TimeSpan.FromSeconds(20);
        }
 void _component_OperationalStateChangedEvent(IOperational operational, OperationalStateEnum previousOperationState)
 {
     WinFormsHelper.BeginManagedInvoke(this,
                                       delegate
     {
         labelStatus.Text = UserFriendlyNameAttribute.GetTypeAttributeName(operational.GetType()) + " is " + operational.OperationalState.ToString();
     });
 }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name">The name of this client module.</param>
        /// <param name="singleThreadOnly">Should the module be entered with single or multiple Arbiter threads.</param>
        public ArbiterClientBase(bool singleThreadOnly)
        {
            string name = UserFriendlyNameAttribute.GetTypeAttributeName(this.GetType());

            // Make sure not to use the default struct parameterless constructor.
            _subscriptionClientId = new ArbiterClientId(name, this.GetType(), this);

            _messageFilter    = new MessageFilter(true);
            _singleThreadOnly = singleThreadOnly;
        }
Ejemplo n.º 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="name">The name of this client module.</param>
        /// <param name="singleThreadOnly">Should the module be entered with single or multiple Arbiter threads.</param>
        public ArbiterClientBase(string idName, bool singleThreadOnly)
        {
            if (string.IsNullOrEmpty(idName))
            {// Try to establish user friendly name, or if not available, use class name.
                idName = UserFriendlyNameAttribute.GetTypeAttributeName(this.GetType());
            }

            _subscriptionClientId = new ArbiterClientId(idName, this.GetType(), this);
            _messageFilter        = new MessageFilter(true);
            _singleThreadOnly     = singleThreadOnly;
        }
        /// <summary>
        ///
        /// </summary>
        public AdapterManagementComponent()
            : base(false)
        {
            Name = UserFriendlyNameAttribute.GetTypeAttributeName(typeof(AdapterManagementComponent));
            base.DefaultTimeOut = TimeSpan.FromSeconds(15);

            ChangeOperationalState(OperationalStateEnum.Constructed);

            _adapters.ItemAddedEvent += new GenericContainer <IIntegrationAdapter> .ItemUpdateDelegate(Adapters_ItemAddedEvent);

            _adapters.ItemRemovedEvent += new GenericContainer <IIntegrationAdapter> .ItemUpdateDelegate(Adapters_ItemRemovedEvent);
        }
Ejemplo n.º 7
0
        /// <summary>
        ///
        /// </summary>
        public ExpertManagementControl(ExpertManagementComponent expertManager)
            : base(expertManager)
        {
            InitializeComponent();

            this.Name = UserFriendlyNameAttribute.GetTypeAttributeName(typeof(ExpertManagementComponent));

            expertManager.AddedExpertContainerEvent   += new ExpertManagementComponent.ExpertContainerUpdateDelegate(expertManager_AddedExpertContainerEvent);
            expertManager.RemovedExpertContainerEvent += new ExpertManagementComponent.ExpertContainerUpdateDelegate(expertManager_RemovedExpertContainerEvent);
            expertManager.ExpertAssemblyAddedEvent    += new ExpertManagementComponent.ExpertAssemblyAddedDelegate(expertManager_ExpertAssemblyAddedEvent);
            expertManager.ExpertAssemblyRemovedEvent  += new ExpertManagementComponent.ExpertAssemblyAddedDelegate(expertManager_ExpertAssemblyRemovedEvent);
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public VolumeCustom()
     : base(UserFriendlyNameAttribute.GetTypeAttributeName(typeof(VolumeCustom)), true, false, new string[] { "Volume" })
 {
     base._results.SetResultSetChartType("Volume", LinesChartSeries.ChartTypeEnum.Histogram);
 }
        void createItem_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;
            Type componentType     = (Type)item.Tag;

            PlatformComponent component = null;

            bool showPropertiesForm = ComponentManagementAttribute.GetTypeAttribute(componentType).RequestPreStartSetup;

            if (ComponentManagementAttribute.GetTypeAttribute(componentType).IsMandatory)
            {// Mandatory components we do not create, only show / hide.
                component = _platform.GetFirstComponentByType(componentType);
                component.UISerializationInfo.AddValue("componentVisible", true);

                platform_ActiveComponentAddedEvent(component, false);
                return;
            }

            if (componentType.IsSubclassOf(typeof(Expert)))
            {
                component          = new LocalExpertHost(UserFriendlyNameAttribute.GetTypeAttributeName(componentType), componentType);
                showPropertiesForm = showPropertiesForm || ComponentManagementAttribute.GetTypeAttribute(typeof(LocalExpertHost)).RequestPreStartSetup;
            }
            else if (componentType.IsSubclassOf(typeof(WizardControl)))
            {// Wizards are run in Hosting forms.
                ConstructorInfo info = componentType.GetConstructor(new Type[] { typeof(Platform) });

                if (info != null)
                {
                    WizardControl wizardControl = (WizardControl)info.Invoke(new object[] { _platform });
                    HostingForm   hostingForm   = new HostingForm(UserFriendlyNameAttribute.GetTypeAttributeName(componentType), wizardControl);
                    hostingForm.Icon = Resources.magic_wand1;
                    hostingForm.Show();
                    return;
                }
            }
            else if (componentType.IsSubclassOf(typeof(CommonBaseControl)))
            {// Tester/editor etc. controls have no components, they are standalone UI components.
                ConstructorInfo info = componentType.GetConstructor(new Type[] { });
                // If failed to find orderInfo, just fall trough to failed to create component (which remains null).
                if (info != null)
                {// Since this is a UI only component, just create and return.
                    CommonBaseControl testerControl = (CommonBaseControl)info.Invoke(new object[] { });
                    /*tabControl.SelectedTab = */ AddComponentControl(testerControl, true);

                    return;
                }
            }
            else
            {
                ConstructorInfo info = componentType.GetConstructor(new Type[] { });
                if (info != null)
                {
                    component = (PlatformComponent)info.Invoke(new object[] { });
                }
            }

            // ...
            if (component == null)
            {
                MessageBox.Show("Failed to create component.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            // Set settings for component.
            if (component.SetInitialState(_platform.Settings) == false)
            {
                MessageBox.Show("Component failed to initialize from initial state.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            if (showPropertiesForm)
            {
                // Show properties for the user to configure.
                PropertiesForm form = new PropertiesForm("Properties", component);
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            // Register to platform.
            _platform.RegisterComponent(component);
        }
 /// <summary>
 ///
 /// </summary>
 public ProxyIntegrationAdapterClient()
     : base(UserFriendlyNameAttribute.GetTypeAttributeName(typeof(ProxyIntegrationAdapterClient)), false)
 {
     this.DefaultTimeOut = TimeSpan.FromSeconds(60);
 }
Ejemplo n.º 11
0
 {// Being a core platfrom component, make sure it component level is very low level.
     /// <summary>
     ///
     /// </summary>
     public PlatformDiagnostics()
         : base(true)
     {
         this.Name = UserFriendlyNameAttribute.GetTypeAttributeName(typeof(PlatformDiagnostics));
     }
Ejemplo n.º 12
0
 /// <summary>
 ///
 /// </summary>
 public MarketWatchComponent()
     : base(UserFriendlyNameAttribute.GetTypeAttributeName(typeof(MarketWatchComponent)), false)
 {
 }
 public virtual bool Initialize()
 {
     this.Name = UserFriendlyNameAttribute.GetTypeAttributeName(typeof(OrderExecutionSourceClientStub));
     return(true);
 }
Ejemplo n.º 14
0
 /// <summary>
 ///
 /// </summary>
 public FFNewsPlatformIndicatorChartSeries()
     : base(UserFriendlyNameAttribute.GetTypeAttributeName(typeof(FFNewsPlatformIndicatorChartSeries)))
 {
 }