Exemplo n.º 1
0
        /* runtime UI tracking */

        /// <summary>
        /// Sets the order log entry list items as they are moved up and down in the listbox.
        /// </summary>
        private void SetLogEntryItemsOrder()
        {
            int labelIndex = 0;

            foreach (object itemChecked in LstLogEntry.CheckedItems)
            {
                if (LstLogEntry.GetItemCheckState(LstLogEntry.Items.IndexOf(itemChecked)) == CheckState.Checked)
                {
                    labelIndex = SetLogEntryLabelVisibility(labelIndex, itemChecked);
                }
            }

            /* Center it */
            TblOutput.Left = ((groupBox2.ClientSize.Width - TblOutput.Width) / 2) + groupBox2.ClientSize.Width;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handles the Click event of the CmdMoveDown control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// ///
        /// <remarks>
        /// Handles order and placement of output log string item
        /// </remarks>
        private void CmdMoveDown_Click(object sender, EventArgs e)
        {
            int        newInd = LstLogEntry.SelectedIndex;
            object     obj    = LstLogEntry.SelectedItem;
            CheckState chk    = LstLogEntry.GetItemCheckState(newInd);

            if (newInd >= LstLogEntry.Items.Count - 1)
            {
                return;
            }
            LstLogEntry.Items.RemoveAt(newInd);
            LstLogEntry.Items.Insert(newInd + 1, obj);
            LstLogEntry.SelectedIndex = newInd + 1;
            LstLogEntry.SetItemCheckState(newInd + 1, chk);
            SetLogEntryItemsOrder();
            SetFormDirty();
        }