private void LoadEntity(Entity entity) { var tab = new TabPage(entity.EntityName); tab.Tag = entity; tabMain.TabPages.Add(tab); // see if we need to make a copy var item = entity; if (entity.StatusCode == EntityStatusCodes.Active) { // make a copy of this entity item = EntityLogic.CopyEntity(entity, _currentRevision); } var editor = new EntityEditor(item, _project); tab.Controls.Add(editor); editor.Dock = DockStyle.Fill; editor.IsDirtyChanged += Editor_IsDirtyChanged; _tabList.Add(new TabData(tab, editor, entity)); }