public void Assign(IAlignments source) { Clear(); foreach (var alignment in source) { Add(alignment); } }
/// <summary> /// Stores the list of Alignments for a site model /// </summary> private void Store(Guid siteModelUid, IAlignments alignments) { try { using var stream = alignments.ToStream(); _writeStorageProxy.WriteStreamToPersistentStore(siteModelUid, ALIGNMENTS_STREAM_NAME, FileSystemStreamType.Alignments, stream, this); _writeStorageProxy.Commit(); // Notify the grid listeners that attributes of this site model have changed. var sender = DIContext.Obtain <ISiteModelAttributesChangedEventSender>(); sender.ModelAttributesChanged(SiteModelNotificationEventGridMutability.NotifyAll, siteModelUid, alignmentsChanged: true); } catch (Exception e) { throw new TRexException("Exception writing updated Alignments cache element to Ignite", e); } }