Ejemplo n.º 1
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                string prefix = args.Length == 4 ? args [2] : String.Empty;
                string ns     = args [args.Length - 1];

                run.debugger.NamespaceManager.AddNamespace(prefix, ns);
                Console.WriteLine("Added xmlns {0}->{1}", prefix, ns);
            }
Ejemplo n.º 2
0
 public override void Process(XsltDebuggerConsole run, string [] args)
 {
     if (!File.Exists(args [1]))
     {
         throw new XsltDebuggerException(String.Format("File {0} does not exist", args [1]));
     }
     run.debugger.Input = new XPathDocument(args [1]);
     Console.WriteLine("Loaded input document {0}", args [1]);
 }
Ejemplo n.º 3
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                int n = int.Parse(args [2]);

                if (run.debugger.Breakpoints.Count <= n)
                {
                    throw new XsltDebuggerException(String.Format("No breakpoint was found at index {0}", n));
                }
                run.debugger.Breakpoints.RemoveAt(n);
            }
Ejemplo n.º 4
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                int i = 0;

                foreach (XsltDebuggerBreakpoint bp in run.debugger.Breakpoints)
                {
                    Console.WriteLine("{0} {1}", i, bp.ToSummaryString());
                    i++;
                }
            }
Ejemplo n.º 5
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                StringWriter  sw = new StringWriter();
                XmlTextWriter xw = new XmlTextWriter(sw);

                xw.Formatting = Formatting.Indented;
                run.debugger.CurrentRun.OutputNode.WriteTo(xw);
                xw.Close();
                int lines = args.Length > 1 ? int.Parse(args [1]) : 10;

                PrintLastLines(sw.ToString(), lines);
            }
Ejemplo n.º 6
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                XmlNamespaceManager n = run.debugger.NamespaceManager;
                string prefix         = args.Length == 3 ? args [2] : String.Empty;
                string ns             = n.LookupNamespace(prefix);

                if (ns == null)
                {
                    throw new XsltDebuggerException("Specified namespace prefix is not defined.");
                }
                n.RemoveNamespace(prefix, ns);
                Console.WriteLine("Removed xmlns {0}->{1}", prefix, ns);
            }
Ejemplo n.º 7
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                XmlNamespaceManager n = run.debugger.NamespaceManager;

                Console.WriteLine("Default namespace : {0}", n.DefaultNamespace);
                foreach (string prefix in n)
                {
                    if (prefix.Length > 0)
                    {
                        Console.WriteLine("{0} -> {1}", prefix, n.LookupNamespace(prefix));
                    }
                }
            }
Ejemplo n.º 8
0
 public override void Process(XsltDebuggerConsole owner, string [] args)
 {
     foreach (XsltDebuggerConsoleCommand cmdobj in owner.commands)
     {
         Console.WriteLine(cmdobj.UsageSummary);
         foreach (string s in cmdobj.UsageDetails.Split('\n'))
         {
             Console.Write("\t");
             Console.WriteLine(s);
         }
     }
     Console.WriteLine("clear [number]");
     Console.WriteLine("\t Removes the specified breakpoint by breakpoint index.");
     Console.WriteLine("list breakpoints (bp)");
     Console.WriteLine("\t Shows the list of breakpoints.");
 }
Ejemplo n.º 9
0
            public override void Process(XsltDebuggerConsole run, string [] args)
            {
                if (!File.Exists(args [1]))
                {
                    throw new XsltDebuggerException(String.Format("File {0} does not exist", args [1]));
                }
                Encoding enc     = args.Length > 2 ? Encoding.GetEncoding(args [2]) : Encoding.Default;
                string   content = null;

                using (StreamReader reader = new StreamReader(args [1], enc)) {
                    content = reader.ReadToEnd();
                }
                string [] lines = content.Split('\n');
                for (int i = 1; i < lines.Length; i++)
                {
                    string s = lines [i].Trim();
                    if (s.Length > 0)
                    {
                        run.ProcessCommand(s);
                    }
                }
            }
Ejemplo n.º 10
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				string prefix = args.Length == 4 ? args [2] : String.Empty;
				string ns = args [args.Length - 1];
				run.debugger.NamespaceManager.AddNamespace (prefix, ns);
				Console.WriteLine ("Added xmlns {0}->{1}", prefix, ns);
			}
Ejemplo n.º 11
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				XmlNamespaceManager n = run.debugger.NamespaceManager;
				string prefix = args.Length == 3 ? args [2] : String.Empty;
				string ns = n.LookupNamespace (prefix);
				if (ns == null)
					throw new XsltDebuggerException ("Specified namespace prefix is not defined.");
				n.RemoveNamespace (prefix, ns);
				Console.WriteLine ("Removed xmlns {0}->{1}", prefix, ns);
			}
