public static void RegisterActivatedClientType(Type type, String appUrl)
        {
            ActivatedClientTypeEntry acte =
                new ActivatedClientTypeEntry(type, appUrl);

            RemotingConfiguration.RegisterActivatedClientType(acte);
        } // RegisterActivatedClientType
            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);
            }
        public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
        {
            RemotingConfigHandler.RegisterActivatedClientType(entry);

            // all registrations for activated client types will come through here
            RemotingServices.InternalSetRemoteActivationConfigured();
        } // RegisterActivatedClientType
            internal void AddActivatedClientType(ActivatedClientTypeEntry 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 = (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 void StoreRemoteAppEntries(RemotingXmlConfigFileData configData)
 {
     char[] trimChars = new char[] { '/' };
     foreach (RemotingXmlConfigFileData.RemoteAppEntry entry in configData.RemoteAppEntries)
     {
         string appUri = entry.AppUri;
         if ((appUri != null) && !appUri.EndsWith("/", StringComparison.Ordinal))
         {
             appUri = appUri.TrimEnd(trimChars);
         }
         foreach (RemotingXmlConfigFileData.TypeEntry entry2 in entry.ActivatedObjects)
         {
             ActivatedClientTypeEntry entry3 = new ActivatedClientTypeEntry(entry2.TypeName, entry2.AssemblyName, appUri)
             {
                 ContextAttributes = CreateContextAttributesFromConfigEntries(entry2.ContextAttributes)
             };
             RemotingConfiguration.RegisterActivatedClientType(entry3);
         }
         foreach (RemotingXmlConfigFileData.ClientWellKnownEntry entry4 in entry.WellKnownObjects)
         {
             WellKnownClientTypeEntry entry5 = new WellKnownClientTypeEntry(entry4.TypeName, entry4.AssemblyName, entry4.Url)
             {
                 ApplicationUrl = appUri
             };
             RemotingConfiguration.RegisterWellKnownClientType(entry5);
         }
     }
 }
Example #6
0
 public static ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes()
 {
     lock (channelTemplates)
     {
         ActivatedClientTypeEntry[] entries = new ActivatedClientTypeEntry[activatedClientEntries.Count];
         activatedClientEntries.Values.CopyTo(entries, 0);
         return(entries);
     }
 }
Example #7
0
        /// <summary>Retrieves an array of object types registered on the client as types that will be activated remotely.</summary>
        /// <returns>An array of object types registered on the client as types that will be activated remotely.</returns>
        /// <exception cref="T:System.Security.SecurityException">At least one of the callers higher in the callstack does not have permission to configure remoting types and channels. </exception>
        /// <PermissionSet>
        ///   <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" Flags="RemotingConfiguration" />
        /// </PermissionSet>
        public static ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes()
        {
            Hashtable obj = RemotingConfiguration.channelTemplates;

            ActivatedClientTypeEntry[] result;
            lock (obj)
            {
                ActivatedClientTypeEntry[] array = new ActivatedClientTypeEntry[RemotingConfiguration.activatedClientEntries.Count];
                RemotingConfiguration.activatedClientEntries.Values.CopyTo(array, 0);
                result = array;
            }
            return(result);
        }
Example #8
0
        public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
        {
            lock (channelTemplates)
            {
                if (wellKnownClientEntries.ContainsKey(entry.ObjectType) || activatedClientEntries.ContainsKey(entry.ObjectType))
                {
                    throw new RemotingException("Attempt to redirect activation of type '" + entry.ObjectType.FullName + "' which is already redirected.");
                }

                activatedClientEntries[entry.ObjectType] = entry;
                ActivationServices.EnableProxyActivation(entry.ObjectType, true);
            }
        }
Example #9
0
 // Register a client type that can be activated remotely.
 public static void RegisterActivatedClientType
     (ActivatedClientTypeEntry entry)
 {
     if (entry == null)
     {
         throw new ArgumentNullException("entry");
     }
     lock (typeof(RemotingConfiguration))
     {
         EnsureLoaded();
         if (activatedClientTypes == null)
         {
             activatedClientTypes = new Hashtable();
         }
         activatedClientTypes[entry.ObjectType] = entry;
     }
 }
        internal static ActivatedClientTypeEntry IsRemotelyActivatedClientType(RuntimeType svrType)
        {
            RemotingTypeCachedData reflectionCachedData = InternalRemotingServices.GetReflectionCachedData(svrType);
            string simpleAssemblyName      = reflectionCachedData.SimpleAssemblyName;
            ActivatedClientTypeEntry entry = Info.QueryRemoteActivate(svrType.FullName, simpleAssemblyName);

            if (entry == null)
            {
                string assemblyName = reflectionCachedData.AssemblyName;
                entry = Info.QueryRemoteActivate(svrType.FullName, assemblyName);
                if (entry == null)
                {
                    entry = Info.QueryRemoteActivate(svrType.Name, simpleAssemblyName);
                }
            }
            return(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);
            }
Example #12
0
 internal static object CreateClientProxy(ActivatedClientTypeEntry entry, object[] activationAttributes)
 {
     if (entry.ContextAttributes != null || activationAttributes != null)
     {
         ArrayList props = new ArrayList();
         if (entry.ContextAttributes != null)
         {
             props.AddRange(entry.ContextAttributes);
         }
         if (activationAttributes != null)
         {
             props.AddRange(activationAttributes);
         }
         return(CreateClientProxy(entry.ObjectType, entry.ApplicationUrl, props.ToArray()));
     }
     else
     {
         return(CreateClientProxy(entry.ObjectType, entry.ApplicationUrl, null));
     }
 }
 internal static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
     Info.AddActivatedClientType(entry);
 }
 public static void RegisterActivatedClientType(Type type, String appUrl)
 {
     ActivatedClientTypeEntry acte = 
         new ActivatedClientTypeEntry(type, appUrl);
     RemotingConfiguration.RegisterActivatedClientType(acte);
 } // RegisterActivatedClientType
Example #15
0
		internal static object CreateClientProxy (ActivatedClientTypeEntry entry, object[] activationAttributes)
		{
			if (entry.ContextAttributes != null || activationAttributes != null)
			{
				ArrayList props = new ArrayList ();
				if (entry.ContextAttributes != null) props.AddRange (entry.ContextAttributes);
				if (activationAttributes != null) props.AddRange (activationAttributes);
				return CreateClientProxy (entry.ObjectType, entry.ApplicationUrl, props.ToArray ());
			}
			else
				return CreateClientProxy (entry.ObjectType, entry.ApplicationUrl, null);
		}
	// Register a client type that can be activated remotely.
	public static void RegisterActivatedClientType
				(ActivatedClientTypeEntry entry)
			{
				if(entry == null)
				{
					throw new ArgumentNullException("entry");
				}
				lock(typeof(RemotingConfiguration))
				{
					EnsureLoaded();
					if(activatedClientTypes == null)
					{
						activatedClientTypes = new Hashtable();
					}
					activatedClientTypes[entry.ObjectType] = entry;
				}
			}
Example #17
0
        public static void RegisterActivatedClientType(Type type, string appUrl)
        {
            ActivatedClientTypeEntry entry = new ActivatedClientTypeEntry(type, appUrl);

            RemotingConfiguration.RegisterActivatedClientType(entry);
        }
Example #18
0
 public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
     RemotingConfigHandler.RegisterActivatedClientType(entry);
     RemotingServices.InternalSetRemoteActivationConfigured();
 }
 public static void RegisterActivatedClientType(Type type, string appUrl)
 {
     ActivatedClientTypeEntry entry = new ActivatedClientTypeEntry(type, appUrl);
     RegisterActivatedClientType(entry);
 }
 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;
 }
		public static ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes () 
		{
			lock (channelTemplates)
			{
				ActivatedClientTypeEntry[] entries = new ActivatedClientTypeEntry[activatedClientEntries.Count];
				activatedClientEntries.Values.CopyTo (entries,0);
				return entries;
			}
		}
		public static void RegisterActivatedClientType (ActivatedClientTypeEntry entry) 
		{
			lock (channelTemplates)
			{
				if (wellKnownClientEntries.ContainsKey (entry.ObjectType) || activatedClientEntries.ContainsKey (entry.ObjectType))
					throw new RemotingException ("Attempt to redirect activation of type '" + entry.ObjectType.FullName + "' which is already redirected.");
	
				activatedClientEntries[entry.ObjectType] = entry;
				ActivationServices.EnableProxyActivation (entry.ObjectType, true);
			}
		}
 internal void StoreRemoteAppEntries(RemotingXmlConfigFileData configData)
 {
     char[] trimChars = new char[] { '/' };
     foreach (RemotingXmlConfigFileData.RemoteAppEntry entry in configData.RemoteAppEntries)
     {
         string appUri = entry.AppUri;
         if ((appUri != null) && !appUri.EndsWith("/", StringComparison.Ordinal))
         {
             appUri = appUri.TrimEnd(trimChars);
         }
         foreach (RemotingXmlConfigFileData.TypeEntry entry2 in entry.ActivatedObjects)
         {
             ActivatedClientTypeEntry entry3 = new ActivatedClientTypeEntry(entry2.TypeName, entry2.AssemblyName, appUri) {
                 ContextAttributes = CreateContextAttributesFromConfigEntries(entry2.ContextAttributes)
             };
             RemotingConfiguration.RegisterActivatedClientType(entry3);
         }
         foreach (RemotingXmlConfigFileData.ClientWellKnownEntry entry4 in entry.WellKnownObjects)
         {
             WellKnownClientTypeEntry entry5 = new WellKnownClientTypeEntry(entry4.TypeName, entry4.AssemblyName, entry4.Url) {
                 ApplicationUrl = appUri
             };
             RemotingConfiguration.RegisterWellKnownClientType(entry5);
         }
     }
 }
