private void SetSourceDataInternal( SourceData newSd, SourceDataFileDescriptor newSdFileDescriptor, SourceDataChangesCache newSdChangesCache, bool newIsSdCorrect) { var newSdFileDescriptorDiffer = SetSourceDataFileDescriptor(newSdFileDescriptor); var newSdChangesCacheDiffer = SetSourceDataChangesCache(newSdChangesCache); var newSdDiffer = true; if (newSd == null) { if (newSdFileDescriptor == null) { if (SourceData == null) { newSdDiffer = false; } } else if (newSdFileDescriptorDiffer) { LoadSourceDataFromFile(_sourceDataFileDescriptor, false, out newSd); } else { newSdDiffer = false; } } if (newSdDiffer || newSdChangesCacheDiffer) { if (SourceData != null) { UnsubscribeFromSourceDataChanges(); } if (newSdDiffer) { SourceData = newSd; } if (SourceData != null) { _sourceDataChangesCache.ApplyChanges(SourceData); SubscribeToSourceDataChanges(); } } _isSourceDataCorrect = newIsSdCorrect; }
private bool SetSourceDataChangesCache(SourceDataChangesCache newSdChangesCache) { if (newSdChangesCache == null) { return(false); } if (_sourceDataChangesCache == null) { _sourceDataChangesCache = newSdChangesCache; return(true); } if (_sourceDataChangesCache.Equals(newSdChangesCache)) { return(false); } _sourceDataChangesCache = newSdChangesCache; return(true); }
private void SetSourceDataInternal( SourceData newSd, SourceDataFileDescriptor newSdFileDescriptor, SourceDataChangesCache newSdChangesCache, bool newIsSdCorrect) { var newSdFileDescriptorDiffer = SetSourceDataFileDescriptor(newSdFileDescriptor); var newSdChangesCacheDiffer = SetSourceDataChangesCache(newSdChangesCache); var newSdDiffer = true; if (newSd == null) { if (newSdFileDescriptor == null) { if (SourceData == null) newSdDiffer = false; } else if (newSdFileDescriptorDiffer) { LoadSourceDataFromFile(_sourceDataFileDescriptor, false, out newSd); } else { newSdDiffer = false; } } if (newSdDiffer || newSdChangesCacheDiffer) { if (SourceData != null) { UnsubscribeFromSourceDataChanges(); } if (newSdDiffer) SourceData = newSd; if (SourceData != null) { _sourceDataChangesCache.ApplyChanges(SourceData); SubscribeToSourceDataChanges(); } } _isSourceDataCorrect = newIsSdCorrect; }
private bool SetSourceDataChangesCache(SourceDataChangesCache newSdChangesCache) { if (newSdChangesCache == null) return false; if (_sourceDataChangesCache == null) { _sourceDataChangesCache = newSdChangesCache; return true; } if (_sourceDataChangesCache.Equals(newSdChangesCache)) return false; _sourceDataChangesCache = newSdChangesCache; return true; }