Example #1
0
 private void Instance_ServerDisconnected(object sender, ServerAddedEventArgs e)
 {
     UITracker.RemoveServerToTracker(e.ServerIdentity, e.Provider);
     FavoriteControl.RemoveServer(e.ServerIdentity);
     AccountControl.RemoveServer(e.ServerIdentity);
     RemoveServerId(e.ServerIdentity);
 }
Example #2
0
        public void AddDataPaidByComboBox()
        {
            DataTable dt = AccountControl.PaidByDataControl();

            PaidByComboBox.ValueMember   = dt.Columns[0].ColumnName;
            PaidByComboBox.DisplayMember = dt.Columns[1].ColumnName;
            PaidByComboBox.DataSource    = dt;
        }
Example #3
0
        public void AddDataTransactionComboBox()
        {
            DataTable dt = AccountControl.TransactionSelectedDataControl(paidBy);

            TransactionTypeComboBox.ValueMember   = dt.Columns[0].ColumnName;
            TransactionTypeComboBox.DisplayMember = dt.Columns[1].ColumnName;
            TransactionTypeComboBox.DataSource    = dt;
        }
Example #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            AccountControl accountControl = db.AccountControls.Find(id);

            db.AccountControls.Remove(accountControl);
            db.SaveChanges();
            //return RedirectToAction("Index");
            return(Json(new { success = true }));
        }
Example #5
0
        public void onClickAccountEvent(AccountControl tb)
        {
            //la.Text = tb.Table.Name;
            Account account = tb.Account;

            UpdateClickItem(account);

            unCheckTable();
            tb.check();
        }
Example #6
0
        private void RemoveAccount(AccountControl control, Account acc)
        {
            panel_accounts.Controls.Remove(control);
            JArray accs = (JArray)accounts.SelectToken("accounts");
            var    ac   = accs.Where(x => x.SelectToken("name").ToString() == acc.Name).FirstOrDefault();

            accs.Remove(ac);
            accounts["accounts"] = accs;
            File.WriteAllText(Constants.PATHTOACCOUNTS, accounts.ToString());
        }
Example #7
0
 public DataAccess()
 {
     autentification = new Autentefication();
     projectControl  = new ProjectControl();
     taskControl     = new TaskControl();
     commentControl  = new CommentControl();
     accountControl  = new AccountControl();
     statusControl   = new StatusControl();
     historyControl  = new HistoryControl();
 }
Example #8
0
 public ActionResult Edit([Bind(Include = "ID,DURUM,AD,SOYAD,KULLANICIADI,PAROLA,EMAIL,ADMIN,ETAR,DTAR,CEVRIMICIMI")] AccountControl accountControl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(accountControl).State = EntityState.Modified;
         db.SaveChanges();
         //return RedirectToAction("Index");
         return(Json(new { success = true }));
     }
     return(View(accountControl));
 }
 private void SetAccounts(AccountControl accountControl, string accounts)
 {
     if (string.IsNullOrEmpty(accounts) == false)
     {
         accountControl.SetAccounts(accounts);
     }
     else
     {
         accountControl.listBoxAccounts.Items.Clear();
     }
     accountControl.labelRequired.Visible = (accountControl.listBoxAccounts.Items.Count == 0);
 }
Example #10
0
        private void EditPaidByComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            ComboBox cmb = (ComboBox)sender;

            paidBy = Int32.Parse((string)cmb.SelectedValue);
            DataTable dt = AccountControl.TransactionSelectedDataControl(paidBy);

            //  AddDataTransactionComboBox();
            TransactionTypeComboBox.ValueMember   = dt.Columns[0].ColumnName;
            TransactionTypeComboBox.DisplayMember = dt.Columns[1].ColumnName;
            TransactionTypeComboBox.DataSource    = dt;
        }
Example #11
0
        public Main(List<Account> accounts)
            : base(MinSize, Settings.Get)
        {
            this.Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath);

            // Set some standard values
            this.Text = "Password Manager";
            this.MaximizeBox = false;

            // Add the controls
            AccountControl accountControl = new AccountControl();
            this.AddUserControl(new MattyUserControl[] { new AccountListControl(accountControl, accounts), accountControl, new SettingsControl() });
            this.ShowUserControl<AccountListControl>();
        }
