Example #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);
            }
Example #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]);
 }
Example #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);
            }
Example #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++;
                }
            }
Example #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);
            }
Example #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);
            }
Example #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));
                    }
                }
            }
Example #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.");
 }
Example #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);
                    }
                }
            }
Example #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);
			}
Example #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);
			}
Example #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);
			}
Example #13
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				run.debugger.Breakpoints.Clear ();
			}
Example #14
0
			public override void Process (XsltDebuggerConsole run, string [] args)
			{
				run.debugger.AddBreakpoint (CreateBreakpoint (args));
			}
Example #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++;
				}
			}
Example #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.");
			}
Example #17
0
			public override void Process (XsltDebuggerConsole owner, string [] args)
			{
				owner.debugger.Resume ();
				owner.wait_handle.WaitOne ();
			}
Example #18
0
 public override void Process(XsltDebuggerConsole owner, string [] args)
 {
     owner.SignalQuitDebugger();
 }
Example #19
0
			public override void Process (XsltDebuggerConsole owner, string [] args)
			{
				owner.SignalQuitDebugger ();
			}
Example #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);
				}
			}
Example #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));
			}
Example #22
0
 public override void Process(XsltDebuggerConsole owner, string [] args)
 {
     owner.debugger.Resume();
     owner.wait_handle.WaitOne();
 }
Example #23
0
 public override void Process(XsltDebuggerConsole run, string [] args)
 {
     run.debugger.AddBreakpoint(CreateBreakpoint(args));
 }
Example #24
0
 public override void Process(XsltDebuggerConsole run, string [] args)
 {
     run.debugger.Breakpoints.Clear();
 }
Example #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);
			}
Example #26
0
			public abstract void Process (XsltDebuggerConsole owner, string [] args);
Example #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]);
			}
Example #28
0
 public abstract void Process(XsltDebuggerConsole owner, string [] args);