Ejemplo n.º 1
0
		static private void GetIndexText( StringBuilder sb, HtmlHelpFile helpFile )
		{
			Debug.Assert( sb != null );

			switch ( helpFile.TopicType )
			{
				case HelpTopicType.Class :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Interface :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Structure :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Namespace :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}'/>", helpFile.TypeName );
					break;
				case HelpTopicType.Delegate :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Constructor :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.New'/>", helpFile.TypeName );
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}.New'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Method :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Property :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Enumeration :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.Field :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}'/>", helpFile.TypeName );
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
				case HelpTopicType.MemberList :
					sb.AppendFormat( "<MSHelp:Keyword Index='F' Term='{0}.{1}'/>", helpFile.ParentNamespace, helpFile.TypeName );
					break;
			}			
		}
Ejemplo n.º 2
0
		static private void FixUp( FileInfo f )
		{
			Trace.WriteLine( string.Format( "Adding additional xml nodes to {0}", f.Name ) );

			try 
			{
				HtmlHelpFile helpFile = new HtmlHelpFile( f );

				StringBuilder sb = new StringBuilder();
				
				GetStandardMsHelpText( sb, helpFile.Title );
				GetIndexText( sb, helpFile );
				
				helpFile.AppendDataIslandHtml( sb );

				if ( helpFile.Dirty )
					helpFile.Save();	
			}
			catch (Exception)
			{
				Trace.WriteLine( string.Format( "Error agumenting {0}, continuing anyway", f.Name ) );
			}
		}