private void displayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            userInputWindow = new UserInputWindow();
            lvf             = new ListViewForm();

            bool           open = false;
            FormCollection fc   = Application.OpenForms;

            foreach (Form frm in fc)
            {
                if (frm.Name == "ListViewForm")
                {
                    open = true;
                    frm.Select();
                    break;
                }
            }
            if (open == false)
            {
                lvf.Show();

                displayToolStripMenuItem.Checked = true;  // TODO: Re-size checked icon
            }

            lvf.UncheckToolStripMenuItem += UncheckToolStripMenuItemHandle;

            ClearMeAndListView += lvf.ClearMeAndListViewHandler;

            lvf.ClearMeAndTextBox += ClearMeAndTextBoxHandler;

            lvf.DisplayInputFormExistSecond += DisplayInputFormExistHandler;
        }
示例#2
0
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            //Open and poputate input form

            userInputWindow = new UserInputWindow();

            foreach (var itemList in new_characters)
            {
                if (listView1.SelectedItems.Count > 0 && itemList == listView1.SelectedItems[0].Tag)
                {
                    userInputWindow.textBoxFirstName.Text    = itemList.FirstName;
                    userInputWindow.textBoxLastName.Text     = itemList.LastName;
                    userInputWindow.numericUpDownAge.Value   = itemList.Age;
                    userInputWindow.comboBoxGender.Text      = itemList.Gender;
                    userInputWindow.checkBoxImmortal.Checked = itemList.Immortal;
                    userInputWindow.comboBoxClass.Text       = itemList.Class;
                }
            }

            if (DisplayInputFormExistSecond != null)
            {
                DisplayInputFormExistSecond(this, new EventArgs());
            }

            userInputWindow.Show();
        }
        public void ObjectAddedHandler(object sender, EventArgs e)
        {
            userInputWindow = sender as UserInputWindow;
            Characters c = userInputWindow.Data;

            if (!String.IsNullOrEmpty(c.ToString()))
            {
                new_characters.Add(c);
            }
        }
        public void buttonNewInputWindow_Click(object sender, EventArgs e)
        {
            userInputWindow = new UserInputWindow();
            lvf             = new ListViewForm();

            userInputWindow.ObjectAdded += ObjectAddedHandler;

            userInputWindow.DisplayObjectsStored += DisplayObjectsStoredHandler;

            userInputWindow.DisplayInputFormExist += DisplayInputFormExistHandler;

            userInputWindow.Show();
        }
        public void DisplayObjectsStoredHandler(object sender, EventArgs e)
        {
            userInputWindow = sender as UserInputWindow;

            int count = 0;

            for (int i = 0; i < new_characters.Count; i++)
            {
                count++;
            }

            textBoxObjetsStoredInListView.Text = count.ToString();
        }
        public void DisplayInputFormExistHandler(object sender, EventArgs e)
        {
            userInputWindow = sender as UserInputWindow;

            int count = 0;

            for (int i = 0; i < Application.OpenForms.Count - 1; i++)
            {
                if (Application.OpenForms[i].Visible == true)
                {
                    count++;
                }
            }
            textBoxUserImputWindowsExist.Text = count.ToString();
        }