Exemple #1
0
        public override bool EqualByMethod <T, TValue>(T x, T y, IEqualityComparer <TValue> comparer, ReferenceHandling referenceHandling = ReferenceHandling.Structural)
        {
            var settings = PropertiesSettings.Build()
                           .AddComparer(comparer)
                           .CreateSettings(referenceHandling);

            return(EqualBy.PropertyValues(x, y, settings));
        }
        public SettingsVm()
        {
            // simulating saving
            this.SaveCommand = new RelayCommand(
                _ => Copy.PropertyValues(this.EditableCopy, this.LastSaved, PropertiesSettings),
                _ => !this.ViewHasErrors && !EqualBy.PropertyValues(this.EditableCopy, this.LastSaved, PropertiesSettings));

            this.UndoAllCommand = new RelayCommand(
                _ => Copy.PropertyValues(this.LastSaved, this.EditableCopy, PropertiesSettings),
                _ => !EqualBy.PropertyValues(this.EditableCopy, this.LastSaved, PropertiesSettings));

            this.ResetCommand = new RelayCommand(_ => this.EditableCopy.Reset());
        }
Exemple #3
0
        public override bool EqualMethod <T>(T x, T y, ReferenceHandling referenceHandling = ReferenceHandling.Structural, string excludedMembers = null, Type ignoredType = null)
        {
            var builder = PropertiesSettings.Build();

            if (excludedMembers != null)
            {
                builder.IgnoreProperty <T>(excludedMembers);
            }

            if (ignoredType != null)
            {
                builder.IgnoreType(ignoredType);
            }

            var settings = builder.CreateSettings(referenceHandling);

            return(EqualBy.PropertyValues(x, y, settings));
        }
Exemple #4
0
 public override bool EqualByMethod <T>(T x, T y, ReferenceHandling referenceHandling)
 {
     return(EqualBy.PropertyValues(x, y, referenceHandling));
 }
 public bool EqualByPropertyValues()
 {
     return(EqualBy.PropertyValues(this.x, this.y));
 }