System.Runtime.Remoting.RemotingConfiguration.ConfigHandler.ReadChannel C# (CSharp) Method

ReadChannel() private method

private ReadChannel ( Mono.Xml.SmallXmlParser attrs, bool isTemplate ) : void
attrs Mono.Xml.SmallXmlParser
isTemplate bool
return void
		void ReadChannel (SmallXmlParser.IAttrList attrs, bool isTemplate)
		{
			ChannelData channel = new ChannelData ();
			
			for (int i=0; i < attrs.Names.Length; ++i) 
			{
				string at = attrs.Names[i];
				string val = attrs.Values[i];
				
				if (at == "ref" && !isTemplate)
					channel.Ref = val;
				else if (at == "delayLoadAsClientChannel")
					channel.DelayLoadAsClientChannel = val;
				else if (at == "id" && isTemplate)
					channel.Id = val;
				else if (at == "type")
					channel.Type = val;
				else
					channel.CustomProperties.Add (at, val);
			}
			
			if (isTemplate)
			{
				if (channel.Id == null) throw new RemotingException ("id attribute is required");
				if (channel.Type == null) throw new RemotingException ("id attribute is required");
				RemotingConfiguration.RegisterChannelTemplate (channel);
			}
			else
				channelInstances.Add (channel);
				
			currentChannel = channel;
		}