Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
 /// <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>();
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
 /// <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);
 }
Exemplo n.º 5
0
 /// <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);
 }
Exemplo n.º 6
0
 /// <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;
Exemplo n.º 7
0
 public bool VisitEnter(IReferenceNode reference) => false;
		public bool VisitEnter(IReferenceNode reference) => false;
Exemplo n.º 9
0
 /// <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;
 }
Exemplo n.º 10
0
 public bool VisitLeave(IReferenceNode reference)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 11
0
		public bool VisitLeave (IReferenceNode reference)
		{
			throw new NotSupportedException ();
		}
Exemplo n.º 12
0
		/// <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;
Exemplo n.º 13
0
		/// <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;
Exemplo n.º 14
0
 /// <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;
Exemplo n.º 15
0
 /// <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>();
Exemplo n.º 16
0
 /// <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;
 }
Exemplo n.º 17
0
 /// <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>();
Exemplo n.º 18
0
 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);
 }
Exemplo n.º 21
0
 public bool VisitLeave(IReferenceNode reference) => false;
Exemplo n.º 22
0
 /// <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));
 }