TESVSnip.Domain.Model.Plugin.InsertRecord C# (CSharp) Method

InsertRecord() public method

public InsertRecord ( int idx, BaseRecord br ) : void
idx int
br BaseRecord
return void
        public override void InsertRecord(int idx, BaseRecord br)
        {
            var r = br as Rec;
            if (r == null)
            {
                throw new TESParserException("Record to add was not of the correct type." + Environment.NewLine + "PluginList can only hold Groups or Records.");
            }

            r.Parent = this;
            if (idx < 0 || idx > this.records.Count)
            {
                idx = this.records.Count;
            }

            this.records.Insert(idx, r);
            this.InvalidateCache();
            FireRecordListUpdate(this, this);
        }