コード例 #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));
        }
コード例 #2
0
        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());
        }
コード例 #3
0
ファイル: Classes.cs プロジェクト: ErikWahlstrom/Gu.State
        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));
        }
コード例 #4
0
 public override bool EqualByMethod <T>(T x, T y, ReferenceHandling referenceHandling)
 {
     return(EqualBy.PropertyValues(x, y, referenceHandling));
 }
コード例 #5
0
 public bool EqualByPropertyValues()
 {
     return(EqualBy.PropertyValues(this.x, this.y));
 }