public void CopyFrom(ProviderData other) { if (Ref == null) { Ref = other.Ref; } if (Id == null) { Id = other.Id; } if (Type == null) { Type = other.Type; } foreach (DictionaryEntry entry in other.CustomProperties) { if (!CustomProperties.ContainsKey(entry.Key)) { CustomProperties [entry.Key] = entry.Value; } } if (other.CustomData != null) { if (CustomData == null) { CustomData = new ArrayList(); } foreach (SinkProviderData data in other.CustomData) { CustomData.Add(data); } } }
public void CopyFrom(ProviderData other) { if (this.Ref == null) { this.Ref = other.Ref; } if (this.Id == null) { this.Id = other.Id; } if (this.Type == null) { this.Type = other.Type; } foreach (object obj in other.CustomProperties) { DictionaryEntry dictionaryEntry = (DictionaryEntry)obj; if (!this.CustomProperties.ContainsKey(dictionaryEntry.Key)) { this.CustomProperties[dictionaryEntry.Key] = dictionaryEntry.Value; } } if (other.CustomData != null) { if (this.CustomData == null) { this.CustomData = new ArrayList(); } foreach (object obj2 in other.CustomData) { SinkProviderData value = (SinkProviderData)obj2; this.CustomData.Add(value); } } }
private ProviderData ReadProvider(string name, SmallXmlParser.IAttrList attrs, bool isTemplate) { ProviderData providerData = (!(name == "provider")) ? new FormatterData() : new ProviderData(); SinkProviderData sinkProviderData = new SinkProviderData("root"); providerData.CustomData = sinkProviderData.Children; this.currentProviderData = new Stack(); this.currentProviderData.Push(sinkProviderData); for (int i = 0; i < attrs.Names.Length; i++) { string text = attrs.Names[i]; string text2 = attrs.Values[i]; if (text == "id" && isTemplate) { providerData.Id = text2; } else if (text == "type") { providerData.Type = text2; } else if (text == "ref" && !isTemplate) { providerData.Ref = text2; } else { providerData.CustomProperties.Add(text, text2); } } if (providerData.Id == null && isTemplate) { throw new RemotingException("id attribute is required"); } return(providerData); }
internal static void RegisterChannels(ArrayList channels, bool onlyDelayed) { foreach (ChannelData channel in channels) { if (onlyDelayed && channel.DelayLoadAsClientChannel != "true") { continue; } if (defaultDelayedConfigRead && channel.DelayLoadAsClientChannel == "true") { continue; } if (channel.Ref != null) { ChannelData template = (ChannelData)channelTemplates [channel.Ref]; if (template == null) { throw new RemotingException("Channel template '" + channel.Ref + "' not found"); } channel.CopyFrom(template); } foreach (ProviderData prov in channel.ServerProviders) { if (prov.Ref != null) { ProviderData template = (ProviderData)serverProviderTemplates [prov.Ref]; if (template == null) { throw new RemotingException("Provider template '" + prov.Ref + "' not found"); } prov.CopyFrom(template); } } foreach (ProviderData prov in channel.ClientProviders) { if (prov.Ref != null) { ProviderData template = (ProviderData)clientProviderTemplates [prov.Ref]; if (template == null) { throw new RemotingException("Provider template '" + prov.Ref + "' not found"); } prov.CopyFrom(template); } } #if !DISABLE_REMOTING ChannelServices.RegisterChannelConfig(channel); #endif } }
public void CopyFrom(ChannelData other) { if (Ref == null) { Ref = other.Ref; } if (Id == null) { Id = other.Id; } if (Type == null) { Type = other.Type; } if (DelayLoadAsClientChannel == null) { DelayLoadAsClientChannel = other.DelayLoadAsClientChannel; } if (other._customProperties != null) { foreach (DictionaryEntry entry in other._customProperties) { if (!CustomProperties.ContainsKey(entry.Key)) { CustomProperties [entry.Key] = entry.Value; } } } if (_serverProviders == null && other._serverProviders != null) { foreach (ProviderData prov in other._serverProviders) { ProviderData np = new ProviderData(); np.CopyFrom(prov); ServerProviders.Add(np); } } if (_clientProviders == null && other._clientProviders != null) { foreach (ProviderData prov in other._clientProviders) { ProviderData np = new ProviderData(); np.CopyFrom(prov); ClientProviders.Add(np); } } }
public void CopyFrom(ChannelData other) { if (this.Ref == null) { this.Ref = other.Ref; } if (this.Id == null) { this.Id = other.Id; } if (this.Type == null) { this.Type = other.Type; } if (this.DelayLoadAsClientChannel == null) { this.DelayLoadAsClientChannel = other.DelayLoadAsClientChannel; } if (other._customProperties != null) { foreach (object obj in other._customProperties) { DictionaryEntry dictionaryEntry = (DictionaryEntry)obj; if (!this.CustomProperties.ContainsKey(dictionaryEntry.Key)) { this.CustomProperties[dictionaryEntry.Key] = dictionaryEntry.Value; } } } if (this._serverProviders == null && other._serverProviders != null) { foreach (object obj2 in other._serverProviders) { ProviderData other2 = (ProviderData)obj2; ProviderData providerData = new ProviderData(); providerData.CopyFrom(other2); this.ServerProviders.Add(providerData); } } if (this._clientProviders == null && other._clientProviders != null) { foreach (object obj3 in other._clientProviders) { ProviderData other3 = (ProviderData)obj3; ProviderData providerData2 = new ProviderData(); providerData2.CopyFrom(other3); this.ClientProviders.Add(providerData2); } } }
internal static void RegisterChannels(ArrayList channels, bool onlyDelayed) { foreach (object obj in channels) { ChannelData channelData = (ChannelData)obj; if (!onlyDelayed || !(channelData.DelayLoadAsClientChannel != "true")) { if (!RemotingConfiguration.defaultDelayedConfigRead || !(channelData.DelayLoadAsClientChannel == "true")) { if (channelData.Ref != null) { ChannelData channelData2 = (ChannelData)RemotingConfiguration.channelTemplates[channelData.Ref]; if (channelData2 == null) { throw new RemotingException("Channel template '" + channelData.Ref + "' not found"); } channelData.CopyFrom(channelData2); } foreach (object obj2 in channelData.ServerProviders) { ProviderData providerData = (ProviderData)obj2; if (providerData.Ref != null) { ProviderData providerData2 = (ProviderData)RemotingConfiguration.serverProviderTemplates[providerData.Ref]; if (providerData2 == null) { throw new RemotingException("Provider template '" + providerData.Ref + "' not found"); } providerData.CopyFrom(providerData2); } } foreach (object obj3 in channelData.ClientProviders) { ProviderData providerData3 = (ProviderData)obj3; if (providerData3.Ref != null) { ProviderData providerData4 = (ProviderData)RemotingConfiguration.clientProviderTemplates[providerData3.Ref]; if (providerData4 == null) { throw new RemotingException("Provider template '" + providerData3.Ref + "' not found"); } providerData3.CopyFrom(providerData4); } } ChannelServices.RegisterChannelConfig(channelData); } } } }
ProviderData ReadProvider(string name, SmallXmlParser.IAttrList attrs, bool isTemplate) { ProviderData prov = (name == "provider") ? new ProviderData() : new FormatterData(); SinkProviderData data = new SinkProviderData("root"); prov.CustomData = data.Children; currentProviderData = new Stack(); currentProviderData.Push(data); for (int i = 0; i < attrs.Names.Length; ++i) { string at = attrs.Names[i]; string val = attrs.Values[i]; if (at == "id" && isTemplate) { prov.Id = val; } else if (at == "type") { prov.Type = val; } else if (at == "ref" && !isTemplate) { prov.Ref = val; } else { prov.CustomProperties.Add(at, val); } } if (prov.Id == null && isTemplate) { throw new RemotingException("id attribute is required"); } return(prov); }
internal static void RegisterServerProviderTemplate(ProviderData prov) { serverProviderTemplates [prov.Id] = prov; }
internal static void RegisterClientProviderTemplate(ProviderData prov) { clientProviderTemplates [prov.Id] = prov; }
public void CopyFrom (ProviderData other) { if (Ref == null) Ref = other.Ref; if (Id == null) Id = other.Id; if (Type == null) Type = other.Type; foreach (DictionaryEntry entry in other.CustomProperties) if (!CustomProperties.ContainsKey (entry.Key)) CustomProperties [entry.Key] = entry.Value; if (other.CustomData != null) { if (CustomData == null) CustomData = new ArrayList (); foreach (SinkProviderData data in other.CustomData) CustomData.Add (data); } }
public void CopyFrom (ChannelData other) { if (Ref == null) Ref = other.Ref; if (Id == null) Id = other.Id; if (Type == null) Type = other.Type; if (DelayLoadAsClientChannel == null) DelayLoadAsClientChannel = other.DelayLoadAsClientChannel; if (other._customProperties != null) { foreach (DictionaryEntry entry in other._customProperties) if (!CustomProperties.ContainsKey (entry.Key)) CustomProperties [entry.Key] = entry.Value; } if (_serverProviders == null && other._serverProviders != null) { foreach (ProviderData prov in other._serverProviders) { ProviderData np = new ProviderData(); np.CopyFrom (prov); ServerProviders.Add (np); } } if (_clientProviders == null && other._clientProviders != null) { foreach (ProviderData prov in other._clientProviders) { ProviderData np = new ProviderData(); np.CopyFrom (prov); ClientProviders.Add (np); } } }
internal static void RegisterServerProviderTemplate(ProviderData prov) { RemotingConfiguration.serverProviderTemplates[prov.Id] = prov; }
internal static void RegisterClientProviderTemplate (ProviderData prov) { clientProviderTemplates [prov.Id] = prov; }
public void ParseElement(string name, SmallXmlParser.IAttrList attrs) { if (this.currentProviderData != null) { this.ReadCustomProviderData(name, attrs); return; } if (name != null) { if (ConfigHandler.< > f__switch$map27 == null) { ConfigHandler.< > f__switch$map27 = new Dictionary <string, int>(19) { { "application", 0 }, { "lifetime", 1 }, { "channels", 2 }, { "channel", 3 }, { "serverProviders", 4 }, { "clientProviders", 5 }, { "provider", 6 }, { "formatter", 6 }, { "client", 7 }, { "service", 8 }, { "wellknown", 9 }, { "activated", 10 }, { "soapInterop", 11 }, { "interopXmlType", 12 }, { "interopXmlElement", 13 }, { "preLoad", 14 }, { "debug", 15 }, { "channelSinkProviders", 16 }, { "customErrors", 17 } }; } int num; if (ConfigHandler.< > f__switch$map27.TryGetValue(name, out num)) { switch (num) { case 0: this.ValidatePath(name, new string[] { "system.runtime.remoting" }); if (attrs.Names.Length > 0) { this.appName = attrs.Values[0]; } break; case 1: this.ValidatePath(name, new string[] { "application" }); this.ReadLifetine(attrs); break; case 2: this.ValidatePath(name, new string[] { "system.runtime.remoting", "application" }); break; case 3: this.ValidatePath(name, new string[] { "channels" }); if (this.currentXmlPath.IndexOf("application") != -1) { this.ReadChannel(attrs, false); } else { this.ReadChannel(attrs, true); } break; case 4: this.ValidatePath(name, new string[] { "channelSinkProviders", "channel" }); break; case 5: this.ValidatePath(name, new string[] { "channelSinkProviders", "channel" }); break; case 6: if (this.CheckPath("application/channels/channel/serverProviders") || this.CheckPath("channels/channel/serverProviders")) { ProviderData providerData = this.ReadProvider(name, attrs, false); this.currentChannel.ServerProviders.Add(providerData); } else if (this.CheckPath("application/channels/channel/clientProviders") || this.CheckPath("channels/channel/clientProviders")) { ProviderData providerData = this.ReadProvider(name, attrs, false); this.currentChannel.ClientProviders.Add(providerData); } else if (this.CheckPath("channelSinkProviders/serverProviders")) { ProviderData providerData = this.ReadProvider(name, attrs, true); RemotingConfiguration.RegisterServerProviderTemplate(providerData); } else if (this.CheckPath("channelSinkProviders/clientProviders")) { ProviderData providerData = this.ReadProvider(name, attrs, true); RemotingConfiguration.RegisterClientProviderTemplate(providerData); } else { this.ValidatePath(name, new string[0]); } break; case 7: this.ValidatePath(name, new string[] { "application" }); this.currentClientUrl = attrs.GetValue("url"); break; case 8: this.ValidatePath(name, new string[] { "application" }); break; case 9: this.ValidatePath(name, new string[] { "client", "service" }); if (this.CheckPath("client")) { this.ReadClientWellKnown(attrs); } else { this.ReadServiceWellKnown(attrs); } break; case 10: this.ValidatePath(name, new string[] { "client", "service" }); if (this.CheckPath("client")) { this.ReadClientActivated(attrs); } else { this.ReadServiceActivated(attrs); } break; case 11: this.ValidatePath(name, new string[] { "application" }); break; case 12: this.ValidatePath(name, new string[] { "soapInterop" }); this.ReadInteropXml(attrs, false); break; case 13: this.ValidatePath(name, new string[] { "soapInterop" }); this.ReadInteropXml(attrs, false); break; case 14: this.ValidatePath(name, new string[] { "soapInterop" }); this.ReadPreload(attrs); break; case 15: this.ValidatePath(name, new string[] { "system.runtime.remoting" }); break; case 16: this.ValidatePath(name, new string[] { "system.runtime.remoting" }); break; case 17: this.ValidatePath(name, new string[] { "system.runtime.remoting" }); RemotingConfiguration.SetCustomErrorsMode(attrs.GetValue("mode")); break; default: goto IL_512; } return; } } IL_512: throw new RemotingException("Element '" + name + "' is not valid in system.remoting.configuration section"); }
internal static void RegisterServerProviderTemplate (ProviderData prov) { serverProviderTemplates [prov.Id] = prov; }
static object CreateProvider (ProviderData prov) { Type pvtype = Type.GetType (prov.Type); if (pvtype == null) throw new RemotingException ("Type '" + prov.Type + "' not found"); Object[] pvparms = new Object[] {prov.CustomProperties, prov.CustomData}; try { return Activator.CreateInstance (pvtype, pvparms); } catch (Exception ex) { if (ex is TargetInvocationException) ex = ((TargetInvocationException)ex).InnerException; throw new RemotingException ("An instance of provider '" + pvtype + "' could not be created: " + ex.Message); } }
internal static void RegisterClientProviderTemplate(ProviderData prov) { RemotingConfiguration.clientProviderTemplates[prov.Id] = prov; }