/// <summary> /// Gets the project to which a code element belongs, or null if none. /// </summary> public static IProject GetProject(ICodeElementInfo codeElement) { StaticWrapper element = codeElement as StaticWrapper; if (element == null) { return(null); } ReSharperReflectionPolicy policy = element.ReflectionPolicy as ReSharperReflectionPolicy; return(policy != null?policy.GetProject(element) : null); }
/// <summary> /// Gets the declared element resolver associated with the code element, or null if none. /// </summary> public static IDeclaredElementResolver GetDeclaredElementResolver(ICodeElementInfo codeElement) { StaticWrapper element = codeElement as StaticWrapper; if (element == null) { return(null); } ReSharperReflectionPolicy policy = element.ReflectionPolicy as ReSharperReflectionPolicy; return(policy != null?policy.GetDeclaredElementResolver(element) : null); }
/// <summary> /// Determines if two wrappers represent the same object. /// </summary> /// <param name="a">The first wrapper, not null.</param> /// <param name="b">The second wrapper, not null.</param> /// <returns>True if both wrapper represent the same object.</returns> protected internal virtual bool Equals(StaticWrapper a, StaticWrapper b) { return a.Handle.Equals(b.Handle); }
/// <summary> /// Gets a hashcode for a wrapper. /// </summary> /// <param name="wrapper">The wrapper, not null.</param> /// <returns>The wrapper's hash code.</returns> protected internal virtual int GetHashCode(StaticWrapper wrapper) { return wrapper.Handle.GetHashCode(); }
private IDeclaredElement GetDeclaredElement(StaticWrapper element) { return element.Handle as IDeclaredElement; }
protected override IProject GetProject(StaticWrapper element) { IProject project = element.Handle as IProject; if (project != null) return project; IDeclaredElement declaredElement = GetDeclaredElement(element); return declaredElement != null && declaredElement.IsValid() ? GetModule(declaredElement) as IProject : null; }
protected override IDeclaredElementResolver GetDeclaredElementResolver(StaticWrapper element) { IDeclaredElement declaredElement = GetDeclaredElement(element); return new DeclaredElementResolver(declaredElement); }
/// <summary> /// Gets the project to which a code element belongs, or null if none. /// </summary> protected abstract IProject GetProject(StaticWrapper element);
/// <summary> /// Gets the declared element resolver associated with the code element, or null if none. /// </summary> protected abstract IDeclaredElementResolver GetDeclaredElementResolver(StaticWrapper element);