예제 #1
0
        private void LoadCharacterButton_Click(object sender, EventArgs e)
        {
            if (_workspaceDir == null || _workspaceDir == String.Empty)
            {
                MessageBox.Show("First you need to set your workspace to use this function!", "Error");
                return;
            }

            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Title            = "Select character to edit";
            ofd.Multiselect      = false;
            ofd.CheckFileExists  = true;
            ofd.InitialDirectory = _workspaceDir;
            ofd.Filter           = "Character|*.char";

            DialogResult dr = ofd.ShowDialog();

            if (dr == DialogResult.OK)
            {
                Model.CharacterRelated.Character ch = FileHandler.FileHandler.Read <Model.CharacterRelated.Character>(ofd.FileName, typeof(Model.CharacterRelated.Character));

                CharacterEditor.MainForm mf = new CharacterEditor.MainForm(ch);
                mf.Ok += new EventHandler(CharacterEditor_Ok);

                mf.ShowDialog();
            }
        }
예제 #2
0
        private void CharacterButton_Click(object sender, EventArgs e)
        {
            if (_workspaceDir == null || _workspaceDir == String.Empty)
            {
                MessageBox.Show("First you need to set your workspace to use this function!", "Error");
                return;
            }

            CharacterEditor.MainForm mf = new CharacterEditor.MainForm();
            mf.Ok += new EventHandler(CharacterEditor_Ok);

            mf.ShowDialog();
        }