/// <summary> /// Stores the list of surveyed surfaces for a site model /// </summary> private void Store(Guid siteModelUid, ISurveyedSurfaces surveyedSurfaces) { using var stream = surveyedSurfaces.ToStream(); if (_writeStorageProxy.WriteStreamToPersistentStore(siteModelUid, SURVEYED_SURFACE_STREAM_NAME, FileSystemStreamType.SurveyedSurfaces, stream, this) == FileSystemErrorStatus.OK) { _writeStorageProxy.Commit(); } // Notify the grid listeners that attributes of this site model have changed. var sender = DIContext.Obtain <ISiteModelAttributesChangedEventSender>(); sender.ModelAttributesChanged(SiteModelNotificationEventGridMutability.NotifyAll, siteModelUid, surveyedSurfacesChanged: true); }
/// <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); } }
/// <summary> /// Stores the list of designs for a site model /// </summary> private void Store(Guid siteModelId, IDesigns designs) { try { using var stream = designs.ToStream(); if (_writeStorageProxy.WriteStreamToPersistentStore(siteModelId, DESIGNS_STREAM_NAME, FileSystemStreamType.Designs, stream, designs) == FileSystemErrorStatus.OK) { _writeStorageProxy.Commit(); } // Notify the mutable and immutable grid listeners that attributes of this site model have changed var sender = DIContext.Obtain <ISiteModelAttributesChangedEventSender>(); sender.ModelAttributesChanged(SiteModelNotificationEventGridMutability.NotifyAll, siteModelId, designsChanged: true); } catch (Exception e) { throw new TRexException("Exception writing updated designs cache element to Ignite", e); } }