internal NetTypeBrowserInfo GetTypeInfo(Type type) { Debug.Assert(type != null, "type != null"); NetTypeBrowserInfo typeInfo = (NetTypeBrowserInfo)m_cachedTypes[type]; if (typeInfo == null) { NetAssemblyBrowserInfo assembly = GetAssemblyInfo(type.Assembly); Debug.Assert(assembly != null, "assembly != null"); string nsName = (type.Namespace == null ? NetBrowserSettings.NullNamespaceName : type.Namespace); NetNamespaceBrowserInfo ns = assembly.GetNamespace(nsName); Debug.Assert(ns != null, "ns != null"); // Retrieving the namespaces may add types to CachedTypes, so try to find this type again. typeInfo = (NetTypeBrowserInfo)m_cachedTypes[type]; if (typeInfo == null) { typeInfo = new NetTypeBrowserInfo(type, ns); m_cachedTypes.Add(type, typeInfo); } } return(typeInfo); }
internal NetNamespaceBrowserInfo(NetAssemblyBrowserInfo assembly, string name) { Debug.Assert(assembly != null && name != null, "assembly != null && name != null"); m_assembly = assembly; m_name = name; }
internal DescriptionText GetDescription(NetAssemblyBrowserInfo parent) { if (m_description == null) { m_description = GetDescriptionInternal(parent); Debug.Assert(m_description != null, "m_description != null"); } return(m_description); }
public virtual bool RepositoryEquals(IRepositoryBrowserInfo other) { NetAssemblyBrowserInfo otherAssembly = other as NetAssemblyBrowserInfo; if (other == null) { return(false); } return(m_assembly == otherAssembly.m_assembly); }
public virtual NetAssemblyBrowserInfo GetAssemblyInfo(Assembly assembly) { if (assembly == null) { throw new ArgumentNullException("assembly"); } NetAssemblyBrowserInfo info = (NetAssemblyBrowserInfo)m_cachedAssemblies[assembly]; if (info == null) { info = new NetAssemblyBrowserInfo(assembly, this); m_cachedAssemblies.Add(assembly, info); } return(info); }
public override bool RepositoryEquals(IRepositoryBrowserInfo other) { NetAssemblyBrowserInfo otherAssembly = other as NetAssemblyBrowserInfo; if (otherAssembly == null) { return(false); } // The other object may be a RemoteAssemblyBrowserInfo or just a AssemblyBrowserInfo. RemoteAssemblyBrowserInfo otherRemote = otherAssembly as RemoteAssemblyBrowserInfo; if (otherRemote == null) { return(Wrapped.RepositoryEquals(otherAssembly)); } else { return(Wrapped.RepositoryEquals(otherRemote.Wrapped)); } }
public override bool Equals(object obj) { NetAssemblyBrowserInfo other = obj as NetAssemblyBrowserInfo; if (other == null) { return(false); } // The other object may be a RemoteAssemblyBrowserInfo or just a NetAssemblyBrowserInfo. RemoteAssemblyBrowserInfo otherRemote = other as RemoteAssemblyBrowserInfo; if (otherRemote == null) { return(object.Equals(Wrapped, other)); } else { return(object.Equals(Wrapped, otherRemote.Wrapped)); } }
private DescriptionText GetDescriptionInternal(NetAssemblyBrowserInfo parent) { try { DescriptionBuilder sb = new DescriptionBuilder(true); sb.Append("namespace "); sb.AppendName(m_name); sb.EndFirstLine(); sb.Append(@" Member of "); sb.AppendLink(m_assembly.NodeText, parent); sb.EndLine(); return(sb.GetText()); } catch (System.Exception ex) { throw new ApplicationException("Failed to write the namespace declaration for namespace '" + DisplayName + "' (assembly '" + m_assembly.DisplayName + "') .", ex); } }
private void CreateWrappedObject() { m_wrapped = m_manager.RealManager.GetAssemblyInfo(m_filePath); Debug.Assert(m_wrapped != null, "m_wrapped != null"); }
public void Dispose() { m_assembly = null; }