Пример #1
0
        public void RemoveControlFromSubItem(EXControlListViewSubItem subitem)
        {
            Control c = subitem.MyControl;

            for (int i = 0; i < _controls.Count; i++)
            {
                if (((EmbeddedControl)_controls[i]).MySubItem == subitem)
                {
                    _controls.RemoveAt(i);
                    subitem.MyControl = null;
                    Controls.Remove(c);
                    c.Dispose();
                    return;
                }
            }
        }
Пример #2
0
        private void SelectAccountForm_Load(object sender, EventArgs e)
        {
            BringToFront();

            WindowState = FormWindowState.Minimized;
            Show();
            WindowState = FormWindowState.Normal;

            lvAcc.BeginUpdate();
            using (var db = new AccountConfigContext())
            {
                foreach (var item in db.Account)
                {
                    EXListViewItem lvItem = new EXListViewItem(item.AuthType.ToString());
                    lvItem.SubItems.Add(new EXControlListViewSubItem()
                    {
                        Text = item.Username
                    });
                    lvItem.SubItems.Add(new EXControlListViewSubItem()
                    {
                        Text = item.GetRuntime()
                    });
                    lvItem.SubItems.Add(new EXControlListViewSubItem()
                    {
                        Text = ""
                    });

                    EXControlListViewSubItem cs = new EXControlListViewSubItem()
                    {
                    };
                    Button b = new Button()
                    {
                        Text   = "START",
                        Height = 55
                    };
                    b.Click += SelectBot_Click;
                    b.Tag    = item;
                    lvItem.SubItems.Add(cs);
                    lvAcc.AddControlToSubItem(b, cs);
                    lvAcc.Items.Add(lvItem);
                }
            }
            lvAcc.EndUpdate();
        }
Пример #3
0
        private void SelectAccountForm_Load(object sender, EventArgs e)
        {
            BringToFront();

            WindowState = FormWindowState.Minimized;
            Show();
            WindowState = FormWindowState.Normal;

            lvAcc.BeginUpdate();
            var accManager = TinyIoC.TinyIoCContainer.Current.Resolve <MultiAccountManager>();

            foreach (var item in accManager.Accounts)
            {
                EXListViewItem lvItem = new EXListViewItem(item.AuthType.ToString());
                lvItem.SubItems.Add(new EXControlListViewSubItem()
                {
                    Text = item.Username
                });
                lvItem.SubItems.Add(new EXControlListViewSubItem()
                {
                    Text = item.GetRuntime()
                });
                lvItem.SubItems.Add(new EXControlListViewSubItem()
                {
                    Text = ""
                });

                EXControlListViewSubItem cs = new EXControlListViewSubItem()
                {
                };
                Button b = new Button()
                {
                    Text   = "START",
                    Height = 55
                };
                b.Click += SelectBot_Click;
                b.Tag    = item;
                lvItem.SubItems.Add(cs);
                lvAcc.AddControlToSubItem(b, cs);
                lvAcc.Items.Add(lvItem);
            }
            lvAcc.EndUpdate();
        }