Example #12
0
 public void updateData()
 {
     flowLayoutPanel1.Controls.Clear();
     listAccount = AccountController.getController().getList();
     listAccount.ForEach(item =>
     {
         AccountControl ac = new AccountControl();
         ac.Account        = item;
         ac.Parent         = flowLayoutPanel1;
         flowLayoutPanel1.Controls.Add(ac);
         ac.onClick = new AccountControl.onClickAccount(onClickAccountEvent);
         listControl.Add(ac);
     });
 }
Example #13
0
        private void PaintAccountInPanel(Account acc, int index)
        {
            AccountControl control = new AccountControl();

            control.RightClicked += Control_RightClicked;
            control.LeftClicked  += Account_LoadDetail;
            control.Account       = acc;
            control.Location      = new Point(panel_accounts.Location.X - 10, panel_accounts.Location.Y - 70 + (index * (control.Height + 6)));

            Invoke((MethodInvoker) delegate
            {
                panel_accounts.Controls.Add(control);
            });
        }
Example #14
0
        // GET: Yonetim/Login/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AccountControl accountControl = db.AccountControls.Find(id);

            if (accountControl == null)
            {
                return(HttpNotFound());
            }
            return(View(accountControl));
        }
Example #15
0
 private void AccountServices_EditAccountReport(object sender, EditAccountReportEventArgs e)
 {
     if (e.IsApproved)
     {
         Invoke((MethodInvoker) delegate
         {
             Me = e.EditedUser;
             EditAccountDetails(Me);
         });
     }
     else
     {
         AccountControl.TellError("Username already taken !");
     }
 }
Example #16
0
 private void AccountServices_EditAccountReport(object sender, EditAccountReportEventArgs e)
 {
     if (e.IsApproved)
     {
         if (LoginServices.Instance.ModifyUserOfServer(e.EditedUser, e.ServerIdentity))
         {
             MessageBox.Show($"User modified for {e.ServerIdentity.ToString()} to {e.EditedUser.Name} with {e.EditedUser.Rank.ToString()}");
             AccountControl.ModifyUser(e.EditedUser, e.ServerIdentity);
         }
     }
     else
     {
         AccountControl.TellError("Username already taken !");
     }
 }
Example #17
0
 public void EditAccountDetails(User NewUser)
 {
     Invoke((MethodInvoker) delegate
     {
         Text = "Musics - Client  Connected as " + NewUser.Name + " - Rank : " + NewUser.Rank.ToString();
         if (NewUser.Rank == Rank.Viewer)
         {
             SearchControl.EnableUpload(false);
         }
         else
         {
             SearchControl.EnableUpload(true);
         }
         AccountControl.EditAccountDetails(NewUser);
     });
 }
        private void InitializeSSOComponents()
        {
            this.accountControlAppAdmins                    = new AccountControl();
            this.accountControlAppAdmins.Dock               = DockStyle.Fill;
            this.accountControlAppAdmins.minAccounts        = 1;
            this.accountControlAppAdmins.allowGroupAccounts = true;
            this.accountControlAppAdmins.allowLocalAccounts = true;
            this.accountControlAppAdmins.changedAccounts   += new AccountControl.ChangedAccounts(this.AccountControl_ChangedAccounts);
            this.grpAppAdmins.Controls.Add(this.accountControlAppAdmins);

            this.accountControlAppUsers = new AccountControl();
            this.accountControlAppUsers.secondControl      = true;
            this.accountControlAppUsers.Dock               = DockStyle.Fill;
            this.accountControlAppUsers.minAccounts        = 1;
            this.accountControlAppUsers.allowGroupAccounts = true;
            this.accountControlAppUsers.allowLocalAccounts = true;
            this.accountControlAppUsers.changedAccounts   += new AccountControl.ChangedAccounts(this.AccountControl_ChangedAccounts);
            this.grpAppUsers.Controls.Add(this.accountControlAppUsers);
        }
