Ejemplo n.º 1
0
        public Register()
        {
            InitializeComponent();
            nameApp.Text        = Program.appName + " - V" + Program.appVersion.Major + "." + Program.appVersion.Minor; //Retrieve app name from Program.cs and set into UI;
            Pombos.registerForm = this;
            feedBackLB.Visible  = false;

            #region Set native Font
            PomBot.LoadFont(this);
            #endregion
        }
Ejemplo n.º 2
0
        private void InitializeMainForm()
        {
            dateLB.Text = DateTime.Now.ToString("dd/MMM/yyyy-HH:mm ");
            timer1.Start();                                                                                        //Timer to control clock and DDE connection status update
            winNameLB.Text = Program.appName + " - V" + Program.appVersion.Major + "." + Program.appVersion.Minor; //Retrieve app name from Program.cs and set into UI
            versionLB.Text = $"Version: {Program.appVersion.ToString()}";
            //updateRSI = false;
            this.client              = new DdeClient(dashB.app, dashB.service);
            this.clientVWAP          = new DdeClient(dashB.app, dashB.service);
            this.clientHOR           = new DdeClient(dashB.app, dashB.service);
            clientHOR.Disconnected  += OnDisconnected;
            clientVWAP.Disconnected += OnDisconnected;
            client.Disconnected     += OnDisconnected;

            #region Set native Font
            PomBot.LoadFont(this);
            #endregion

            #region BOTs initialization
            //TODO -> If not possible to instantiate more than 1 bot, remove list and create just one object
            Bot bot1 = new Bot();
            botsList.Add(bot1);
            //connect this form with all bots so bot have access to its directly
            foreach (Bot bot in botsList)
            {
                bot.mainForm = this;
            }
            //BOT forms initialization
            BOTsInit();
            #endregion

            #region MenuItems and UI elements
            menuItems.Add(dashboardPN);
            menuItems.Add(bot1PN);
            menuItems.Add(bot2PN);
            menuItems.Add(bot2PN);
            menuItems.Add(bot3PN);
            menuItems.Add(bot4PN);
            menuItems.Add(helpPN);
            menuItems.Add(aboutPN);
            foreach (Panel item in menuItems)
            {
                item.Location = new Point(166, 67);
                item.Visible  = false;
            }

            dashboardBT.Focus();
            dashboardPN.Visible = true;
            #endregion

            ReadSavedData();

            //DDE Connection
            ConnectDDE();
            //ConnectDDETask();
            //DDEupdateStatusAsync();
            DDEupdateStatus();
            UpdateDDEStrategy();

            //Delegates
            StartMultiThread();

            //Keys Bindings
            InitializeKeys();

            calibrationBot1Bar.Maximum = 100;

            //Check for application Update
            Updater();
        }