Esempio n. 1
0
        public bool SetView(string view)
        {
            if (InvokeRequired)
            {
                SetViewCallback d = new SetViewCallback(SetView);
                Invoke(d, new object[] { view });
            }
            else
            {
                View          = view;
                groupBox.Text = View.ToUpper();
                int iconSize = toolStripButton_balance.Height;
                toolStripButton_balance.Image = ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market);
                toolStripButton_last.Image    = ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market);
                pictureBox_price.Image        = ContentManager.ResizeImage(ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market), iconSize, iconSize);
                pictureBox_amount.Image       = ContentManager.ResizeImage(ContentManager.GetSymbolIcon(Exchange.CurrentTicker.symbol), iconSize, iconSize);
                pictureBox_stop.Image         = ContentManager.ResizeImage(ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market), iconSize, iconSize);
                pictureBox_stop.Visible       = false;
                label_stop.Visible            = false;
                numericUpDown_stop.Visible    = false;

                pictureBox_total.Image = ContentManager.ResizeImage(ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market), iconSize, iconSize);

                switch (View)
                {
                case "buy":
                    toolStripButton_buy.Visible  = true;
                    toolStripButton_sell.Visible = false;
                    toolStripLabel_last.Text     = "Lowest Ask:";
                    break;

                case "sell":
                    toolStripButton_buy.Visible  = false;
                    toolStripButton_sell.Visible = true;
                    toolStripLabel_last.Text     = "Highest Bid:";
                    break;

                case "stop-limit":
                    pictureBox_stop.Visible    = true;
                    label_stop.Visible         = true;
                    numericUpDown_stop.Visible = true;
                    //label_price.Text = "Stop:";
                    toolStripLabel_last.Text = "You Have:";

                    toolTip.SetToolTip(numericUpDown_price, "this is the same thing as the 'Price' on a regular buy or sell order. Once your stop-limit order has been triggered by the highest bid (SELL) or lowest ask (BUY) reaching your stop price, it turns into a buy or sell order for the price you enter here.");
                    toolTip.SetToolTip(numericUpDown_stop, "think of this as the 'trigger price'. If you place a stop-limit order to sell, it will turn into a regular limit order when the highest bid drops to or below the stop. If you place a stop-limit order to buy, it will turn into a regular limit order when the lowest ask raises to or exceeds the stop.");
                    toolTip.SetToolTip(numericUpDown_amount, "this is the same as the 'Amount' on a regular buy or sell order. It indicates the amount of coins you wish to buy or sell should your stop-limit order be triggered.");
                    Enabled = false;
                    break;

                default:
                    //AddLogMessage(Name, "OpenForm", "FORM NOT DEFINED!!! : " + name, LogMessageType.DEBUG);
                    break;
                }
                //UpdateUI(true);
            }
            return(true);
        }
