~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/mono-tools/webdoc/edit.aspx

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<%@ Assembly name="monodoc" %>
2
 
<%@ Import Namespace="Monodoc" %>
3
 
<%@ Import Namespace="System.Xml" %>
4
 
<%@ Import Namespace="System.IO" %>
5
 
<html>
6
 
<head>
7
 
  <script language="C#" runat=server>
8
 
        static RootTree help_tree = RootTree.LoadTree ();
9
 
 
10
 
        void Page_Load (object sender, EventArgs ea)
11
 
        {
12
 
                HttpWorkerRequest r = (HttpWorkerRequest) ((IServiceProvider)Context).GetService (typeof (HttpWorkerRequest));
13
 
                //
14
 
                // We need the untouched QueryString, as internally the editor uses the `@' symbol as a separator.
15
 
                //
16
 
                string q = Request ["link"];
17
 
                Console.WriteLine ("QueryString: " + q);
18
 
                try {
19
 
                        XmlNode edit_node = EditingUtils.GetNodeFromUrl ("edit:" + q, help_tree);
20
 
                        Monodoc2Wiki m2w = new Monodoc2Wiki ();
21
 
                        Console.WriteLine ("XML TO TEXT: " + edit_node.InnerText);
22
 
                        EditBuffer.Text = m2w.ProcessNode ((XmlElement) edit_node);
23
 
                } catch (Exception e){
24
 
                        EditBuffer.Text = Request.QueryString.ToString () + e.ToString ();
25
 
                }
26
 
        }
27
 
 
28
 
        void Save (object o, EventArgs a)
29
 
        {
30
 
                
31
 
        }
32
 
 
33
 
        void Preview (object o, EventArgs a)
34
 
        {
35
 
                WikiStyleDocConverter p = new WikiStyleDocConverter (EditBuffer.Text);
36
 
                XmlNode result = p.ParseEntireDoc ();
37
 
        
38
 
                StringWriter sw = new StringWriter ();
39
 
                sw.Write ("YOOHO:" + result.InnerText);
40
 
                XmlTextWriter xw = new XmlTextWriter (sw);
41
 
                xw.Formatting = Formatting.Indented;
42
 
                result.WriteTo (xw);
43
 
                xw.Close ();
44
 
 
45
 
                TextPreview.Text = "Preview<BR>" + sw.ToString ();
46
 
        }
47
 
  </script>
48
 
</head>
49
 
 
50
 
<body>
51
 
  <form runat=server>
52
 
    <asp:Label id="TextPreview" runat=server/>
53
 
    <asp:TextBox id="EditBuffer" Text="multiline" TextMode="MultiLine" runat="server" rows=15 cols=80 />
54
 
    <p>
55
 
    <asp:Button Text="Save Page" OnClick="Save" runat=server/>
56
 
    <asp:Button Text="Show Preview" OnClick="Preview" runat=server/>
57
 
    <asp:LinkButton Text="Markup Help" runat=server/>
58
 
    <asp:LinkButton Text="Cancel" runat=server/>
59
 
  </form>
60
 
</body>
61
 
 
62
 
</html>
 
 
b'\\ No newline at end of file'