/// <summary> /// Returns true if OrgApacheJackrabbitOakPluginsDocumentSecondarySecondaryStoreCacProperties instances are equal /// </summary> /// <param name="other">Instance of OrgApacheJackrabbitOakPluginsDocumentSecondarySecondaryStoreCacProperties to be compared</param> /// <returns>Boolean</returns> public bool Equals(OrgApacheJackrabbitOakPluginsDocumentSecondarySecondaryStoreCacProperties other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IncludedPaths == other.IncludedPaths || IncludedPaths != null && IncludedPaths.Equals(other.IncludedPaths) ) && ( EnableAsyncObserver == other.EnableAsyncObserver || EnableAsyncObserver != null && EnableAsyncObserver.Equals(other.EnableAsyncObserver) ) && ( ObserverQueueSize == other.ObserverQueueSize || ObserverQueueSize != null && ObserverQueueSize.Equals(other.ObserverQueueSize) )); }
public IndexingPolicyViewModel(IndexingPolicy policy) { _isCreating = true; // deep clone the indexing policy var json = JsonConvert.SerializeObject(policy); Policy = JsonConvert.DeserializeObject <IndexingPolicy>(json); _isCreating = false; IncludedPaths.ListChanged += (s, e) => { if (IncludedPaths.All(ip => !ip.HasErrors)) { RaisePropertyChanged(nameof(IncludedPaths)); } }; ExcludedPaths.ListChanged += (s, e) => { if (ExcludedPaths.All(ep => !ep.HasErrors)) { RaisePropertyChanged(nameof(ExcludedPaths)); } }; PropertyChanged += (s, e) => { if (e.PropertyName != nameof(IsValid)) { RaisePropertyChanged(nameof(IsValid)); } }; }
protected void OnPolicyChanged() { IncludedPaths.Clear(); foreach (var vm in Policy.IncludedPaths.Select(ip => new IncludedPathViewModel(ip))) { IncludedPaths.Add(vm); } ExcludedPaths.Clear(); foreach (var vm in Policy.ExcludedPaths.Select(ep => new ExcludedPathViewModel(ep))) { ExcludedPaths.Add(vm); } if (_isCreating) { IsChanged = false; } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (IncludedPaths != null) { hashCode = hashCode * 59 + IncludedPaths.GetHashCode(); } if (EnableAsyncObserver != null) { hashCode = hashCode * 59 + EnableAsyncObserver.GetHashCode(); } if (ObserverQueueSize != null) { hashCode = hashCode * 59 + ObserverQueueSize.GetHashCode(); } return(hashCode); } }