public void Test() { var call = new CallInfo(); var parser = new SmallXmlParser(); parser.Parse("<invoke name=\"test\" returntype=\"void\"><arguments><string>aaa</string></arguments></invoke>", call); Assert.AreEqual(call.MethodName, "test"); Assert.AreEqual(call.Args[0].Type, "string"); Assert.AreEqual(call.Args[0].Value, "aaa"); }
private static void ReadConfigFile(string filename) { try { SmallXmlParser parser = new SmallXmlParser(); using (TextReader rreader = new StreamReader(filename)) { ConfigHandler handler = new ConfigHandler(false); parser.Parse(rreader, handler); } } catch (Exception ex) { throw new RemotingException("Configuration file '" + filename + "' could not be loaded: " + ex.Message, ex); } }
private static void LoadConfig(string filename, IDictionary <string, Type> algorithms, IDictionary <string, string> oid) { if (!File.Exists(filename)) { return; } try { using (TextReader reader = new StreamReader(filename)) { CryptoHandler handler = new CryptoHandler(algorithms, oid); SmallXmlParser parser = new SmallXmlParser(); parser.Parse(reader, handler); } } catch { } }
internal static void LoadDefaultDelayedChannels() { lock (channelTemplates) { if (defaultDelayedConfigRead || defaultConfigRead) { return; } SmallXmlParser parser = new SmallXmlParser(); using (TextReader rreader = new StreamReader(Environment.GetMachineConfigPath())) { ConfigHandler handler = new ConfigHandler(true); parser.Parse(rreader, handler); } defaultDelayedConfigRead = true; } }
internal static void LoadDefaultDelayedChannels() { Hashtable obj = RemotingConfiguration.channelTemplates; lock (obj) { if (!RemotingConfiguration.defaultDelayedConfigRead && !RemotingConfiguration.defaultConfigRead) { SmallXmlParser smallXmlParser = new SmallXmlParser(); using (TextReader textReader = new StreamReader(Environment.GetMachineConfigPath())) { ConfigHandler handler = new ConfigHandler(true); smallXmlParser.Parse(textReader, handler); } RemotingConfiguration.defaultDelayedConfigRead = true; } } }
private static void LoadConfig(string filename, Hashtable algorithms, Hashtable oid) { if (!File.Exists(filename)) { return; } try { using (TextReader textReader = new StreamReader(filename)) { CryptoConfig.CryptoHandler handler = new CryptoConfig.CryptoHandler(algorithms, oid); SmallXmlParser smallXmlParser = new SmallXmlParser(); smallXmlParser.Parse(textReader, handler); } } catch { } }
private void OnCallFromFlash(object sender, FlashCallEventArgs evt) { try { string request = evt.request; var call = new CallInfo(); _xmlParser.Parse(new StringReader(request), call); if (call.HasErrors) { Console.WriteLine("Flash Call Error: {0}", call.Error); return; } string returnValue = Call(call); flashPlayer.SetReturnValue("<string>" + returnValue + "</string>"); } catch (Exception e) { Console.WriteLine("Flash Call Unhandled Exception: {0}", e); } }
public SVGParser(string text) { _parser.Parse(new StringReader(text), this); }