Example #1
0
        private void Load()
        {
            Game = new Game(GameContents.GetFile(Resources.GameConfig));
            ErrorCollection.AddRange(Game.ErrorCollection);

            if (GameContents.GetFile(Resources.UpdateConfig) != null)
            {
                Update = new Update(Game, GameContents.GetFile(Resources.UpdateConfig));
                ErrorCollection.AddRange(Update.ErrorCollection);
            }
        }
Example #2
0
        private void UpdateErrorList()
        {
            if (this.fileManager == null || this.fileManager.CurrentFile == null)
            {
                return;
            }

            #region Get Error List
            bool allowErrors   = this.checkBoxErrors.Checked;
            bool allowWarnings = this.checkBoxWarnings.Checked;
            bool currentOnly   = this.checkBoxCurrentOnly.Checked;

            if (!currentOnly && !lastCurrentOnly)
            {
                return;
            }

            lastCurrentOnly = currentOnly;

            ErrorCollection sourceErrors = null;
            ErrorCollection outputErrors = null;
            if (currentOnly)
            {
                sourceErrors = fileManager.CurrentFile.Errors;
            }
            else
            {
                sourceErrors = new ErrorCollection();
                foreach (ScriptFile sf in this.fileManager.ScriptManager.GetAllSFs())
                {
                    sourceErrors.AddRange(sf.Errors);
                }
            }

            if (allowErrors && allowWarnings)
            {
                outputErrors = sourceErrors;
            }
            else if (allowErrors)
            {
                outputErrors = sourceErrors.GetOnlyErrors();
            }
            else
            {
                outputErrors = sourceErrors.GetOnlyWarnings();
            }
            #endregion

            #region Parse Error List to GridView
            this.errorsGridView.Rows.Clear();

            foreach (Error e in outputErrors)
            {
                DataGridViewRow row = new DataGridViewRow();
                row.CreateCells(this.errorsGridView, e.Message);
                row.Cells[0].ToolTipText = e.FullMessage;
                row.Tag = e;

                this.errorsGridView.Rows.Add(row);
            }
            #endregion
        }