/// <summary>
        /// Finds tokens in the state file whose values match the given referenced item
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="allowInterpolation">if set to <c>true</c>, then include partial matches - i.e. a string interpolation will be emitted.</param>
        /// <returns>Set of matching attributes.</returns>
        public HashSet <JToken> FindId(IReferencedItem id, bool allowInterpolation)
        {
            var context = new FindIdContext(id, allowInterpolation);

            this.Attributes.Accept(new FindIdVisitor(), context);
            return(context.FoundValues);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="FindIdContext"/> class.
 /// </summary>
 /// <param name="referencedItem">The referenced item.</param>
 /// <param name="allowInterpolation">if set to <c>true</c> [allow interpolation].</param>
 public FindIdContext(IReferencedItem referencedItem, bool allowInterpolation)
 {
     this.ReferencedItem     = referencedItem;
     this.AllowInterpolation = allowInterpolation;
 }