public DependencyPropertyValueRule(IStyleSelector selector, ValueDeclaration <TValue> declaration) { Selector = selector; _hashCode = selector.GetHashCode() & declaration.GetHashCode(); Declaration = declaration; }
public JsonNode CreateKeyValuePair(TextRange textRange, KeyDeclaration key, ValueDeclaration value) { Assume.NotNull(textRange, nameof(textRange)); Assume.NotNull(key, nameof(key)); Assume.NotNull(value, nameof(value)); return(new KeyValueDeclaration(key, value, textRange)); }
/// <summary> /// Fetch Type Declaration, and tests if it's equal or derived from a specific TypeNode /// Fails if declaration is not of a Type /// </summary> public ValueDeclaration FetchValue(String name, System.Type expected) { ValueDeclaration vdecl = FetchValue(name); if (vdecl == null || !vdecl.ISA(expected)) { throw new InvalidIdentifier("Invalid value '" + vdecl + "'. Required '" + expected + "'"); } return(vdecl); }
/// <summary> /// Parametric Check function for ValueDeclaration. Returns null if not found /// </summary> public T CheckValue <T>(String name) where T : ValueDeclaration { ValueDeclaration decl = GetDeclaration(name) as ValueDeclaration; if (decl == null || !(decl is T)) { return(null); } return((T)decl); }
/// <summary> /// Fetch Value Declaration. /// Fails if declaration is not of a Type /// </summary> public ValueDeclaration FetchValue(String name) { Declaration decl = GetDeclaration(name); if (decl == null) { throw new DeclarationNotFound(name); } if (!(decl is ValueDeclaration)) { throw new InvalidIdentifier("Identifier '" + name + "' does not refer to a value decla"); } ValueDeclaration tdecl = (ValueDeclaration)decl; return(tdecl); }
public virtual T Visit(ValueDeclaration node) { return(Visit((Declaration)node)); }
public JsonNode CreateKeyValuePair(TextRange textRange, KeyDeclaration key, ValueDeclaration value) { Assume.NotNull(textRange, nameof(textRange)); Assume.NotNull(key, nameof(key)); Assume.NotNull(value, nameof(value)); return new KeyValueDeclaration(key, value, textRange); }
public override bool Visit(ValueDeclaration node) { Visit((Declaration)node); return(true); }