[monkeydoc] Set things right
authorJérémie Laval <jeremie.laval@gmail.com>
Tue, 11 Dec 2012 17:13:12 +0000 (18:13 +0100)
committerJérémie Laval <jeremie.laval@gmail.com>
Tue, 11 Dec 2012 22:37:02 +0000 (22:37 +0000)
mcs/tools/monkeydoc/Monkeydoc/SearchableDocument.cs
mcs/tools/monkeydoc/Monkeydoc/providers/ecmaspec-provider.cs
mcs/tools/monkeydoc/Monkeydoc/providers/error-provider.cs

index 6c2bacc283dea6d7ef395efd420e3badfb020ff9..6236fa76f30d0ce9c520a450a7364cb176254147 100644 (file)
@@ -10,22 +10,39 @@ namespace MonkeyDoc
 {
        struct SearchableDocument
        {
-               public string title;
-               public string url;
-               public string fulltitle;
-               public string hottext;
-               public string text;
-               public string examples;
+               public string Title {
+                       get; set;
+               }
+
+               public string Url {
+                       get; set;
+               }
+
+               public string FullTitle {
+                       get; set;
+               }
+
+               public string HotText {
+                       get; set;
+               }
+
+               public string Text {
+                       get; set;
+               }
+
+               public string Examples {
+                       get; set;
+               }
 
                public Document LuceneDoc {
                        get {
                                Document doc = new Document ();
-                               doc.Add (UnIndexed ("title", title));
-                               doc.Add (UnIndexed ("url", url));
-                               doc.Add (UnIndexed ("fulltitle", fulltitle ?? string.Empty));
-                               doc.Add (UnStored ("hottext", hottext));
-                               doc.Add (UnStored ("text", text));
-                               doc.Add (UnStored ("examples", examples));
+                               doc.Add (UnIndexed ("title", Title));
+                               doc.Add (UnIndexed ("url", Url));
+                               doc.Add (UnIndexed ("fulltitle", FullTitle ?? string.Empty));
+                               doc.Add (UnStored ("hottext", HotText));
+                               doc.Add (UnStored ("text", Text));
+                               doc.Add (UnStored ("examples", Examples));
                                return doc;
                        }
                }
index bbe71ebd2424e9ec0725a8b1b13f4a5c87599696..6b4c0507d66917b86a06b3ab6b4deb2045f174d8 100644 (file)
@@ -150,11 +150,11 @@ namespace MonkeyDoc.Providers
 
                        //Write to the Lucene Index all the parts
                        SearchableDocument doc = new SearchableDocument ();
-                       doc.title = title;
-                       doc.hottext = title.Substring (title.IndexOf (':')); 
-                       doc.url = url;
-                       doc.text = text;
-                       doc.examples = examples;
+                       doc.Title = title;
+                       doc.HotText = title.Substring (title.IndexOf (':')); 
+                       doc.Url = url;
+                       doc.Text = text;
+                       doc.Examples = examples;
                        writer.AddDocument (doc.LuceneDoc);
                
                        if (node.IsLeaf)
index 0c1597ecdd6b6d865930d35ccbd76446bc700828..2acb26efcf916921e32cbb29eaff539aaf218730 100644 (file)
@@ -189,11 +189,11 @@ namespace MonkeyDoc.Providers
                                XmlSerializer reader = new XmlSerializer (typeof (ErrorDocumentation));
                                ErrorDocumentation d = (ErrorDocumentation)reader.Deserialize (GetHelpStream (n.Element.Substring (6)));
                                SearchableDocument doc = new SearchableDocument ();
-                               doc.title = d.ErrorName;
-                               doc.url = n.Element;
-                               doc.text = d.Details != null ? d.Details.ToString () : string.Empty;
-                               doc.examples = d.Examples.Cast<string> ().Aggregate ((e1, e2) => e1 + Environment.NewLine + e2);
-                               doc.hottext = d.ErrorName;
+                               doc.Title = d.ErrorName;
+                               doc.Url = n.Element;
+                               doc.Text = d.Details != null ? d.Details.ToString () : string.Empty;
+                               doc.Examples = d.Examples.Cast<string> ().Aggregate ((e1, e2) => e1 + Environment.NewLine + e2);
+                               doc.HotText = d.ErrorName;
                                writer.AddDocument (doc.LuceneDoc);
                        }
                }