Example #19
0
        private void Control_RightClicked(object sender, EventArgs e)
        {
            object[]       data    = (object[])sender;
            AccountControl control = (AccountControl)data[0];
            Account        acc     = (Account)data[1];
            Point          loc     = (Point)data[2];

            ContextMenu cm = new ContextMenu();


            var itemCopyUser     = cm.MenuItems.Add("Kopiere User");
            var itemCopyPassword = cm.MenuItems.Add("Kopiere Passwort");
            var itemDelete       = cm.MenuItems.Add("Account entfernen");

            cm.Show(control, loc);

            itemDelete.Click       += (sender1, e1) => ItemDelete_Click(sender1, e1, control, acc);
            itemCopyPassword.Click += (sender2, e2) => ItemCopyPassword_Click(acc.Password, e2);
            itemCopyUser.Click     += (sender3, e3) => ItemCopyPassword_Click(acc.Username, e3);
        }
Example #20
0
        private void CreateCustomControlForLauncher(Account account)
        {
            _newSet++;
            var newControl = new AccountControl(metroTabControl2,
                                                AccountControls.Count,
                                                _totalAccounts, _newSet, metroStyleManager, account);

            newControl.StartClick     += NewControlOnStartClick;
            newControl.KillClick      += NewControlOnKillClick;
            newControl.ManageClick    += NewControlOnManageClick;
            newControl.SettingsClick  += NewControlOnSettingsClick;
            newControl.ResetTimeClick += NewControlOnResetTimeClick;
            PopulateAccountSettings(newControl.CmbSettings);
            AccountControls.Add(newControl);
            _totalAccounts++;
            if (_newSet == 10)
            {
                _newSet = 0;
            }
            metroStyleManager.Update();
        }
        public AccountListControl(AccountControl accountControl, List<Account> accounts)
        {
            // Some variables
            this.accounts = accounts;
            this.accountControl = accountControl;
            this.VisibleChanged += (o, e) => { if (this.Visible) this.fillAccounts(); };

            // The controls
            this.tbFilter = new Tb(this);
            this.lbAccounts = new Lb(this);
            this.lbAccounts.MouseDoubleClick += (o, e) => { this.ViewAccount(); };

            // Add standard buttons
            this.btnCreate = new Btn("Create new", this);
            this.btnCreate.Click += (o, e) => { this.CreateAccount(); };
            this.btnView = new Btn("View", this);
            this.btnView.Click += (o, e) => { this.ViewAccount(); };
            this.btnDelete = new Btn("Delete", this);
            this.btnDelete.Click += (o, e) => { this.DeleteAccount(); };
            this.btnSettings = new Btn("Settings", this);
            this.btnSettings.Click += (o, e) => { this.ShowUserControl<SettingsControl>(); };
        }
Example #22
0
 private void textBox7_KeyUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         flowLayoutPanel1.Controls.Clear();
         listAccount = AccountController.getController().getList();
         listAccount.ForEach(item =>
         {
             if (item.Display_Name.ToLower().IndexOf(textBox7.Text.ToLower()) >= 0)
             {
                 AccountControl ac = new AccountControl();
                 ac.Account        = item;
                 ac.Parent         = flowLayoutPanel1;
                 flowLayoutPanel1.Controls.Add(ac);
                 ac.onClick = new AccountControl.onClickAccount(onClickAccountEvent);
                 listControl.Add(ac);
             }
         });
     }
     else
     {
     }
 }
 public UserAddDialog(AccountControl ac)
 {
     this.InitializeComponent();
     _ac = ac;
 }
Example #24
0
 private void ItemDelete_Click(object sender, EventArgs e, AccountControl control, Account acc)
 {
     RemoveAccount(control, acc);
 }
