Exemplo n.º 1
0
        public Wallets(SpendControlForm parentForm)
        {
            InitializeComponent();
            this.parentForm = parentForm;

            this.walletList.View     = System.Windows.Forms.View.Details;
            walletList.FullRowSelect = true;
            ListViewExtender extender = new ListViewExtender(walletList);
            // extend 2nd column
            ListViewButtonColumn buttonAction = new ListViewButtonColumn(2);

            buttonAction.Click     += OnButtonActionClick;
            buttonAction.FixedWidth = true;

            // extend 3nd column
            ListViewButtonColumn buttonAction3 = new ListViewButtonColumn(3);

            buttonAction3.Click     += OnButtonActionClick3;
            buttonAction3.FixedWidth = true;

            // extend 4nd column
            ListViewButtonColumn buttonAction2 = new ListViewButtonColumn(4);

            buttonAction2.Click     += OnButtonActionClick2;
            buttonAction2.FixedWidth = true;

            extender.AddColumn(buttonAction);
            extender.AddColumn(buttonAction2);
            extender.AddColumn(buttonAction3);

            UpdateForm();
        }
Exemplo n.º 2
0
        public DatabaseMaintenanceDlg(ScoutBaseDatabase database, ELEVATIONMODEL model = ELEVATIONMODEL.NONE)
        {
            InitializeComponent();
            lv_Tables.FullRowSelect = true;
            ListViewExtender extender = new ListViewExtender(lv_Tables);
            // extend 4th & 5th column for actions
            ListViewButtonColumn buttonAction1 = new ListViewButtonColumn(3);

            buttonAction1.Click     += OnButtonAction1Click;
            buttonAction1.FixedWidth = true;
            // add extender
            extender.AddColumn(buttonAction1);

            ListViewButtonColumn buttonAction2 = new ListViewButtonColumn(4);

            buttonAction2.Click     += OnButtonAction2Click;
            buttonAction1.FixedWidth = true;
            // add extender
            extender.AddColumn(buttonAction2);
            // add items
            Database = database;
            // get SQLite database to use for, use null füor default
            if (database.GetType() == typeof(ElevationDatabase))
            {
                db = ((ElevationDatabase)Database).GetElevationDatabase(model);
            }
            if (database.GetType() == typeof(PropagationDatabase))
            {
                db = ((PropagationDatabase)Database).GetPropagationDatabase(model);
            }
            Model     = model;
            this.Text = Database.Name;
            this.lbl_Description.Text = Database.Description;
            DataTable dt = Database.GetTableList(db);

            foreach (DataRow row in dt.Rows)
            {
                // add items
                string       tablename    = row[0].ToString();
                ListViewItem lvi_Location = lv_Tables.Items.Add(tablename);
                lvi_Location.SubItems.Add(Database.GetTableDescription(tablename));
                lvi_Location.SubItems.Add(Database.GetTableRowCount(tablename, db).ToString());
                lvi_Location.SubItems.Add("Delete All");
                lvi_Location.SubItems.Add("View");
            }
        }
Exemplo n.º 3
0
        private void SetupListView()
        {
            lvCourses.FullRowSelect = true;
            ListViewExtender     extender         = new ListViewExtender(lvCourses);
            ListViewButtonColumn playCourseButton = new ListViewButtonColumn(1);
            ListViewButtonColumn editCourseButton = new ListViewButtonColumn(2);

            playCourseButton.Click     += PlayCourse;
            editCourseButton.Click     += EditCourse;
            playCourseButton.FixedWidth = true;
            editCourseButton.FixedWidth = true;

            lvCourses.Columns.Add("Kursname", 220, HorizontalAlignment.Left);
            lvCourses.Columns.Add("Spielen", 105, HorizontalAlignment.Left);
            lvCourses.Columns.Add("Editieren", 105, HorizontalAlignment.Left);
            extender.AddColumn(playCourseButton);
            extender.AddColumn(editCourseButton);
        }
