Пример #1
0
        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);
        }
Пример #2
0
        internal NetNamespaceBrowserInfo(NetAssemblyBrowserInfo assembly, string name)
        {
            Debug.Assert(assembly != null && name != null, "assembly != null && name != null");

            m_assembly = assembly;
            m_name     = name;
        }
Пример #3
0
        internal DescriptionText GetDescription(NetAssemblyBrowserInfo parent)
        {
            if (m_description == null)
            {
                m_description = GetDescriptionInternal(parent);
                Debug.Assert(m_description != null, "m_description != null");
            }

            return(m_description);
        }
Пример #4
0
        public virtual bool RepositoryEquals(IRepositoryBrowserInfo other)
        {
            NetAssemblyBrowserInfo otherAssembly = other as NetAssemblyBrowserInfo;

            if (other == null)
            {
                return(false);
            }

            return(m_assembly == otherAssembly.m_assembly);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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));
            }
        }
Пример #7
0
        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));
            }
        }
Пример #8
0
        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);
            }
        }
Пример #9
0
 private void CreateWrappedObject()
 {
     m_wrapped = m_manager.RealManager.GetAssemblyInfo(m_filePath);
     Debug.Assert(m_wrapped != null, "m_wrapped != null");
 }
Пример #10
0
 public void Dispose()
 {
     m_assembly = null;
 }