Example #25
0
        void OnEventConnect()
        {
            foreach (var ctor in Xing.querys)
            {
                switch (ctor.GetType().Name)
                {
                case cfobq10500:
                case ccebq10500:
                    if (Account == null)
                    {
                        Account = new AccountControl();
                        panel.Controls.Add(Account);
                        Account.Dock = DockStyle.Fill;
                        Account.Show();
                    }
                    ((IEvents <Deposit>)ctor).Send += Account.OnReceiveDeposit;
                    ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    break;

                case t0441:
                case cceaq50600:
                    if (Balance == null)
                    {
                        Balance = new BalanceControl();
                        panel.Controls.Add(Balance);
                        Balance.Dock = DockStyle.Fill;
                    }
                    ((IEvents <Balance>)ctor).Send += Balance.OnReceiveBalance;
                    ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    break;
                }
                ctor.QueryExcute();
            }
            foreach (var ctor in Xing.reals)
            {
                switch (ctor.GetType().Name)
                {
                case fc0:
                case nc0:
                    if (initial.Equals(collecting) == false)
                    {
                        ((ITrends <Trends>)ctor).SendTrend += Quotes.OnReceiveTrend;
                    }

                    ctor.OnReceiveRealTime(initial.Equals(collecting) ? Open.Code : Strategy.Retrieve.Code);
                    continue;

                case fh0:
                case nh0:
                    if (initial.Equals(collecting))
                    {
                        Open.SendQuotes -= Quotes.OnReceiveQuotes;
                    }

                    ((IEvents <EventHandler.XingAPI.Quotes>)ctor).Send += Quotes.OnReceiveQuotes;
                    ctor.OnReceiveRealTime(initial.Equals(collecting) ? Open.Code : Strategy.Retrieve.Code);
                    continue;

                case jif:
                    ((IEvents <NotifyIconText>)ctor).Send += OnReceiveNotifyIcon;
                    ctor.OnReceiveRealTime(initial.Equals(collecting) ? Open.Code : Strategy.Retrieve.Code);
                    continue;

                default:
                    if (initial.Equals(collecting) == false)
                    {
                        ((IStates <State>)ctor).SendState += Quotes.OnReceiveState;
                        ctor.OnReceiveRealTime(Strategy.Retrieve.Code);
                    }
                    continue;
                }
            }
            if (initial.Equals(collecting) == false)
            {
                Opacity = 0;

                foreach (var ctor in Xing.orders)
                {
                    ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    ((IStates <State>)ctor).SendState             += Quotes.OnReceiveState;
                }
                if (initial.Equals(collecting) == false)
                {
                    Parallel.ForEach(Specify, new Action <Catalog.XingAPI.Specify>((param) =>
                    {
                        switch (param.Strategy)
                        {
                        case basic:
                            new Strategy.XingAPI.Base(param);
                            break;

                        case bantam:
                            new Strategy.XingAPI.Bantam(param);
                            break;

                        case feather:
                            new Strategy.XingAPI.Feather(param);
                            break;

                        case fly:
                            new Strategy.XingAPI.Fly(param);
                            break;

                        case sFly:
                            new Strategy.XingAPI.SuperFly(param);
                            break;

                        case heavy:
                            new Strategy.XingAPI.Heavy(param);
                            break;

                        default:
                            if (param.Time > 0)
                            {
                                new Strategy.XingAPI.Consecutive(param);
                            }

                            break;
                        }
                    }));
                }
            }
            WindowState = Xing.SendNotifyIconText((int)Math.Pow((initial.Equals(collecting) ? Open.Code : Strategy.Retrieve.Code).Length, 4));

            if ((DateTime.Now.Hour > 16 || DateTime.Now.Hour == 15 && DateTime.Now.Minute > 45) && initial.Equals(collecting))
            {
                Temporary = new XingAPI.Temporary(Xing.reals[0], Xing.reals[1], new StringBuilder(1024), key);
            }
        }
