public static void CheckForUpdate(string pathSystem,
                                          ToolStripMenuItem liveContent,
                                          ToolStripMenuItem forex,
                                          LinkPanel usefulLinks,
                                          LinkPanel forexBrokers)
        {
            miLiveContent = liveContent;
            miForex = forex;
            pnlUsefulLinks = usefulLinks;
            pnlForexBrokers = forexBrokers;

            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();
        }
        public static void CheckForUpdate(string pathSystem,
                                          ToolStripMenuItem liveContent,
                                          ToolStripMenuItem forex,
                                          LinkPanel usefulLinks,
                                          LinkPanel forexBrokers)
        {
            miLiveContent   = liveContent;
            miForex         = forex;
            pnlUsefulLinks  = usefulLinks;
            pnlForexBrokers = forexBrokers;

            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();
        }
Beispiel #3
0
        /// <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();
        }