/// <summary> /// Visists the given visitor with the specified reference. /// </summary> public static bool Accept(IReferenceNode reference, ISolutionVisitor visitor) { if (visitor.VisitEnter(reference)) { foreach (var node in reference.Nodes) { if (!node.Accept(visitor)) { break; } } } return(visitor.VisitLeave(reference)); }
/// <summary> /// Adapts a <see cref="IReferenceNode"/> to an <see cref="IVsHierarchy"/>. /// </summary> /// <returns>The <see cref="IVsHierarchy"/> or <see langword="null"/> if conversion is not possible.</returns> public static IVsHierarchy AsVsHierarchy(this IReferenceNode reference) => reference.As <IVsHierarchy>();
/// <summary> /// Visists the given visitor with the specified reference. /// </summary> public static bool Accept(IReferenceNode reference, ISolutionVisitor visitor) { if (visitor.VisitEnter(reference)) { foreach (var node in reference.Nodes) { if (!node.Accept(visitor)) break; } } return visitor.VisitLeave(reference); }
/// <summary> /// Ends visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitLeave(IReferenceNode reference) { return(true); }
/// <summary> /// Begins visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitEnter(IReferenceNode reference) { return(true); }
/// <summary> /// Begins visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitEnter(IReferenceNode reference) => true;
public bool VisitEnter(IReferenceNode reference) => false;
/// <summary> /// Begins visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitEnter(IReferenceNode reference) { return true; }
public bool VisitLeave(IReferenceNode reference) { throw new NotSupportedException(); }
public bool VisitLeave (IReferenceNode reference) { throw new NotSupportedException (); }
/// <summary> /// Ends visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitLeave (IReferenceNode reference) => true;
/// <summary> /// Begins visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference children should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitEnter (IReferenceNode reference) => true;
/// <summary> /// Ends visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitLeave(IReferenceNode reference) => true;
/// <summary> /// Adapts a <see cref="IReferenceNode"/> to a VsLang <see cref="Reference"/>. /// </summary> /// <returns>The <see cref="Reference"/> or <see langword="null"/> if conversion is not possible.</returns> public static Reference AsReference(this IReferenceNode reference) => reference.As <Reference>();
/// <summary> /// Ends visiting a project reference. /// </summary> /// <param name="reference">The project reference being visited.</param> /// <returns> /// <see langword="true" /> if the project reference siblings should be visited; <see langword="false" /> otherwise. /// </returns> public virtual bool VisitLeave(IReferenceNode reference) { return true; }
/// <summary> /// Adapts a <see cref="IReferenceNode"/> to an <see cref="IVsHierarchyItem"/>. /// </summary> /// <returns>The <see cref="IVsHierarchyItem"/> or <see langword="null"/> if conversion is not possible.</returns> public static IVsHierarchyItem AsVsHierarchyItem(this IReferenceNode reference) => reference.As <IVsHierarchyItem>();
private void AddrOfLocalVariableNode(IReferenceNode value) { VarInfo vi = helper.GetVariable(value.Variable); if (vi.kind == VarKind.vkLocal) { LocalBuilder lb = vi.lb; il.Emit(OpCodes.Ldloca, lb); } else if (vi.kind == VarKind.vkNonLocal) { FieldBuilder fb = vi.fb; MethInfo cur_mi = smi.Peek(); int dist = (smi.Peek()).num_scope - vi.meth.num_scope; il.Emit(OpCodes.Ldloc, cur_mi.frame); for (int i = 0; i < dist; i++) { il.Emit(OpCodes.Ldfld, cur_mi.disp.parent); cur_mi = cur_mi.up_meth; } il.Emit(OpCodes.Ldflda, fb); } }
public bool VisitLeave(IReferenceNode reference) => false;
public virtual void Visit(IReferenceNode node) { DefaultVisit(node); }
/// <summary> /// Adapts the specified reference to supported target types. /// </summary> /// <param name="reference">The reference to adapt.</param> /// <returns>The entry point that exposes supported target types.</returns> public static IAdaptable <IReferenceNode> Adapt(this IReferenceNode reference) { return(new TreeNodeAdaptable <IReferenceNode>(reference)); }