Example #26
0
        private void OnReceiveNotifyIcon(object sender, NotifyIconText e)
        {
            switch (e.NotifyIcon.GetType().Name)
            {
            case "StringBuilder":
                strip.ItemClicked += OnItemClick;
                BeginInvoke(new Action(() =>
                {
                    Quotes = new QuotesControl();
                    panel.Controls.Add(Quotes);
                    API.SendQuotes += Quotes.OnReceiveQuotes;
                    Quotes.Dock     = DockStyle.Fill;
                    Account         = new AccountControl();
                    panel.Controls.Add(Account);
                    Account.Dock     = DockStyle.Fill;
                    API.SendDeposit += Account.OnReceiveDeposit;
                    Balance          = new BalanceControl();
                    panel.Controls.Add(Balance);
                    Balance.Dock     = DockStyle.Fill;
                    API.SendBalance += Balance.OnReceiveBalance;
                    Statistical      = new StatisticalControl();
                    panel.Controls.Add(Statistical);
                    Statistical.Dock = DockStyle.Fill;
                    var code         = e.NotifyIcon.ToString().Split(';');
                    var chart        = Retrieve.GetInstance(code[code.Length - 1]).Chart;
                    new Task(() =>
                    {
                        var specify = new Specify
                        {
                            Account  = secret.Accounts,
                            Assets   = 17500000,
                            Code     = code[code.Length - 1],
                            Strategy = "TF",
                            Time     = 30,
                            Short    = 4,
                            Long     = 60
                        };
                        new Trading(API, specify, new Statistic.Quotes(specify, API), chart);
                    }).Start();
                    new Task(() =>
                    {
                        var liquidate = new Specify
                        {
                            Account  = secret.Accounts,
                            Assets   = 17500000,
                            Code     = code[code.Length - 1],
                            Strategy = "WU",
                            Time     = 15,
                            Short    = 4,
                            Long     = 60
                        };
                        new Trading(API, liquidate, new Statistic.Quotes(liquidate, API), chart);
                    }).Start();
                    new Task(() => new Trading(API, new Specify
                    {
                        Account  = secret.Accounts,
                        Assets   = 17500000,
                        Code     = code[code.Length - 1],
                        Strategy = "DL",
                        Time     = 1440,
                        Short    = 4,
                        Long     = 60,
                        Reaction = 531
                    }, chart)).Start();
                    API.SendState += Quotes.OnReceiveState;
                    API.SendTrend += Quotes.OnReceiveTrend;
                    Retrieve.Dispose();
                }));
                return;

            case "String":
                BeginInvoke(new Action(() => Quotes.OnReceiveOrderMsg(e.NotifyIcon.ToString())));
                return;

            case "Byte":
                Account.Show();
                API.SendDeposit -= Account.OnReceiveDeposit;
                Account.Hide();
                Balance.Show();
                API.SendBalance -= Balance.OnReceiveBalance;
                Balance.Hide();
                BackColor        = Color.FromArgb(121, 133, 130);
                Opacity          = 0.8135;
                OnClickMinimized = "quotes";
                WindowState      = FormWindowState.Minimized;
                API.SendState   -= Quotes.OnReceiveState;
                API.SendTrend   -= Quotes.OnReceiveTrend;
                return;

            case "Char":
                Dispose();
                break;
            }
            ;
        }
