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;
}