Parse() 공개 메소드

public Parse ( TextReader input, IContentHandler handler ) : void
input TextReader
handler IContentHandler
리턴 void
예제 #1
0
            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");
            }
예제 #2
0
 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);
     }
 }
예제 #3
0
        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 {
            }
        }
예제 #4
0
        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;
            }
        }
예제 #5
0
        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;
                }
            }
        }
예제 #6
0
 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
     {
     }
 }
예제 #7
0
        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);
            }
        }
예제 #8
0
 public SVGParser(string text)
 {
     _parser.Parse(new StringReader(text), this);
 }