Example #27
0
        void OnReceiveNotifyIcon(object sender, NotifyIconText e)
        {
            switch (e.NotifyIcon.GetType().Name)
            {
            case dic:
                var temp = (Dictionary <int, string>)e.NotifyIcon;

                if (temp.TryGetValue(0, out string code))
                {
                    notifyIcon.Text = checkDataBase;
                    Open.StartProgress(3605);
                    notifyIcon.Text = secret.GetIdentify();

                    return;
                }
                var first = temp.First();
                notifyIcon.Text = string.Concat(DateTime.Now.ToShortTimeString(), " Remains_", first.Key, " Code_", first.Value);
                return;

            case sb:
                strip.ItemClicked += OnItemClick;
                BeginInvoke(new Action(() =>
                {
                    if (Quotes == null)
                    {
                        Quotes = new QuotesControl();
                        panel.Controls.Add(Quotes);
                        Open.SendQuotes += Quotes.OnReceiveQuotes;
                        Quotes.Dock      = DockStyle.Fill;
                    }
                    if (Account == null)
                    {
                        Account = new AccountControl();
                        panel.Controls.Add(Account);
                        Account.Dock      = DockStyle.Fill;
                        Open.SendDeposit += Account.OnReceiveDeposit;
                    }
                    if (Balance == null)
                    {
                        Balance = new BalanceControl();
                        panel.Controls.Add(Balance);
                        Balance.Dock      = DockStyle.Fill;
                        Open.SendBalance += Balance.OnReceiveBalance;
                    }
                    if (Statistical == null)
                    {
                        Statistical = new StatisticalAnalysis();
                        panel.Controls.Add(Statistical);
                        Statistical.Dock = DockStyle.Fill;
                    }
                    var chart = Retrieve.GetInstance(KeyDecoder.GetWindowsProductKeyFromRegistry(), Open.Code).Chart;
                    var check = e.NotifyIcon.ToString().Split((char)59);
                    Acc       = new string[check.Length - 3];
                    Server    = check[check.Length - 1].Equals(secret.Mock);

                    if (Server ? false : new VerifyIdentity().Identify(check[check.Length - 3], check[check.Length - 2]) == false)
                    {
                        TimerBox.Show(new Secret(check[check.Length - 2]).Identify, secret.GoblinBat, MessageBoxButtons.OK, MessageBoxIcon.Warning, 3750);
                        Dispose();

                        return;
                    }
                    for (int i = 0; i < check.Length - 3; i++)
                    {
                        Acc[i] = check[i];
                    }

                    new Task(() =>
                    {
                        var specify = new Specify
                        {
                            Account  = Acc,
                            Assets   = 17500000,
                            Code     = Open.Code,
                            Strategy = "TF",
                            Time     = 30,
                            Short    = 4,
                            Long     = 60
                        };
                        new Strategy.OpenAPI.Trading(Open, specify, new Strategy.OpenAPI.Quotes(specify, Open), chart);
                    }).Start();
                    new Task(() =>
                    {
                        var liquidate = new Specify
                        {
                            Account  = Acc,
                            Assets   = 17500000,
                            Code     = Open.Code,
                            Strategy = "WU",
                            Time     = 15,
                            Short    = 4,
                            Long     = 60
                        };
                        new Strategy.OpenAPI.Trading(Open, liquidate, new Strategy.OpenAPI.Quotes(liquidate, Open), chart);
                    }).Start();
                    new Task(() => new Strategy.OpenAPI.Trading(Open, new Specify
                    {
                        Account  = Acc,
                        Assets   = 17500000,
                        Code     = Open.Code,
                        Strategy = "DL",
                        Time     = 1440,
                        Short    = 4,
                        Long     = 60,
                        Reaction = 531
                    }, chart)).Start();
                    Open.SendState += Quotes.OnReceiveState;
                    Open.SendTrend += Quotes.OnReceiveTrend;
                    Retrieve.Dispose();
                }));
                return;

            case str:
                BeginInvoke(new Action(() => Quotes.OnReceiveOrderMsg(e.NotifyIcon.ToString())));
                return;

            case bt:
                if (Array.Exists(XingConnect, o => o.Equals(initial)))
                {
                    BeginInvoke(new Action(() =>
                    {
                        Xing            = XingAPI.ConnectAPI.GetInstance(initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code, Strategy.Retrieve.Date);
                        Xing.Send      += OnReceiveNotifyIcon;
                        notifyIcon.Text = string.Concat("Trading Code_", initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code);
                        OnEventConnect();
                        OnClickMinimized = quo;
                        Application.DoEvents();
                    }));
                }
                else
                {
                    Account.Show();
                    Open.SendDeposit -= Account.OnReceiveDeposit;
                    Account.Hide();
                    Balance.Show();
                    Open.SendBalance -= Balance.OnReceiveBalance;
                    Balance.Hide();
                    Open.SendState -= Quotes.OnReceiveState;
                    Open.SendTrend -= Quotes.OnReceiveTrend;
                }
                return;

            case int32:
                if ((int)e.NotifyIcon < 0)
                {
                    if (Temporary != null && initial.Equals(collecting))
                    {
                        Temporary.SetStorage(Open.Code);
                    }

                    Process.Start("shutdown.exe", "-r");
                    Dispose();
                }
                else
                {
                    foreach (var ctor in Xing.querys)
                    {
                        switch (ctor.GetType().Name)
                        {
                        case cfobq10500:
                        case ccebq10500:
                            ((IEvents <Deposit>)ctor).Send -= Account.OnReceiveDeposit;
                            ((IMessage <NotifyIconText>)ctor).SendMessage -= OnReceiveNotifyIcon;
                            Account.Hide();
                            break;

                        case t0441:
                        case cceaq50600:
                            ((IEvents <Balance>)ctor).Send -= Balance.OnReceiveBalance;
                            ((IMessage <NotifyIconText>)ctor).SendMessage -= OnReceiveNotifyIcon;
                            Balance.Hide();
                            break;
                        }
                    }
                    Statistical.Hide();
                    return;
                }
                break;

            case cha:
                switch ((char)e.NotifyIcon)
                {
                case (char)69:
                    new ExceptionMessage(e.NotifyIcon.ToString());
                    Dispose();
                    return;

                case (char)41:
                    if (initial.Equals(trading))
                    {
                        Xing.OnReceiveBalance = false;
                        Process.Start("shutdown.exe", "-r");
                        Dispose();
                    }
                    break;

                case (char)21:
                    if (initial.Equals(trading))
                    {
                        Xing.OnReceiveBalance = true;
                    }

                    break;

                default:
                    return;
                }
                break;

            case boolean:
                break;
            }
        }
