protected virtual void Commit(ComponentGroup cGroup) { Contract.Assert(cGroup != null); var oldCGroup = ComponentGroups.SafeGet(cGroup.Offset); if (oldCGroup != null) { oldCGroup.Update(cGroup); try { OnComponentGroupModified?.Invoke(new SMComponentGroupEventArgs(Core.SM, cGroup)); } catch (Exception ex) { LogTo.Error(ex, "Error while signaling ComponentGroup Update"); } } else { ComponentGroups[cGroup.Offset] = cGroup; try { OnComponentGroupCreated?.Invoke(new SMComponentGroupEventArgs(Core.SM, cGroup)); } catch (Exception ex) { LogTo.Error(ex, "Error while signaling ComponentGroup Update"); } } }
/// <inheritdoc /> public IComponentGroup this[int offset] => ComponentGroups.SafeGet(offset);