/// <summary> /// Public constructor /// </summary> public Live_Content(string pathSystem, ToolStripMenuItem miLiveContent, ToolStripMenuItem miForex, LinkPanel pnlUsefulLinks, LinkPanel pnlForexBrokers) { this.pathSystem = pathSystem; this.miLiveContent = miLiveContent; this.miForex = miForex; this.pnlUsefulLinks = pnlUsefulLinks; this.pnlForexBrokers = pnlForexBrokers; pathUpdateFile = Path.Combine(pathSystem, "fst-update.xml"); try { LoadConfigFile(); ReadFXBrokers(); SetBrokersInMenu(); SetBrokersInLinkPanel(); ReadLinks(); SetLinksInLinkPanel(); } catch (Exception e) { MessageBox.Show(e.Message, "Config"); } // BackGroundWorker bgWorker = new BackgroundWorker(); bgWorker.DoWork += new DoWorkEventHandler(DoWork); bgWorker.RunWorkerAsync(); }
/// <summary> /// Public constructor /// </summary> public static void CheckForUpdate(string pathSystem, ToolStripMenuItem miLiveContent, ToolStripMenuItem miForex, LinkPanel pnlUsefulLinks, LinkPanel pnlForexBrokers) { _miLiveContent = miLiveContent; _miForex = miForex; _pnlUsefulLinks = pnlUsefulLinks; _pnlForexBrokers = pnlForexBrokers; _pathUpdateFile = Path.Combine(pathSystem, "fst-update.xml"); try { LoadConfigFile(); ReadFxBrokers(); SetBrokersInMenu(); SetBrokersInLinkPanel(); ReadLinks(); SetLinksInLinkPanel(); } catch (Exception exception) { Console.WriteLine(exception.Message); } // BackGroundWorker _bgWorker = new BackgroundWorker(); _bgWorker.DoWork += DoWork; _bgWorker.RunWorkerAsync(); }
/// <summary> /// Sets the controls in tabPageStatus /// </summary> void Initialize_PageStatus() { // tabPageStatus tabPageStatus.Name = "tabPageStatus"; tabPageStatus.Text = Language.T("Status"); tabPageStatus.ImageIndex = 0; tabPageStatus.Resize += new EventHandler(TabPageStatus_Resize); // Panel Connection pnlConnection = new Fancy_Panel(Language.T("Connection Status")); pnlConnection.Parent = tabPageStatus; // lblConnection lblConnection = new Label(); lblConnection.Name = "lblConnection"; lblConnection.Parent = pnlConnection; lblConnection.Text = Language.T("Not Connected. You have to connect to a MetaTrader terminal."); lblConnection.TextAlign = ContentAlignment.MiddleLeft; // Panel Data Info pnlDataInfoBase = new Fancy_Panel(Language.T("Data Info")); pnlDataInfoBase.Parent = tabPageStatus; pnlDataInfoBase.Padding = new Padding(2, (int)pnlDataInfoBase.CaptionHeight, 2, 2); tbxDataInfo = new TextBox(); tbxDataInfo.Parent = pnlDataInfoBase; tbxDataInfo.BorderStyle = BorderStyle.None; tbxDataInfo.Dock = DockStyle.Fill; tbxDataInfo.TabStop = false; tbxDataInfo.Multiline = true; tbxDataInfo.AcceptsReturn = true; tbxDataInfo.AcceptsTab = true; tbxDataInfo.WordWrap = false; tbxDataInfo.ScrollBars = ScrollBars.Vertical; tbxDataInfo.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(204))); pnlDataInfoButtons = new Panel(); pnlDataInfoButtons.Parent = pnlDataInfoBase; pnlDataInfoButtons.Dock = DockStyle.Top; pnlDataInfoButtons.Paint += new PaintEventHandler(PnlDataInfoButtons_Paint); btnShowMarketInfo = new Button(); btnShowMarketInfo.Parent = pnlDataInfoButtons; btnShowMarketInfo.Text = Language.T("Market Info"); btnShowMarketInfo.Click += new EventHandler(BtnShowMarketInfo_Click); btnShowMarketInfo.UseVisualStyleBackColor = true; btnShowAccountInfo = new Button(); btnShowAccountInfo.Parent = pnlDataInfoButtons; btnShowAccountInfo.Text = Language.T("Account Info"); btnShowAccountInfo.Click += new EventHandler(BtnShowAccountInfo_Click); btnShowAccountInfo.UseVisualStyleBackColor = true; btnShowBars = new Button(); btnShowBars.Parent = pnlDataInfoButtons; btnShowBars.Text = Language.T("Loaded Bars"); btnShowBars.Click += new EventHandler(BtnShowBars_Click); btnShowBars.UseVisualStyleBackColor = true; // Panel Market Info pnlMarketInfo = new Info_Panel(Language.T("Market Information")); pnlMarketInfo.Parent = tabPageStatus; // Panel Useful Links pnlUsefulLinks = new LinkPanel(Language.T("Useful Links")); pnlUsefulLinks.Parent = tabPageStatus; // Panel Forex Brokers pnlForexBrokers = new LinkPanel(Language.T("Forex Brokers")); pnlForexBrokers.Parent = tabPageStatus; SetStatusColors(); return; }
/// <summary> /// Sets the controls in tabPageStatus /// </summary> private void InitializePageStatus() { // tabPageStatus TabPageStatus.Name = "tabPageStatus"; TabPageStatus.Text = Language.T("Status"); TabPageStatus.ImageIndex = 0; TabPageStatus.Resize += TabPageStatusResize; // Panel Warning PnlWarning = new FancyPanel { Height = 0, Enabled = false, Visible = false }; // Panel Connection PnlConnection = new FancyPanel(Language.T("Connection Status")) {Parent = TabPageStatus}; // lblConnection LblConnection = new Label { Name = "lblConnection", Parent = PnlConnection, Text = Language.T("Not Connected. You have to connect to a MetaTrader terminal."), TextAlign = ContentAlignment.MiddleLeft }; // Panel Data Info PnlDataInfoBase = new FancyPanel(Language.T("Data Info")) {Parent = TabPageStatus}; PnlDataInfoBase.Padding = new Padding(2, (int) PnlDataInfoBase.CaptionHeight, 2, 2); TbxDataInfo = new TextBox { Parent = PnlDataInfoBase, BorderStyle = BorderStyle.None, Dock = DockStyle.Fill, TabStop = false, Multiline = true, AcceptsReturn = true, AcceptsTab = true, WordWrap = false, ScrollBars = ScrollBars.Vertical, Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((204))) }; PnlDataInfoButtons = new Panel {Parent = PnlDataInfoBase, Dock = DockStyle.Top}; PnlDataInfoButtons.Paint += PnlDataInfoButtons_Paint; BtnShowMarketInfo = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Market Info")}; BtnShowMarketInfo.Click += BtnShowMarketInfoClick; BtnShowMarketInfo.UseVisualStyleBackColor = true; BtnShowAccountInfo = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Account Info")}; BtnShowAccountInfo.Click += BtnShowAccountInfoClick; BtnShowAccountInfo.UseVisualStyleBackColor = true; BtnShowBars = new Button {Parent = PnlDataInfoButtons, Text = Language.T("Loaded Bars")}; BtnShowBars.Click += BtnShowBarsClick; BtnShowBars.UseVisualStyleBackColor = true; PnlMarketInfo = new InfoPanel(Language.T("Market Information")) {Parent = TabPageStatus}; PnlUsefulLinks = new LinkPanel(Language.T("Useful Links")) {Parent = TabPageStatus}; PnlForexBrokers = new LinkPanel(Language.T("Forex Brokers")) {Parent = TabPageStatus}; SetStatusColors(); }
/// <summary> /// Sets the controls in tabPageStatus /// </summary> private void InitializePageStatus() { // tabPageStatus TabPageStatus.Name = "tabPageStatus"; TabPageStatus.Text = Language.T("Status"); TabPageStatus.ImageIndex = 0; TabPageStatus.Resize += TabPageStatusResize; // Panel Warning PnlWarning = new FancyPanel { Height = 0, Enabled = false, Visible = false }; // Panel Connection PnlConnection = new FancyPanel(Language.T("Connection Status")) { Parent = TabPageStatus }; // lblConnection LblConnection = new Label { Name = "lblConnection", Parent = PnlConnection, Text = Language.T("Not Connected. You have to connect to a MetaTrader terminal."), TextAlign = ContentAlignment.MiddleLeft }; // Panel Data Info PnlDataInfoBase = new FancyPanel(Language.T("Data Info")) { Parent = TabPageStatus }; PnlDataInfoBase.Padding = new Padding(2, (int)PnlDataInfoBase.CaptionHeight, 2, 2); TbxDataInfo = new TextBox { Parent = PnlDataInfoBase, BorderStyle = BorderStyle.None, Dock = DockStyle.Fill, TabStop = false, Multiline = true, AcceptsReturn = true, AcceptsTab = true, WordWrap = false, ScrollBars = ScrollBars.Vertical, Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((204))) }; PnlDataInfoButtons = new Panel { Parent = PnlDataInfoBase, Dock = DockStyle.Top }; PnlDataInfoButtons.Paint += PnlDataInfoButtons_Paint; BtnShowMarketInfo = new Button { Parent = PnlDataInfoButtons, Text = Language.T("Market Info") }; BtnShowMarketInfo.Click += BtnShowMarketInfoClick; BtnShowMarketInfo.UseVisualStyleBackColor = true; BtnShowAccountInfo = new Button { Parent = PnlDataInfoButtons, Text = Language.T("Account Info") }; BtnShowAccountInfo.Click += BtnShowAccountInfoClick; BtnShowAccountInfo.UseVisualStyleBackColor = true; BtnShowBars = new Button { Parent = PnlDataInfoButtons, Text = Language.T("Loaded Bars") }; BtnShowBars.Click += BtnShowBarsClick; BtnShowBars.UseVisualStyleBackColor = true; PnlMarketInfo = new InfoPanel(Language.T("Market Information")) { Parent = TabPageStatus }; PnlUsefulLinks = new LinkPanel(Language.T("Useful Links")) { Parent = TabPageStatus }; PnlForexBrokers = new LinkPanel(Language.T("Forex Brokers")) { Parent = TabPageStatus }; SetStatusColors(); }