Example #28
0
 protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     _ac = new AccountControl();
     _ac.GetUsers();
 }
Example #29
0
 private void Instance_Logged(object sender, LoginEventArgs e)
 {
     AccountControl.AddServer(e.Loggedserveridentity, e.LoggedUser);
     AddServerId(e.Loggedserveridentity);
 }
Example #30
0
        void OnEventConnect()
        {
            foreach (var ctor in Xing.querys)
            {
                switch (ctor.GetType().Name)
                {
                case cfobq10500:
                case ccebq10500:
                    BeginInvoke(new Action(() =>
                    {
                        if (Account == null)
                        {
                            Account = new AccountControl();
                            panel.Controls.Add(Account);
                            Account.Dock = DockStyle.Fill;
                            Account.Show();
                        }
                        ((IEvents <Deposit>)ctor).Send += Account.OnReceiveDeposit;
                        ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    }));
                    break;

                case t0441:
                case cceaq50600:
                    BeginInvoke(new Action(() =>
                    {
                        if (Balance == null)
                        {
                            Balance = new BalanceControl();
                            panel.Controls.Add(Balance);
                            Balance.Dock        = DockStyle.Fill;
                            Balance.SendReSize += OnReceiveSize;
                        }
                        ((IEvents <Balance>)ctor).Send += Balance.OnReceiveBalance;
                        ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    }));
                    break;
                }
                ctor.QueryExcute();
            }
            foreach (var ctor in Xing.reals)
            {
                switch (ctor.GetType().Name)
                {
                case fc0:
                case nc0:
                    if (initial.Equals(trading))
                    {
                        ((ITrends <Trends>)ctor).SendTrend += Quotes.OnReceiveTrend;
                    }

                    ctor.OnReceiveRealTime(initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code);
                    continue;

                case fh0:
                case nh0:
                    if (initial.Equals(collecting))
                    {
                        Open.SendQuotes -= Quotes.OnReceiveQuotes;
                    }

                    ((IEvents <EventHandler.XingAPI.Quotes>)ctor).Send += Quotes.OnReceiveQuotes;
                    ctor.OnReceiveRealTime(initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code);
                    continue;

                case jif:
                    BeginInvoke(new Action(() =>
                    {
                        ((IEvents <NotifyIconText>)ctor).Send += OnReceiveNotifyIcon;

                        if (Statistical == null)
                        {
                            Statistical = new StatisticalAnalysis();
                            panel.Controls.Add(Statistical);
                            Statistical.Dock = DockStyle.Fill;
                        }
                        ctor.OnReceiveRealTime(initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code);
                    }));
                    continue;

                default:
                    if (initial.Equals(trading))
                    {
                        ((IStates <State>)ctor).SendState += Quotes.OnReceiveState;
                        ctor.OnReceiveRealTime(Strategy.Retrieve.Code);
                    }
                    continue;
                }
            }
            if (initial.Equals(trading))
            {
                foreach (var ctor in Xing.orders)
                {
                    ((IMessage <NotifyIconText>)ctor).SendMessage += OnReceiveNotifyIcon;
                    ((IStates <State>)ctor).SendState             += Quotes.OnReceiveState;
                }
                Task.Wait();
                Parallel.ForEach(Specify, new Action <Catalog.XingAPI.Specify>((param) => new Strategy.XingAPI.Base(param)));
            }
            WindowState = Xing.SendNotifyIconText((int)Math.Pow((initial.Equals(trading) ? Strategy.Retrieve.Code : Open.Code).Length, 4));

            if ((DateTime.Now.Hour > 16 || DateTime.Now.Hour == 15 && DateTime.Now.Minute > 45) && initial.Equals(collecting))
            {
                Temporary = new XingAPI.Temporary(Xing.reals[0], Xing.reals[1], new StringBuilder(1024), KeyDecoder.GetWindowsProductKeyFromRegistry());
            }
        }