public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
     this.target ^= (PurityLevel)parameter;
     return this.target;
 }
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
     PurityLevel mask = (PurityLevel)parameter;
     this.target = (PurityLevel)value;
     return ((mask & this.target) != 0);
 }
示例#3
0
 public PureAttribute(PurityLevel pl)
 {
     this.Value = true; purityLevel = pl | PurityLevel.Weak;
 }
示例#4
0
 public PureAttribute(bool value)
 {
     this.Value = value; purityLevel = PurityLevel.Normal | PurityLevel.Weak;
 }
示例#5
0
 public PureAttribute()
 {
     this.Value = true; purityLevel = PurityLevel.Normal | PurityLevel.Weak;
 }
示例#6
0
 string PurityToSearchString(PurityLevel purity) {
     return Convert.ToString((int)purity, 2).PadLeft(3, '0');
 }