/// <summary> /// Using the control and builder, constructs the final parameter based on what the user has selected. /// </summary> /// <returns>The parameter or null if no parameter can be provided.</returns> public virtual IParameter GetParameter() { var values = Values; if (Parser != null && values != null) { values = Parser.Parse(values); } return(SelectedBuilder.Build(SelectedPath, values)); }
/// <summary> /// Considered equal when the path, builder and parser are equal. /// Note: value is ignored in equality test. /// </summary> public bool Equals(IPartView other) { if (other == null || !(other is IPartViewNode)) { return(false); } var node = (IPartViewNode)other; return(SelectedPath.Equals(node.SelectedPath) && SelectedBuilder.Equals(node.SelectedBuilder) && dbqf.Parsers.Parser.Equals(Parser, node.Parser)); }
/// <summary> /// AdvancedPart considered equal when the path, builder and parser are equal. /// Note: value is ignored in equality test. /// </summary> /// <param name="other"></param> /// <returns></returns> public bool Equals(IPartView other) { if (other == null || !(other is IPartViewNode)) { return(false); } var node = (IPartViewNode)other; return(SelectedPath.Equals(node.SelectedPath) && SelectedBuilder.Equals(node.SelectedBuilder) && Parser.Equals(Parser, node.Parser) && (Values != null ? Values.Equals(node.Values) : true)); }
private void ComputeHash() { unchecked { _hash = 13; if (SelectedPath != null) { _hash = (_hash * 7) + SelectedPath.GetHashCode(); } if (SelectedBuilder != null) { _hash = (_hash * 7) + SelectedBuilder.GetHashCode(); } if (Parser != null) { _hash = (_hash * 7) + Parser.GetHashCode(); } } }
public override int GetHashCode() { unchecked { int hash = 13; if (SelectedPath != null) { hash = (hash * 7) + SelectedPath.GetHashCode(); } if (SelectedBuilder != null) { hash = (hash * 7) + SelectedBuilder.GetHashCode(); } if (Parser != null) { hash = (hash * 7) + Parser.GetHashCode(); } return(hash); } }