Exemplo n.º 1
0
        private void Save()
        {
            if (m_otoClass != null && m_rClass != null)
            {
                if (m_rClass.MeetsRequirement)
                {
                    m_otoClass.SaveValues();

                    if (!m_profile.Saved)
                    {
                        DBProfileHandler.Add(m_profile);
                    }

                    DBProfileHandler.Save();
                }
                else
                {
                    MessageBox.Show("You have not filled out all the required fields", "Incomplete form", MessageBoxButtons.OK);
                }
            }
            else
            {
                MessageBox.Show("There was an error saving this profile", "Save error", MessageBoxButtons.OK);
                Close();
            }
        }
Exemplo n.º 2
0
        private void ParentInterface_Load(object sender, EventArgs e)
        {
            DBProfileHandler.Added   += new Action <DBProfile>(DBProfileHandler_Added);
            DBProfileHandler.Removed += new Action <DBProfile>(DBProfileHandler_Removed);

            DBProfileHandler.Load();

            if (DBProfileHandler.Count == 0)
            {
                DialogResult result = MessageBox.Show("You have no database profiles created.\nWould you like to create one now?", "No profiles detected", MessageBoxButtons.YesNo);
                if (result == DialogResult.Yes)
                {
                    DBProfileEditor editor = new DBProfileEditor();
                    editor.MdiParent = this;
                    editor.Show();
                }
            }

            CharacterEditorInterface newwindow = new CharacterEditorInterface();

            newwindow.MdiParent = this;
            newwindow.Show();
        }