Exemplo n.º 4
0
        private void SetupListview()
        {
            lvQuestions.FullRowSelect = true;
            var item1 = new ListViewItem("item1", 0);
            ListViewExtender     extender         = new ListViewExtender(lvQuestions);
            ListViewButtonColumn editItemButton   = new ListViewButtonColumn(2);
            ListViewButtonColumn deleteItemButton = new ListViewButtonColumn(3);

            editItemButton.Click       += EditItem;
            deleteItemButton.Click     += DeleteItem;
            editItemButton.FixedWidth   = true;
            deleteItemButton.FixedWidth = true;

            lvQuestions.Columns.Add("Schwierigkeit", 100, HorizontalAlignment.Left);
            lvQuestions.Columns.Add("Frage", 350, HorizontalAlignment.Left);
            lvQuestions.Columns.Add("Editieren", 94, HorizontalAlignment.Center);
            lvQuestions.Columns.Add("Entfernen", 94, HorizontalAlignment.Center);
            extender.AddColumn(editItemButton);
            extender.AddColumn(deleteItemButton);
        }
Exemplo n.º 5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                ImageList list3 = new ImageList
                {
                    ImageSize = new Size(1, 20)
                };
                ImageList list = list3;
                lvDomains.SmallImageList = list;
                ListViewExtender     extender = new ListViewExtender(lvDomains);
                ListViewButtonColumn column   = new ListViewButtonColumn(1);
                column.Click += new EventHandler <ListViewColumnMouseEventArgs>(OnButtonActionClick);
                extender.AddColumn(column);
                column        = new ListViewButtonColumn(2);
                column.Click += new EventHandler <ListViewColumnMouseEventArgs>(OnButtonActionClick);
                extender.AddColumn(column);
                List <DnsPodApi.Domain> domainList = AppStatus.Default.Api.GetDomainList();
                foreach (DnsPodApi.Domain domain in domainList)
                {
                    ListViewItem item2 = new ListViewItem(domain.Name)
                    {
                        Tag = domain
                    };
                    ListViewItem item = item2;
                    item.SubItems.Add("动态解析");
                    item.SubItems.Add("监控");
                    lvDomains.Items.Add(item);
                }
            }
            catch (Exception exception)
            {
                logger.Error("FDomainList_Load has an error:{0}", new object[] { exception });
                MessageBox.Show(this, exception.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public AircraftDatabaseMaintenanceDlg()
        {
            InitializeComponent();
            lv_Tables.FullRowSelect = true;
            ListViewExtender extender = new ListViewExtender(lv_Tables);
            // extend 4th column
            ListViewButtonColumn buttonAction = new ListViewButtonColumn(3);

            buttonAction.Click     += OnButtonActionClick;
            buttonAction.FixedWidth = true;
            // add extender
            extender.AddColumn(buttonAction);
            // add items
        }
Exemplo n.º 7
0
        public History()
        {
            InitializeComponent();

            lv_result.FullRowSelect = true;
            ListViewExtender extender = new ListViewExtender(lv_result);
            // extend 2nd column
            ListViewButtonColumn buttonAction = new ListViewButtonColumn(6);

            buttonAction.Click     += OnButtonActionClick;
            buttonAction.FixedWidth = true;

            extender.AddColumn(buttonAction);
        }
Exemplo n.º 8
0
        public Main()
        {
            //ToDo: Parametry w kolumnach w Excelu
            InitializeComponent();
            fileProcessor.WorkerReportsProgress      = true;
            fileProcessor.WorkerSupportsCancellation = true;
            fileList.FullRowSelect = true;
            ListViewExtender     extender     = new ListViewExtender(fileList);
            ListViewButtonColumn buttonDelete = new ListViewButtonColumn(0);

            buttonDelete.Click     += OnButtonDeleteClick;
            buttonDelete.FixedWidth = true;
            extender.AddColumn(buttonDelete);
            errorList   = new List <string>();
            saveTo.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\" + DateTime.Today.ToString("D") + " Export.xlsx";
        }
Exemplo n.º 9
0
        public Form1()
        {
            InitializeComponent();
            ListViewExtender extender = new ListViewExtender(listViewMatch);
            // extend 4rd column
            ListViewButtonColumn buttonAction = new ListViewButtonColumn(3);

            buttonAction.Click     += OnButtonActionClick;
            buttonAction.FixedWidth = true;

            extender.AddColumn(buttonAction);

            /*
             * for (int i = 0; i < 10000; i++)
             * {
             *  ListViewItem item = listViewMatch.Items.Add("item" + i);
             *  item.SubItems.Add("button " + i);
             * }
             */
        }
Exemplo n.º 10
0
        public RaceTimingForm()
        {
            Application.EnableVisualStyles();
            InitializeComponent();

            // Add the clock label
            clockLabel = new ClockLabel
            {
                Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,
                Font     = new Font("Microsoft Sans Serif", 25F, FontStyle.Regular, GraphicsUnit.Millimeter, 0),
                Location = new Point(12, 24),
                Name     = "clockLabel",
                Size     = new Size(splitContainer1.Panel1.Size.Width, 166),
            };
            splitContainer1.Panel1.Controls.Add(clockLabel);
            spaceBarLabel.Visible = false;

            Application.ThreadException += (o, e) => ShowExceptionMessageBox(e.Exception);
            AppDomain.CurrentDomain.UnhandledException += (o, e) => ShowExceptionMessageBox((Exception)e.ExceptionObject);

            appController = new ControllerFactory().AppController;
            appController.ClockTime.ClockChangeHandler  += clockLabel.ClockChangeEventListener;
            appController.ClockTime.ClockRunningHandler += ClockTimeOnClockRunningHandler;
            appController.ResultDataChange += ResultsQueueOnNewResult;
            SetTitle();

            // Setup result list view
            var listViewExtender   = new ListViewExtender(resultListView);
            var deleteResultColumn = new ListViewButtonColumn(3)
            {
                FixedWidth = true, DrawIfEmpty = false
            };

            deleteResultColumn.Click += DeleteResult;
            listViewExtender.AddColumn(deleteResultColumn);
            ListResults();

            var webController = new WebController(appController.GetRootUrl());

            webController.Start();
        }
        private void Form1_Shown(object sender, EventArgs e)
        {
            var extender = new ListViewExtender(connectionsListView);

            var buttonAction = new ListViewButtonColumn(0)
            {
                FixedWidth = true
            };

            buttonAction.Click += OnButtonActionClick;

            extender.AddColumn(buttonAction);

            var ops = new ConnectionHelper();

            _projectConnections = ops.Connections;

            if (_projectConnections.Count == 0)
            {
                return;
            }

            connectionsListView.ItemSelectionChanged += ConnectionsListView_ItemSelectionChanged;

            foreach (var projectConnection in _projectConnections)
            {
                connectionsListView.Items.Add(new ListViewItem(projectConnection.ItemArray)
                {
                    Tag = projectConnection.Name /* This is what we need to access a connection string */
                });
            }

            connectionsListView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            connectionsListView.FocusedItem       = connectionsListView.Items[0];
            connectionsListView.Items[0].Selected = true;

            ActiveControl = connectionsListView;
        }
        public ScoutBaseDatabaseMaintenanceDlg()
        {
            InitializeComponent();
            lv_Tables.FullRowSelect = true;
            ListViewExtender extender = new ListViewExtender(lv_Tables);
            // extend 4th column
            ListViewButtonColumn buttonAction = new ListViewButtonColumn(3);

            buttonAction.Click     += OnButtonActionClick;
            buttonAction.FixedWidth = true;
            // add extender
            extender.AddColumn(buttonAction);
            // add items
            ListViewItem lvi_Location = lv_Tables.Items.Add(LocationDesignator.TableName);

            lvi_Location.SubItems.Add("Location info");
            lvi_Location.SubItems.Add(StationData.Database.LocationCount().ToString());
            lvi_Location.SubItems.Add("Delete All Entries");
            ListViewItem lvi_QRV = lv_Tables.Items.Add(QRVDesignator.TableName);

            lvi_QRV.SubItems.Add("QRV info");
            lvi_QRV.SubItems.Add(StationData.Database.QRVCount().ToString());
            lvi_QRV.SubItems.Add("Delete All");
        }
Exemplo n.º 13
0
        /*
         * adds all block from DB to blockList
         * initializes a trainList
         * sets up train tables in CTC window
         *
         */

        public void initializeTrackLayout(List <Line> trackLines)
        {
            systemListView.View          = View.Details;
            systemListView.FullRowSelect = true;
            ListViewExtender     extendo    = new ListViewExtender(systemListView);
            ListViewButtonColumn blockClick = new ListViewButtonColumn(0);

            blockClick.Click     += selBlock;
            blockClick.FixedWidth = true;
            extendo.AddColumn(blockClick);
            ListViewButtonColumn trainClick = new ListViewButtonColumn(2);

            trainClick.Click     += selTrain;
            trainClick.FixedWidth = true;
            extendo.AddColumn(trainClick);
            myBlockList = new List <Block>();
            myLineList  = new List <Line>();
            Block yard = new TrainProject.Block(0, 1);

            myBlockList.Add(yard);
            myTrainList = new List <Train>();
            foreach (Line line in trackLines)
            {
                myLineList.Add(line);
                foreach (Section section in line.sections)
                {
                    if (line.lineId == 2) //red line
                    {
                        foreach (Block block in section.blocks)
                        {
                            {
                                if (block != null)
                                {
                                    myBlockList.Add(block);
                                    block.isOccupied = false;
                                    block.lineId     = 2;
                                    Console.WriteLine(block.line);
                                    block.section = section.name;
                                }
                            }
                        }
                    }
                }
            }

            //add yard
            ListViewItem yrd = new ListViewItem();

            yrd.Text = "Yard";
            systemListView.Items.Add(yrd);


            foreach (Block block in myBlockList)
            {
                if (block.lineId == 2)
                {
                    String       bl   = block.blockNum.ToString();
                    ListViewItem item = new ListViewItem();
                    item.Text = block.blockNum.ToString();
                    item.SubItems.Add("Open");
                    item.SubItems.Add("-");//occupancy
                    systemListView.Items.Add(item);

                    if (block.parentSwitch != null) //check if block is associated with switch
                    {
                        if (block.blockId == block.parentSwitch.sourceBlockId)
                        {
                            int   switchId  = block.parentSwitch.switchId;
                            int   currState = (int)TrackControllerModule.getSwitchState(switchId);
                            Block b         = findBlock(currState);
                            //int currState = (int)TrackControllerWindow.controllerModule.getSwitchState(switchId);
                            if (currState == (b.blockId))
                            {
                                currState = (b.blockNum);
                            }

                            item.SubItems.Add(currState.ToString());
                        }
                    }
                    else
                    {
                        item.SubItems.Add("-"); //switch state
                    }
                    item.SubItems.Add("-");     //crossing state
                }
            }


            //-----------------Green Line--------------------

            systemListView2.View          = View.Details;
            systemListView2.FullRowSelect = true;
            ListViewExtender     extendo2    = new ListViewExtender(systemListView2);
            ListViewButtonColumn blockClick2 = new ListViewButtonColumn(0);

            blockClick2.Click     += selBlock;
            blockClick2.FixedWidth = true;
            extendo2.AddColumn(blockClick2);
            ListViewButtonColumn trainClick2 = new ListViewButtonColumn(2);

            trainClick2.Click     += selTrain;
            trainClick2.FixedWidth = true;
            extendo2.AddColumn(trainClick2);
            foreach (Line line in trackLines)
            {
                foreach (Section section in line.sections)
                {
                    if (line.lineId == 1) //green line
                    {
                        foreach (Block block in section.blocks)
                        {
                            {
                                if (block != null)
                                {
                                    myBlockList.Add(block);
                                    block.isOccupied = false;
                                    block.lineId     = 1;
                                    block.section    = section.name;
                                }
                            }
                        }
                    }
                }
            }

            //add yard
            yrd      = new ListViewItem();
            yrd.Text = "Yard";
            systemListView2.Items.Add(yrd);


            foreach (Block block in myBlockList)
            {
                if (block.lineId == 1)
                {
                    String       bl   = block.blockNum.ToString();
                    ListViewItem item = new ListViewItem();
                    item.Text = block.blockNum.ToString();
                    item.SubItems.Add("Open");
                    item.SubItems.Add("-");//occupancy
                    systemListView2.Items.Add(item);

                    if (block.parentSwitch != null) //check if block is associated with switch
                    {
                        if (block.blockId == block.parentSwitch.sourceBlockId)
                        {
                            int   switchId  = block.parentSwitch.switchId;
                            int   currState = (int)TrackControllerModule.getSwitchState(switchId);
                            Block b         = findBlock(currState);
                            //int currState = (int)TrackControllerWindow.controllerModule.getSwitchState(switchId);
                            if (currState == (b.blockId))
                            {
                                currState = (b.blockNum);
                            }

                            item.SubItems.Add(currState.ToString());
                        }
                    }
                    else
                    {
                        item.SubItems.Add("-"); //switch state
                    }
                    item.SubItems.Add("-");     //crossing state
                }
            }
        }