Example #24
0
            } // CheckForRedirectedClientType
            

            internal void AddActivatedClientType(ActivatedClientTypeEntry entry)
            {
                if (CheckForRedirectedClientType(entry.TypeName, entry.AssemblyName))
                {
                    throw new RemotingException(
                        String.Format(
                            CultureInfo.CurrentCulture, Environment.GetResourceString(
                                "Remoting_Config_TypeAlreadyRedirected"),
                            entry.TypeName, entry.AssemblyName));
                }                 

                if (CheckForServiceEntryWithType(entry.TypeName, entry.AssemblyName))
                {
                   throw new RemotingException(
                       String.Format(
                           CultureInfo.CurrentCulture, Environment.GetResourceString(
                               "Remoting_Config_CantRedirectActivationOfWellKnownService"),
                           entry.TypeName, entry.AssemblyName));
                }
            
                String appUrl = entry.ApplicationUrl;
                RemoteAppEntry appEntry = (RemoteAppEntry)_remoteAppInfo[appUrl];
                if (appEntry == null)
                {
                    appEntry = new RemoteAppEntry(appUrl, appUrl);
                    _remoteAppInfo.Add(appUrl, appEntry);
                }
                    
                if (appEntry != null)
                {
                    entry.CacheRemoteAppEntry(appEntry);
                }
                    
                String index = EncodeTypeAndAssemblyNames(entry.TypeName, entry.AssemblyName);
                _remoteTypeInfo.Add(index, entry);
            } // AddActivatedClientType
