internal ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes()
            {
                int num = 0;

                foreach (DictionaryEntry entry in this._remoteTypeInfo)
                {
                    if (entry.Value is ActivatedClientTypeEntry)
                    {
                        num++;
                    }
                }
                ActivatedClientTypeEntry[] entryArray = new ActivatedClientTypeEntry[num];
                int num2 = 0;

                foreach (DictionaryEntry entry3 in this._remoteTypeInfo)
                {
                    ActivatedClientTypeEntry entry4 = entry3.Value as ActivatedClientTypeEntry;
                    if (entry4 != null)
                    {
                        string appUrl = null;
                        System.Runtime.Remoting.RemoteAppEntry remoteAppEntry = entry4.GetRemoteAppEntry();
                        if (remoteAppEntry != null)
                        {
                            appUrl = remoteAppEntry.GetAppURI();
                        }
                        ActivatedClientTypeEntry entry6 = new ActivatedClientTypeEntry(entry4.TypeName, entry4.AssemblyName, appUrl)
                        {
                            ContextAttributes = entry4.ContextAttributes
                        };
                        entryArray[num2++] = entry6;
                    }
                }
                return(entryArray);
            }
            internal WellKnownClientTypeEntry[] GetRegisteredWellKnownClientTypes()
            {
                int num = 0;

                foreach (DictionaryEntry entry in this._remoteTypeInfo)
                {
                    if (entry.Value is WellKnownClientTypeEntry)
                    {
                        num++;
                    }
                }
                WellKnownClientTypeEntry[] entryArray = new WellKnownClientTypeEntry[num];
                int num2 = 0;

                foreach (DictionaryEntry entry3 in this._remoteTypeInfo)
                {
                    WellKnownClientTypeEntry entry4 = entry3.Value as WellKnownClientTypeEntry;
                    if (entry4 != null)
                    {
                        WellKnownClientTypeEntry entry5 = new WellKnownClientTypeEntry(entry4.TypeName, entry4.AssemblyName, entry4.ObjectUrl);
                        System.Runtime.Remoting.RemoteAppEntry remoteAppEntry = entry4.GetRemoteAppEntry();
                        if (remoteAppEntry != null)
                        {
                            entry5.ApplicationUrl = remoteAppEntry.GetAppURI();
                        }
                        entryArray[num2++] = entry5;
                    }
                }
                return(entryArray);
            }
            internal void AddWellKnownClientType(WellKnownClientTypeEntry entry)
            {
                if (this.CheckForRedirectedClientType(entry.TypeName, entry.AssemblyName))
                {
                    throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_TypeAlreadyRedirected"), new object[] { entry.TypeName, entry.AssemblyName }));
                }
                if (this.CheckForServiceEntryWithType(entry.TypeName, entry.AssemblyName))
                {
                    throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_CantRedirectActivationOfWellKnownService"), new object[] { entry.TypeName, entry.AssemblyName }));
                }
                string applicationUrl = entry.ApplicationUrl;

                System.Runtime.Remoting.RemoteAppEntry entry2 = null;
                if (applicationUrl != null)
                {
                    entry2 = (System.Runtime.Remoting.RemoteAppEntry) this._remoteAppInfo[applicationUrl];
                    if (entry2 == null)
                    {
                        entry2 = new System.Runtime.Remoting.RemoteAppEntry(applicationUrl, applicationUrl);
                        this._remoteAppInfo.Add(applicationUrl, entry2);
                    }
                }
                if (entry2 != null)
                {
                    entry.CacheRemoteAppEntry(entry2);
                }
                string key = this.EncodeTypeAndAssemblyNames(entry.TypeName, entry.AssemblyName);

                this._remoteTypeInfo.Add(key, entry);
            }
            internal ActivatedClientTypeEntry QueryRemoteActivate(string typeName, string assemblyName)
            {
                string str = this.EncodeTypeAndAssemblyNames(typeName, assemblyName);
                ActivatedClientTypeEntry entry = this._remoteTypeInfo[str] as ActivatedClientTypeEntry;

                if (entry == null)
                {
                    return(null);
                }
                if (entry.GetRemoteAppEntry() == null)
                {
                    System.Runtime.Remoting.RemoteAppEntry entry2 = (System.Runtime.Remoting.RemoteAppEntry) this._remoteAppInfo[entry.ApplicationUrl];
                    if (entry2 == null)
                    {
                        throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Activation_MissingRemoteAppEntry"), new object[] { entry.ApplicationUrl }));
                    }
                    entry.CacheRemoteAppEntry(entry2);
                }
                return(entry);
            }
 internal void AddWellKnownClientType(WellKnownClientTypeEntry entry)
 {
     if (this.CheckForRedirectedClientType(entry.TypeName, entry.AssemblyName))
     {
         throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_TypeAlreadyRedirected"), new object[] { entry.TypeName, entry.AssemblyName }));
     }
     if (this.CheckForServiceEntryWithType(entry.TypeName, entry.AssemblyName))
     {
         throw new RemotingException(string.Format(CultureInfo.CurrentCulture, Environment.GetResourceString("Remoting_Config_CantRedirectActivationOfWellKnownService"), new object[] { entry.TypeName, entry.AssemblyName }));
     }
     string applicationUrl = entry.ApplicationUrl;
     System.Runtime.Remoting.RemoteAppEntry entry2 = null;
     if (applicationUrl != null)
     {
         entry2 = (System.Runtime.Remoting.RemoteAppEntry) this._remoteAppInfo[applicationUrl];
         if (entry2 == null)
         {
             entry2 = new System.Runtime.Remoting.RemoteAppEntry(applicationUrl, applicationUrl);
             this._remoteAppInfo.Add(applicationUrl, entry2);
         }
     }
     if (entry2 != null)
     {
         entry.CacheRemoteAppEntry(entry2);
     }
     string key = this.EncodeTypeAndAssemblyNames(entry.TypeName, entry.AssemblyName);
     this._remoteTypeInfo.Add(key, entry);
 }