Ejemplo n.º 12
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				int n = int.Parse (args [2]);
				if (run.debugger.Breakpoints.Count <= n)
					throw new XsltDebuggerException (String.Format ("No breakpoint was found at index {0}", n));
				run.debugger.Breakpoints.RemoveAt (n);
			}
Ejemplo n.º 13
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				run.debugger.Breakpoints.Clear ();
			}
Ejemplo n.º 14
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				run.debugger.AddBreakpoint (CreateBreakpoint (args));
			}
Ejemplo n.º 15
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				int i = 0;
				foreach (XsltDebuggerBreakpoint bp in run.debugger.Breakpoints) {
					Console.WriteLine ("{0} {1}", i, bp.ToSummaryString ());
					i++;
				}
			}
Ejemplo n.º 16
0
			public override void Process (XsltDebuggerConsole owner, string [] args)
			{
				foreach (XsltDebuggerConsoleCommand cmdobj in owner.commands) {
					Console.WriteLine (cmdobj.UsageSummary);
					foreach (string s in cmdobj.UsageDetails.Split ('\n')) {
						Console.Write ("\t");
						Console.WriteLine (s);
					}
				}
				Console.WriteLine ("clear [number]");
				Console.WriteLine ("\t Removes the specified breakpoint by breakpoint index.");
				Console.WriteLine ("list breakpoints (bp)");
				Console.WriteLine ("\t Shows the list of breakpoints.");
			}
Ejemplo n.º 17
0
			public override void Process (XsltDebuggerConsole owner, string [] args)
			{
				owner.debugger.Resume ();
				owner.wait_handle.WaitOne ();
			}
Ejemplo n.º 18
0
 public override void Process(XsltDebuggerConsole owner, string [] args)
 {
     owner.SignalQuitDebugger();
 }
Ejemplo n.º 19
0
			public override void Process (XsltDebuggerConsole owner, string [] args)
			{
				owner.SignalQuitDebugger ();
			}
Ejemplo n.º 20
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				if (!File.Exists (args [1]))
					throw new XsltDebuggerException (String.Format ("File {0} does not exist", args [1]));
				Encoding enc = args.Length > 2 ? Encoding.GetEncoding (args [2]) : Encoding.Default;
				string content = null;
				using (StreamReader reader = new StreamReader (args [1], enc)) {
					content = reader.ReadToEnd ();
				}
				string [] lines = content.Split ('\n');
				for (int i = 1; i < lines.Length; i++) {
					string s = lines [i].Trim ();
					if (s.Length > 0)
						run.ProcessCommand (s);
				}
			}
Ejemplo n.º 21
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				XmlNamespaceManager n = run.debugger.NamespaceManager;
				Console.WriteLine ("Default namespace : {0}", n.DefaultNamespace);
				foreach (string prefix in n)
					if (prefix.Length > 0)
						Console.WriteLine ("{0} -> {1}", prefix, n.LookupNamespace (prefix));
			}
Ejemplo n.º 22
0
 public override void Process(XsltDebuggerConsole owner, string [] args)
 {
     owner.debugger.Resume();
     owner.wait_handle.WaitOne();
 }
Ejemplo n.º 23
0
 public override void Process(XsltDebuggerConsole run, string [] args)
 {
     run.debugger.AddBreakpoint(CreateBreakpoint(args));
 }
Ejemplo n.º 24
0
 public override void Process(XsltDebuggerConsole run, string [] args)
 {
     run.debugger.Breakpoints.Clear();
 }
Ejemplo n.º 25
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				StringWriter sw = new StringWriter ();
				XmlTextWriter xw = new XmlTextWriter (sw);
				xw.Formatting = Formatting.Indented;
				run.debugger.CurrentRun.OutputNode.WriteTo (xw);
				xw.Close ();
				int lines = args.Length > 1 ? int.Parse (args [1]) : 10;
				PrintLastLines (sw.ToString (), lines);
			}
Ejemplo n.º 26
0
			public abstract void Process (XsltDebuggerConsole owner, string [] args);
Ejemplo n.º 27
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				if (!File.Exists (args [1]))
					throw new XsltDebuggerException (String.Format ("File {0} does not exist", args [1]));
				run.debugger.Input = new XPathDocument (args [1]);
				Console.WriteLine ("Loaded input document {0}", args [1]);
			}
Ejemplo n.º 28
0
 public abstract void Process(XsltDebuggerConsole owner, string [] args);