Esempio n. 2
0
        public void SetView()
        {
            if (InvokeRequired)
            {
                SetViewCallback d = new SetViewCallback(SetView);
                Invoke(d, new object[] { });
            }
            else
            {
                switch (view)
                {
                case BalanceViewType.symbol:
                    listView.AlwaysGroupByColumn  = column_Symbol;
                    listView.HasCollapsibleGroups = true;
                    listView.ShowGroups           = true;

                    column_Symbol.IsVisible       = false;
                    column_SymbolIcon.IsVisible   = false;
                    column_ExchangeIcon.IsVisible = true;
                    column_Balance.IsVisible      = true;

                    //listView.RebuildColumns();
                    toolStripButton_collapse.Visible = true;
                    listView.BackColor = PreferenceManager.preferences.Theme.AlternateBackground;
                    //listView.BackgroundImage = null;
                    //listView.BackColor = Color.LightGray;
                    BackColor = PreferenceManager.preferences.Theme.AlternateBackground;

                    //BackgroundImage = null;
                    //BackColor = Color.LightGray;
                    //listView.SetObjects(list);
                    //listView.Sort(column_Symbol, SortOrder.Ascending);

                    //groups = true;
                    //collapsed = false;
                    //toggleCollapsed();

                    break;

                case BalanceViewType.exchange:
                    listView.AlwaysGroupByColumn  = column_Exchange;
                    listView.HasCollapsibleGroups = true;
                    listView.ShowGroups           = true;

                    column_Symbol.IsVisible       = true;
                    column_SymbolIcon.IsVisible   = true;
                    column_ExchangeIcon.IsVisible = false;
                    column_Balance.IsVisible      = true;

                    //listView.RebuildColumns();
                    toolStripButton_collapse.Visible = true;
                    listView.BackColor = PreferenceManager.preferences.Theme.AlternateBackground;
                    BackColor          = PreferenceManager.preferences.Theme.AlternateBackground;
                    //listView.SetObjects(list);
                    //listView.Sort(column_Exchange, SortOrder.Ascending);
                    //groups = true;
                    //collapsed = false;
                    //toggleCollapsed();
                    break;

                case BalanceViewType.balance:
                    listView.AlwaysGroupByColumn  = null;
                    listView.HasCollapsibleGroups = false;
                    listView.ShowGroups           = false;

                    column_Symbol.IsVisible       = true;
                    column_SymbolIcon.IsVisible   = true;
                    column_ExchangeIcon.IsVisible = true;
                    column_Balance.IsVisible      = true;

                    //listView.RebuildColumns();
                    toolStripButton_collapse.Visible = false;
                    listView.BackColor = PreferenceManager.preferences.Theme.FormBackground;
                    BackColor          = PreferenceManager.preferences.Theme.FormBackground;
                    //listView.SetObjects(list);
                    //listView.Sort(column_TotalInBTC, SortOrder.Descending);

                    //groups = true;
                    //collapsed = false;
                    //toggleCollapsed();

                    //groups = false;

                    break;

                default:

                    break;
                }
                UpdateUI(true);
            }
        }
Esempio n. 3
0
        public void SetView()
        {
            if (InvokeRequired)
            {
                SetViewCallback d = new SetViewCallback(SetView);
                Invoke(d, new object[] { });
            }
            else
            {
                switch (view)
                {
                case BalanceViewType.symbol:
                    listView.AlwaysGroupByColumn  = column_Symbol;
                    listView.HasCollapsibleGroups = true;
                    listView.ShowGroups           = true;

                    column_Symbol.IsVisible = false;
                    //column_SymbolIcon.IsVisible = false;
                    column_ExchangeIcon.IsVisible = true;
                    column_Balance.IsVisible      = true;

                    listView.RebuildColumns();
                    toolStripButton_collapse.Visible = true;
                    listView.BackColor = PreferenceManager.preferences.Theme.AlternateBackground;

                    //BackColor = PreferenceManager.preferences.Theme.AlternateBackground;
                    break;

                case BalanceViewType.exchange:
                    listView.AlwaysGroupByColumn  = column_Exchange;
                    listView.HasCollapsibleGroups = true;
                    listView.ShowGroups           = true;

                    column_Symbol.IsVisible = true;
                    //column_SymbolIcon.IsVisible = true;
                    column_ExchangeIcon.IsVisible = false;
                    column_Balance.IsVisible      = true;

                    listView.RebuildColumns();
                    toolStripButton_collapse.Visible = true;
                    listView.BackColor = PreferenceManager.preferences.Theme.AlternateBackground;

                    //BackColor = PreferenceManager.preferences.Theme.AlternateBackground;
                    break;

                case BalanceViewType.balance:
                    listView.AlwaysGroupByColumn  = null;
                    listView.HasCollapsibleGroups = false;
                    listView.ShowGroups           = false;

                    column_Symbol.IsVisible = true;
                    //column_SymbolIcon.IsVisible = true;
                    column_ExchangeIcon.IsVisible = true;
                    column_Balance.IsVisible      = true;

                    listView.RebuildColumns();
                    toolStripButton_collapse.Visible = false;
                    listView.BackColor = PreferenceManager.preferences.Theme.FormBackground;
                    BackColor          = PreferenceManager.preferences.Theme.FormBackground;
                    break;

                default:

                    break;
                }

                /*
                 * if (listView.Columns.Count > 0)
                 * {
                 *  listView.RebuildColumns();
                 * }
                 */
                UpdateUI(true);
            }
        }