Example #25
0
            } // StoreInteropEntries

            internal void StoreRemoteAppEntries(RemotingXmlConfigFileData configData)
            {
                char[] slash = new char[]{'/'};
            
                // add each remote app to the table
                foreach (RemotingXmlConfigFileData.RemoteAppEntry remApp in configData.RemoteAppEntries)
                {
                    // form complete application uri by combining specified uri with app-name
                    //  (make sure appUri ends with slash, and that app name doesn't start,
                    //   with one. then make sure that the combined form has no trailing slashes).
                    String appUri = remApp.AppUri;
                    if ((appUri != null) && !appUri.EndsWith("/", StringComparison.Ordinal))
                        appUri = appUri.TrimEnd(slash);
                        
                    // add each client activated type for this remote app
                    foreach (RemotingXmlConfigFileData.TypeEntry cae in remApp.ActivatedObjects)
                    {
                        ActivatedClientTypeEntry acte = 
                            new ActivatedClientTypeEntry(cae.TypeName, cae.AssemblyName, 
                                                         appUri);
                        acte.ContextAttributes = 
                            CreateContextAttributesFromConfigEntries(cae.ContextAttributes);
                   
                        RemotingConfiguration.RegisterActivatedClientType(acte);
                    }

                    // add each well known object for this remote app
                    foreach (RemotingXmlConfigFileData.ClientWellKnownEntry cwke in remApp.WellKnownObjects)
                    {                    
                        WellKnownClientTypeEntry wke = 
                            new WellKnownClientTypeEntry(cwke.TypeName, cwke.AssemblyName, 
                                                         cwke.Url);
                        wke.ApplicationUrl = appUri;
                        
                        RemotingConfiguration.RegisterWellKnownClientType(wke);
                    }          
                }
            } // StoreRemoteAppEntries            
        public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
        {
            RemotingConfigHandler.RegisterActivatedClientType(entry);

            // all registrations for activated client types will come through here
            RemotingServices.InternalSetRemoteActivationConfigured();
        } // RegisterActivatedClientType
 public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
     RemotingConfigHandler.RegisterActivatedClientType(entry);
     RemotingServices.InternalSetRemoteActivationConfigured();
 }
 public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
   Contract.Requires(entry != null);
   Contract.Requires(entry.AssemblyName != null);
 }
 internal void AddActivatedClientType(ActivatedClientTypeEntry 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 = (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);
 }
