Ejemplo n.º 1
0
        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");
                }
            }
        }
Ejemplo n.º 2
0
 /// <inheritdoc />
 public IComponentGroup this[int offset] => ComponentGroups.SafeGet(offset);