void SetupDefaultPlatform() { this.tabControl.SuspendLayout(); this.tabControl.Visible = false; // Harry-RS FxpaSource fxpaSource = new FxpaSource(); fxpaSource.SetInitialState(fxpaBaseForm.Settings); fxpaBaseForm.RegisterComponent(fxpaSource); LocalAnalyzerHost host = new LocalAnalyzerHost("Manual Trading", typeof(ProfessionalAnalyzer)); fxpaBaseForm.RegisterComponent(host); //Thread.Sleep(250); ProfessionalAnalyzer expert = (ProfessionalAnalyzer)host.Analyzer; this.tabControl.ResumeLayout(); this.tabControl.Visible = true; }
void createItem_Click(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; Type type = (Type)item.Tag; IFxpaBaseCompoent component = null; if (type.IsSubclassOf(typeof(Analyzer))) { component = new LocalAnalyzerHost(CustomNameAttribute.GetClassAttributeName(type), type); } else { ConstructorInfo info = type.GetConstructor(new Type[] { }); if (info != null) { component = (IFxpaBaseCompoent)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(fxpaBaseForm.Settings) == false) { MessageBox.Show("Component failed to initialize from initial state.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // Register to platform. fxpaBaseForm.RegisterComponent(component); }
/// <summary> /// /// </summary> public FxAnalyzerHostControl(LocalAnalyzerHost expertHost) { InitializeComponent(); Initialize(expertHost); }