Ejemplo n.º 1
0
        private void CloseFile()
        {
            _json       = null;
            _fileOpened = false;

            Text = "EdiZon ScriptEditor";

            UpdateDataGrids();
            UpdateUI();
            UpdateJSON();
        }
Ejemplo n.º 2
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            _createNew.ShowDialog();
            if (_createNew.ProperExit)
            {
                _json = new EdiZonScript
                {
                    saveFilePaths = _createNew.SaveFilePaths,
                    files         = _createNew.Files,
                    filetype      = _createNew.FileType,
                    titleVersion  = _createNew.TitleVersion,
                    items         = new List <Item>()
                };

                _fileOpened = true;

                UpdateJSON();
                UpdateUI();
            }
        }
Ejemplo n.º 3
0
        private void OpenFile(string file)
        {
            if (File.Exists(file))
            {
                try
                {
                    var readJson = File.ReadAllText(file);
                    _json = JsonConvert.DeserializeObject <EdiZonScript>(readJson);

                    _fileOpened = true;

                    Text = "EdiZon ScriptEditor - " + Path.GetFileName(file);

                    UpdateDataGrids();

                    UpdateUI();
                    UpdateJSON();
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message + "\r\nCheck your json with an online JSON Validator.", "Exception", MessageBoxButtons.OK);
                }
            }
        }