public bool Equals(ControlWord <T> other) { if (other == null) { return(false); } return(this.Name == other.Name && this.Value?.Equals(other.Value) == true); }
public static ControlWord <bool> Negate(ControlWord <bool> word) { var type = word.GetType(); if (!_factory.TryGetValue(type, out var factory)) { var ctor = type.GetConstructor(new[] { typeof(bool) }); var boolParam = Expression.Parameter(typeof(bool), "value"); factory = (Func <bool, ControlWord <bool> >)Expression.Lambda(Expression.Convert(Expression.New(ctor, boolParam), typeof(ControlWord <bool>)), boolParam).Compile(); _factory[type] = factory; } return(factory(!word.Value)); }
public BorderToken(ControlWord <BorderPosition> side) { Side = side.Value; }