|
12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace WPFDemo.Bb
- {
- [AttributeUsage(AttributeTargets.Property)]
- public class DataGridColumnOrderAttribute : Attribute
- {
- public static readonly DataGridColumnOrderAttribute Default = new DataGridColumnOrderAttribute(0);
-
- public DataGridColumnOrderAttribute(int order)
- {
- DataGridColumnOrderValue = order;
- }
-
- public virtual int DataGridColumnOrder => DataGridColumnOrderValue;
-
- protected int DataGridColumnOrderValue { get; set; }
-
- public override bool Equals(object obj)
- {
- if (obj == this)
- {
- return true;
- }
-
- return obj is DataGridColumnOrderAttribute other && other.DataGridColumnOrder == DataGridColumnOrder;
- }
-
- public override int GetHashCode()
- {
- return DataGridColumnOrder.GetHashCode();
- }
-
- public override bool IsDefaultAttribute()
- {
- return Equals(Default);
- }
- }
- }
|