Example #30
0
            } // GetRegisteredWellKnownServiceTypes


            internal ActivatedClientTypeEntry[] GetRegisteredActivatedClientTypes()
            {
                // count number of well known client types
                int count = 0;
                foreach (DictionaryEntry dictEntry in _remoteTypeInfo)
                {
                    ActivatedClientTypeEntry entry = dictEntry.Value as ActivatedClientTypeEntry;                
                    if (entry != null)
                        count++;
                }
                            
                ActivatedClientTypeEntry[] entries =
                    new ActivatedClientTypeEntry[count];

                int co = 0;
                foreach (DictionaryEntry dictEntry in _remoteTypeInfo)
                {
                    ActivatedClientTypeEntry entry = dictEntry.Value as ActivatedClientTypeEntry;

                    if (entry != null)
                    {
                        // retrieve application url
                        String appUrl = null;
                        RemoteAppEntry remApp = entry.GetRemoteAppEntry();
                        if (remApp != null)
                            appUrl = remApp.GetAppURI();  
                    
                        ActivatedClientTypeEntry wkcte =
                            new ActivatedClientTypeEntry(entry.TypeName, 
                                entry.AssemblyName, appUrl);
                        
                        // Fetch the context attributes
                        wkcte.ContextAttributes = entry.ContextAttributes;

                        entries[co++] = wkcte;
                    }
                    
                }
                   
                return entries;
            } // GetRegisteredActivatedClientTypes
 public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
     throw new NotImplementedException();
 }
Example #32
0
        } // RegisterWellKnownServiceType


        // helper for Configuration::RegisterActivatedClientType
        internal static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
        {
            Info.AddActivatedClientType(entry);
        }
 public static void RegisterActivatedClientType(ActivatedClientTypeEntry entry)
 {
     Contract.Requires(entry != null);
     Contract.Requires(entry.AssemblyName != null);
 }