private void keywordsListView_SelectedIndexChanged(object sender, EventArgs e) { int index = SelectedKeyword; if (index < 0 || index >= _helpKeywords.Count) return; _helpKeywords.MoveTo(index); IKeyword keyword = (IKeyword)_helpKeywords.Current; keywordsTextBox.Clear(); RichTextBoxFuncs rtf = new RichTextBoxFuncs(keywordsTextBox); rtf.WriteLine("IKeyword Members:"); rtf.WriteLine("DisplayValue", keyword.DisplayValue); rtf.WriteLine("IsSubkey", keyword.IsSubkey.ToString()); rtf.WriteLine("Value", keyword.Value); rtf.WriteLine("Topics", keyword.Topics.Count.ToString()); //Fill Results Panel resultsPanel.SetVirtualList(keyword.Topics); }
private void listView1_SelectedIndexChanged(object sender, EventArgs e) { richTextBox1.Clear(); if (listView1.SelectedIndices.Count <= 0) return; int iSel = listView1.SelectedIndices[0]; EventLogEntry entry = GetEventLogEntryFromCache(iSel); if (entry != null) { RichTextBoxFuncs rtf = new RichTextBoxFuncs(richTextBox1); rtf.WriteLine("Id:\t", entry.InstanceId.ToString()); rtf.WriteLine("Index: ", entry.Index.ToString()); rtf.WriteLine("EntryType: ", GetErrorType(entry.EntryType)); rtf.WriteLine("TimeWritten: ", entry.TimeWritten.ToString()); rtf.WriteLine("Source: ", entry.Source); //rtf.WriteLine("Category: ", zipEntry.Category); //rtf.WriteLine("CategoryNumber: ", zipEntry.CategoryNumber.ToString()); rtf.WriteLine("MachineName: ", entry.MachineName); rtf.WriteLine("UserName: "******"Message: ", entry.Message); } }
private void UpdateTopicDetails(ITopic helpTopic) { if (helpTopic == null) return; _helpTopic = helpTopic; //remember in global // Details View detailsRichTextBox.Clear(); RichTextBoxFuncs rtf = new RichTextBoxFuncs(detailsRichTextBox); rtf.WriteLine("topic.Category", ExpandStringList(_helpTopic.Category())); rtf.WriteLine("topic.ContentFilter", ExpandStringList(_helpTopic.ContentFilter())); rtf.WriteLine("topic.ContentType", ExpandStringList(_helpTopic.ContentType())); rtf.WriteLine("topic.Description", _helpTopic.Description); rtf.WriteLine("topic.DisplayVersion", _helpTopic.DisplayVersion); rtf.WriteLine("topic.Id", _helpTopic.Id); rtf.WriteLine("topic.Locale", _helpTopic.Locale); rtf.WriteLine("topic.Package", _helpTopic.Package); rtf.WriteLine("topic.ParentId", _helpTopic.ParentId); rtf.WriteLine("topic.TableOfContentsHasChildren", _helpTopic.TableOfContentsHasChildren.ToString()); rtf.WriteLine("topic.TableOfContentsPosition", _helpTopic.TableOfContentsPosition.ToString()); rtf.WriteLine("topic.Title", _helpTopic.Title); rtf.WriteLine("topic.TopicLocale", _helpTopic.TopicLocale); rtf.WriteLine("topic.TopicVersion", _helpTopic.TopicVersion); rtf.WriteLine("topic.Url", _helpTopic.Url); rtf.WriteLine("topic.Vendor", _helpTopic.Vendor); }
private void InitAboutPageTab() { infoRichTextBox.Clear(); RichTextBoxFuncs rtf = new RichTextBoxFuncs(infoRichTextBox); Assembly thisAssembly = System.Reflection.Assembly.GetExecutingAssembly(); int _indent = 20; Color infoColor = Color.DimGray; Color titleColor = Color.SaddleBrown; rtf.WriteLine("Free example code by Helpware"); rtf.WriteLine("http://helpviewer2.codeplex.com/"); rtf.WriteLine("http://hv2.helpmvp.com"); rtf.WriteLine(""); rtf.WriteLine("This Assembly:", titleColor); String version = thisAssembly.GetName().Version.ToString(); rtf.WriteLine("Version: " + version, infoColor, _indent); toolStripLabelVersion.Text = "Version: " + version; rtf.WriteLine(thisAssembly.FullName, infoColor, _indent); rtf.WriteLine(thisAssembly.Location, infoColor, _indent); rtf.WriteLine(""); rtf.WriteLine("References:", titleColor); AssemblyName[] asmNames = thisAssembly.GetReferencedAssemblies(); foreach (AssemblyName asmName in asmNames) { rtf.WriteLine(asmName.FullName, infoColor, _indent); } rtf.WriteLine(""); rtf.WriteLine("ImageRuntimeVersion: " + thisAssembly.ImageRuntimeVersion, infoColor); rtf.WriteLine(""); rtf.WriteLine("Help Runtime:", titleColor); rtf.WriteLine(GetFileInfo("HlpCtntMgr.exe"), infoColor, _indent); rtf.WriteLine(GetFileInfo("HlpViewer.exe"), infoColor, _indent); rtf.WriteLine(GetFileInfo("Microsoft.mshtml.dll"), infoColor, _indent); rtf.WriteLine(GetFileInfo("Microsoft.VisualStudio.Help.dll"), infoColor, _indent); rtf.WriteLine(GetFileInfo("Windows.Help.Runtime.dll"), infoColor, _indent); }
private void ShowDetails() { richTextBoxDetails.Clear(); int iCat = catListBox.SelectedIndex; if (iCat >= 0) { FlatCatalogListItem catItem = _flatCalaogList[iCat]; RichTextBoxFuncs rtbf = new RichTextBoxFuncs(richTextBoxDetails); rtbf.WriteLine("FromRegistry:", catItem.FromRegistry.ToString()); rtbf.WriteLine("CatalogID:", catItem.CatalogID); if (Directory.Exists(catItem.LocationPath)) rtbf.WriteLine("LocationPath:", "file:/" + catItem.LocationPath); else rtbf.WriteLine("LocationPath:", catItem.LocationPath); String dir1 = Path.Combine(catItem.LocationPath, "ContentStore\\"); String dir2 = Path.Combine(catItem.LocationPath, "IndexStore\\"); if (Directory.Exists(dir1)) rtbf.WriteLine("ContentStore:", "file:/" + dir1); if (Directory.Exists(dir2)) rtbf.WriteLine("IndexStore:", "file:/" + dir2); rtbf.WriteLine(""); rtbf.WriteLine("Locale:", catItem.Locale); rtbf.WriteLine("CatalogName:", catItem.CatalogName); rtbf.WriteLine("SeedFilePath:", catItem.SeedFilePath); } }
private void ShowNotes() { richTextBox1.Clear(); RichTextBoxFuncs rtf = new RichTextBoxFuncs(richTextBox1); Color headerColor = Color.Chocolate; Color textColor = Color.DarkSlateGray; Font boldFont = new Font(this.Font.FontFamily, 12, FontStyle.Regular); int textIndent = 16; rtf.WriteLine("ICatalog & ICatalogRead", headerColor, boldFont); rtf.Write("Once you import the Windows.Help.Runtime.DLL COM interface, Open & Close a Help Catalog using ", textColor); rtf.Write("ICatalog", headerColor); rtf.Write(", then use ", textColor); rtf.Write("ICatalogRead", headerColor); rtf.WriteLine(" to access catalog data (Search/Index/TOC/etc).", textColor); rtf.WriteLine("Most other API classes (see below) are used by these two interfaces.", textColor); rtf.Write("MemoryIStream", headerColor); rtf.Write(", ", textColor); rtf.Write("FileIStream", headerColor); rtf.Write(" and ", textColor); rtf.Write("HelpReader", headerColor); rtf.WriteLine(" are used internally and exposed via COM. Most developers won't use these.", textColor); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.IHelpFilter", headerColor, boldFont); rtf.Write("This is a Dictionary<string, string> list of key/value pairs used by the various ", textColor); rtf.Write("ICatalogRead", headerColor); rtf.WriteLine(" calls to get filtered results.", textColor, textIndent); rtf.WriteLine("The Key is not case sensitive. A key/value pair may look something like this: \"topiclocale\",\"en-US\".", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.IHelpKeyValuePair", headerColor, boldFont); rtf.Write("Represents a single key/value items of a ", textColor); rtf.Write("IHelpFilter", headerColor); rtf.WriteLine(" list.", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.ICatalogReadWriteLock", headerColor, boldFont); rtf.Write("Object returned by calling ", textColor); rtf.Write("ICatalog.GetReadWriteLock(CatalogLocation)", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine("Use the object to get or set a catalogs read/write locks.", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.IKeywordCollection", headerColor, boldFont); rtf.Write("Used to return topicID data by ", textColor); rtf.Write("ICatalogRead.GetKeywords()", headerColor); rtf.WriteLine(" calls.", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.IKeyword", headerColor, boldFont); rtf.Write("Access keywords in ", textColor); rtf.Write("IKeywordCollection", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.ITopicCollection", headerColor, boldFont); rtf.Write("Used to return topic results by ", textColor); rtf.Write("ICatalogRead::GetTableOfContents()", headerColor); rtf.Write(" & ", textColor, textIndent); rtf.Write("ICatalogRead::GetSearchResults()", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.ITopic", headerColor, boldFont); rtf.Write("Access topic info in ", textColor); rtf.Write("ITopicCollection", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.SearchOptions", headerColor, boldFont); rtf.Write("This is an enumeration used in ", textColor); rtf.Write("ICatalogRead.GetSearchResults()", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine("none=0; -- Default processing.", textColor, textIndent); rtf.WriteLine("SearchTermHighlight=1; -- Apply highlighting to search hits.", textColor, textIndent); rtf.WriteLine("OrSearchOverride=2; -- \"OR\" search terms instead of \"AND\" (default).", textColor, textIndent); rtf.WriteLine(""); rtf.WriteLine("Help.Runtime.TocReturnDetail", headerColor, boldFont); rtf.Write("This is an enumeration used in calls to ", textColor); rtf.Write("ICatalogRead.GetTableOfContents()", headerColor); rtf.WriteLine(".", textColor, textIndent); rtf.WriteLine("TocChildren=0; -- Get only children.", textColor, textIndent); rtf.WriteLine("TocSiblings=1; -- Get only siblings.", textColor, textIndent); rtf.WriteLine("TocAncestors=2; -- Get only ancestors.", textColor, textIndent); rtf.WriteLine("TocRootNodes=3; -- Get only root list.", textColor, textIndent); rtf.WriteLine("TocDescendants=4; -- Get only descendants.", textColor, textIndent); rtf.WriteLine(""); }