<html>
<head>
<style>
<!--
body { background-color:#ffffff }
.file { border:1px solid #eeeeee; margin-top:1em; margin-bottom:1em }
.pathname { font-family:monospace; float:right }
.fileheader { margin-bottom:.5em }
.diff { margin:0 }
.tasklist { padding:4px; border:1px dashed #000000; margin-top:1em }
.tasklist ul { margin-top:0; margin-bottom:0 }
tr.alt { background-color:#eeeeee }
#added { background-color:#ddffdd }
#addedchars { background-color:#99ff99; font-weight:bolder }
tr.alt #added { background-color:#ccf7cc }
#removed { background-color:#ffdddd }
#removedchars { background-color:#ff9999; font-weight:bolder }
tr.alt #removed { background-color:#f7cccc }
#info { color:#888888 }
#context { background-color:#eeeeee }
td {padding-left:.3em; padding-right:.3em }
tr.head { border-bottom-width:1px; border-bottom-style:solid }
tr.head td { padding:0; padding-top:.2em }
.task { background-color:#ffff00 }
.comment { padding:4px; border:1px dashed #000000; background-color:#ffffdd }
.error { color:red }
hr { border-width:0px; height:2px; background:black }
-->
</style>
</head>
<body>
<pre class="comment">Import TechBot</pre><pre class="diff" id="added">Added: trunk/irc/TechBot/
Added: trunk/irc/TechBot/CHMLibrary/
Added: trunk/irc/TechBot/CHMLibrary/AssemblyInfo.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/BinaryReaderHelp.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMBtree.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMFile.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMIdxhdr.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMStrings.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMSystem.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMTocidx.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMTopics.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMUrlstr.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMUrltable.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/DumpingInfo.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/FullTextEngine.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/HHCParser.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/HHCParser2.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/HHKParser.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/TopicEntry.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/UrlTableEntry.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/enumerations.cs
Added: trunk/irc/TechBot/CHMLibrary/CHMLibrary.cmbx
Added: trunk/irc/TechBot/CHMLibrary/CHMLibrary.prjx
Added: trunk/irc/TechBot/CHMLibrary/Category.cs
Added: trunk/irc/TechBot/CHMLibrary/ChmFileInfo.cs
Added: trunk/irc/TechBot/CHMLibrary/Default.build
Added: trunk/irc/TechBot/CHMLibrary/HtmlHelpSystem.cs
Added: trunk/irc/TechBot/CHMLibrary/HttpUtility.cs
Added: trunk/irc/TechBot/CHMLibrary/Index.cs
Added: trunk/irc/TechBot/CHMLibrary/IndexItem.cs
Added: trunk/irc/TechBot/CHMLibrary/IndexTopic.cs
Added: trunk/irc/TechBot/CHMLibrary/InformationType.cs
Added: trunk/irc/TechBot/CHMLibrary/Storage/
Added: trunk/irc/TechBot/CHMLibrary/Storage/CHMStream.cs
Added: trunk/irc/TechBot/CHMLibrary/TOCItem.cs
Added: trunk/irc/TechBot/CHMLibrary/TableOfContents.cs
Added: trunk/irc/TechBot/Compression/
Added: trunk/irc/TechBot/Compression/AssemblyInfo.cs
Added: trunk/irc/TechBot/Compression/Checksums/
Added: trunk/irc/TechBot/Compression/Checksums/Adler32.cs
Added: trunk/irc/TechBot/Compression/Checksums/CRC32.cs
Added: trunk/irc/TechBot/Compression/Checksums/IChecksum.cs
Added: trunk/irc/TechBot/Compression/Checksums/StrangeCRC.cs
Added: trunk/irc/TechBot/Compression/Compression.cmbx
Added: trunk/irc/TechBot/Compression/Compression.prjx
Added: trunk/irc/TechBot/Compression/Default.build
Added: trunk/irc/TechBot/Compression/Deflater.cs
Added: trunk/irc/TechBot/Compression/DeflaterConstants.cs
Added: trunk/irc/TechBot/Compression/DeflaterEngine.cs
Added: trunk/irc/TechBot/Compression/DeflaterHuffman.cs
Added: trunk/irc/TechBot/Compression/DeflaterPending.cs
Added: trunk/irc/TechBot/Compression/Inflater.cs
Added: trunk/irc/TechBot/Compression/InflaterDynHeader.cs
Added: trunk/irc/TechBot/Compression/InflaterHuffmanTree.cs
Added: trunk/irc/TechBot/Compression/PendingBuffer.cs
Added: trunk/irc/TechBot/Compression/Streams/
Added: trunk/irc/TechBot/Compression/Streams/DeflaterOutputStream.cs
Added: trunk/irc/TechBot/Compression/Streams/InflaterInputStream.cs
Added: trunk/irc/TechBot/Compression/Streams/OutputWindow.cs
Added: trunk/irc/TechBot/Compression/Streams/StreamManipulator.cs
Added: trunk/irc/TechBot/Compression/ZipException.cs
Added: trunk/irc/TechBot/Default.build
Added: trunk/irc/TechBot/TechBot/
Added: trunk/irc/TechBot/TechBot/App.config
Added: trunk/irc/TechBot/TechBot/AssemblyInfo.cs
Added: trunk/irc/TechBot/TechBot/Default.build
Added: trunk/irc/TechBot/TechBot/ServiceThread.cs
Added: trunk/irc/TechBot/TechBot/TechBot.prjx
Added: trunk/irc/TechBot/TechBot/TechBotService.cs
Added: trunk/irc/TechBot/TechBot.Console/
Added: trunk/irc/TechBot/TechBot.Console/App.config
Added: trunk/irc/TechBot/TechBot.Console/AssemblyInfo.cs
Added: trunk/irc/TechBot/TechBot.Console/Default.build
Added: trunk/irc/TechBot/TechBot.Console/Main.cs
Added: trunk/irc/TechBot/TechBot.Console/TechBot.Console.cmbx
Added: trunk/irc/TechBot/TechBot.Console/TechBot.Console.prjx
Added: trunk/irc/TechBot/TechBot.IRCLibrary/
Added: trunk/irc/TechBot/TechBot.IRCLibrary/AssemblyInfo.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/Default.build
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IRC.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IrcChannel.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IrcClient.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IrcException.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IrcMessage.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/IrcUser.cs
Added: trunk/irc/TechBot/TechBot.IRCLibrary/TechBot.IRCLibrary.cmbx
Added: trunk/irc/TechBot/TechBot.IRCLibrary/TechBot.IRCLibrary.prjx
Added: trunk/irc/TechBot/TechBot.Library/
Added: trunk/irc/TechBot/TechBot.Library/ApiCommand.cs
Added: trunk/irc/TechBot/TechBot.Library/AssemblyInfo.cs
Added: trunk/irc/TechBot/TechBot.Library/Default.build
Added: trunk/irc/TechBot/TechBot.Library/HelpCommand.cs
Added: trunk/irc/TechBot/TechBot.Library/HresultCommand.cs
Added: trunk/irc/TechBot/TechBot.Library/ICommand.cs
Added: trunk/irc/TechBot/TechBot.Library/IrcService.cs
Added: trunk/irc/TechBot/TechBot.Library/NtStatusCommand.cs
Added: trunk/irc/TechBot/TechBot.Library/NumberParser.cs
Added: trunk/irc/TechBot/TechBot.Library/ServiceOutput.cs
Added: trunk/irc/TechBot/TechBot.Library/SvnCommand.cs
</pre><strong class="error">[truncated at 100 lines; 5 more skipped]</strong>
<hr /><div class="file">
<div class="fileheader"><big><b>Added: trunk/irc/TechBot/CHMLibrary/AssemblyInfo.cs</b></big></div>
<pre class="diff"><small id="info">--- trunk/irc/TechBot/CHMLibrary/AssemblyInfo.cs        2005-01-15 19:15:45 UTC (rev 13063)
+++ trunk/irc/TechBot/CHMLibrary/AssemblyInfo.cs        2005-01-15 19:27:25 UTC (rev 13064)
@@ -0,0 +1,32 @@
</small></pre><pre class="diff" id="added">+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle(&quot;&quot;)]
+[assembly: AssemblyDescription(&quot;&quot;)]
+[assembly: AssemblyConfiguration(&quot;&quot;)]
+[assembly: AssemblyCompany(&quot;&quot;)]
+[assembly: AssemblyProduct(&quot;&quot;)]
+[assembly: AssemblyCopyright(&quot;&quot;)]
+[assembly: AssemblyTrademark(&quot;&quot;)]
+[assembly: AssemblyCulture(&quot;&quot;)]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all values by your own or you can build default build and revision
+// numbers with the '*' character (the default):
+
+[assembly: AssemblyVersion(&quot;1.0.*&quot;)]
+
+// The following attributes specify the key for the sign of your assembly. See the
+// .NET Framework documentation for more information about signing.
+// This is not required, if you don't want signing let these attributes like they're.
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile(&quot;&quot;)]
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/BinaryReaderHelp.cs</b></big></div>
<pre class="diff"><small id="info">--- trunk/irc/TechBot/CHMLibrary/CHMDecoding/BinaryReaderHelp.cs        2005-01-15 19:15:45 UTC (rev 13063)
+++ trunk/irc/TechBot/CHMLibrary/CHMDecoding/BinaryReaderHelp.cs        2005-01-15 19:27:25 UTC (rev 13064)
@@ -0,0 +1,274 @@
</small></pre><pre class="diff" id="added">+using System;
+using System.Collections;
+using System.IO;
+using System.Text;
+using System.Globalization;
+
+namespace HtmlHelp.ChmDecoding
+{
+        /// &lt;summary&gt;
+        /// The class &lt;c&gt;BinaryReaderHelp&lt;/c&gt; implements static helper methods for extracting binary data 
+        /// from a binary reader object.
+        /// &lt;/summary&gt;
+        internal class BinaryReaderHelp
+        {
+                /// &lt;summary&gt;
+                /// Internal helper method to extract null-terminated strings from a binary reader
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binReader&quot;&gt;reference to the binary reader&lt;/param&gt;
+                /// &lt;param name=&quot;offset&quot;&gt;offset in the stream&lt;/param&gt;
+                /// &lt;param name=&quot;noOffset&quot;&gt;true if the offset value should be used&lt;/param&gt;
+                /// &lt;param name=&quot;encoder&quot;&gt;encoder used for text encoding&lt;/param&gt;
+                /// &lt;returns&gt;An extracted string value&lt;/returns&gt;
+                internal static string ExtractString(ref BinaryReader binReader, int offset, bool noOffset, Encoding encoder)
+                {
+                        string strReturn = &quot;&quot;;
+
+                        if(encoder == null)
+                                encoder = Encoding.ASCII;
+
+                        ArrayList nameBytes = new ArrayList();
+                        byte curByte;
+                        
+                        if(!noOffset)
+                                binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
+
+                        if(binReader.BaseStream.Position &gt;= binReader.BaseStream.Length)
+                                return &quot;&quot;;
+
+                        curByte = binReader.ReadByte();
+                        while( (curByte != (byte)0) &amp;&amp; (binReader.BaseStream.Position &lt; binReader.BaseStream.Length) )
+                        {        
+                                nameBytes.Add( curByte );
+                                curByte = binReader.ReadByte();
+                        }
+
+                        byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType(&quot;System.Byte&quot;)));
+                        strReturn = encoder.GetString(name,0,name.Length);
+
+                        return strReturn;
+                }
+
+                /// &lt;summary&gt;
+                /// Internal helper method to extract a string with a specific length from the binary reader
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binReader&quot;&gt;reference to the binary reader&lt;/param&gt;
+                /// &lt;param name=&quot;length&quot;&gt;length of the string (number of bytes)&lt;/param&gt;
+                /// &lt;param name=&quot;offset&quot;&gt;offset in the stream&lt;/param&gt;
+                /// &lt;param name=&quot;noOffset&quot;&gt;true if the offset value should be used&lt;/param&gt;
+                /// &lt;param name=&quot;encoder&quot;&gt;encoder used for text encoding&lt;/param&gt;
+                /// &lt;returns&gt;An extracted string value&lt;/returns&gt;
+                internal static string ExtractString(ref BinaryReader binReader, int length, int offset, bool noOffset, Encoding encoder)
+                {
+                        string strReturn = &quot;&quot;;
+
+                        if(length == 0)
+                                return &quot;&quot;;
+
+                        if(encoder == null)
+                                encoder = Encoding.ASCII;
+
+                        ArrayList nameBytes = new ArrayList();
+                        byte curByte;
+                        
+                        if(!noOffset)
+                                binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
+
+                        if(binReader.BaseStream.Position &gt;= binReader.BaseStream.Length)
+                                return &quot;&quot;;
+
+                        curByte = binReader.ReadByte();
+                        while( (curByte != (byte)0) &amp;&amp; (nameBytes.Count &lt; length) &amp;&amp; (binReader.BaseStream.Position &lt; binReader.BaseStream.Length) )
+                        {        
+                                nameBytes.Add( curByte );
+
+                                if(nameBytes.Count &lt; length)
+                                        curByte = binReader.ReadByte();
+                        }
+
+                        byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType(&quot;System.Byte&quot;)));
+                        strReturn = encoder.GetString(name,0,name.Length);
+
+                        return strReturn;
+                }
+
+                /// &lt;summary&gt;
+                /// Internal helper method to extract a string with a specific length from the binary reader
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binReader&quot;&gt;reference to the binary reader&lt;/param&gt;
+                /// &lt;param name=&quot;bFoundTerminator&quot;&gt;reference to a bool vairable which will receive true if the
+                /// string terminator \0 was found. false indicates that the end of the stream was reached.&lt;/param&gt;
+                /// &lt;param name=&quot;offset&quot;&gt;offset in the stream&lt;/param&gt;
+                /// &lt;param name=&quot;noOffset&quot;&gt;true if the offset value should be used&lt;/param&gt;
+                /// &lt;param name=&quot;encoder&quot;&gt;encoder used for text encoding&lt;/param&gt;
+                /// &lt;returns&gt;An extracted string value&lt;/returns&gt;
+                internal static string ExtractString(ref BinaryReader binReader, ref bool bFoundTerminator, int offset, bool noOffset, Encoding encoder)
+                {
+                        string strReturn = &quot;&quot;;
+
+                        ArrayList nameBytes = new ArrayList();
+                        byte curByte;
+                        
+                        if(encoder == null)
+                                encoder = Encoding.ASCII;
+
+                        if(!noOffset)
+                                binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
+
+                        if(binReader.BaseStream.Position &gt;= binReader.BaseStream.Length)
+                                return &quot;&quot;;
+
+                        curByte = binReader.ReadByte();
+                        while( (curByte != (byte)0) &amp;&amp; (binReader.BaseStream.Position &lt; binReader.BaseStream.Length) )
+                        {        
+                                nameBytes.Add( curByte );
+                                curByte = binReader.ReadByte();
+
+                                if( curByte == (byte)0 )
+                                {
+                                        bFoundTerminator = true;
+                                }
+                        }
+
+                        byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType(&quot;System.Byte&quot;)));
+                        strReturn = encoder.GetString(name,0,name.Length);
+
+                        return strReturn;
+                }
+
+                /// &lt;summary&gt;
+                /// Internal helper method to extract a null-terminated UTF-16/UCS-2 strings from a binary reader
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binReader&quot;&gt;reference to the binary reader&lt;/param&gt;
+                /// &lt;param name=&quot;offset&quot;&gt;offset in the stream&lt;/param&gt;
+                /// &lt;param name=&quot;noOffset&quot;&gt;true if the offset value should be used&lt;/param&gt;
+                /// &lt;param name=&quot;encoder&quot;&gt;encoder used for text encoding&lt;/param&gt;
+                /// &lt;returns&gt;An extracted string value&lt;/returns&gt;
+                internal static string ExtractUTF16String(ref BinaryReader binReader, int offset, bool noOffset, Encoding encoder)
+                {
+                        string strReturn = &quot;&quot;;
+
+                        ArrayList nameBytes = new ArrayList();
+                        byte curByte;
+                        int lastByte=-1;
+                        
+                        if(!noOffset)
+                                binReader.BaseStream.Seek(offset, SeekOrigin.Begin);
+
+                        if(binReader.BaseStream.Position &gt;= binReader.BaseStream.Length)
+                                return &quot;&quot;;
+
+                        if(encoder == null)
+                                encoder = Encoding.Unicode;
+
+                        curByte = binReader.ReadByte();
+                        int nCnt = 0;
+                        while( ((curByte != (byte)0) || (lastByte != 0) ) &amp;&amp; (binReader.BaseStream.Position &lt; binReader.BaseStream.Length) )
+                        {        
+                                nameBytes.Add( curByte );
+
+                                if(nCnt%2 == 0)
+                                        lastByte = (int)curByte;
+
+                                curByte = binReader.ReadByte();
+
+                                nCnt++;
+                        }
+
+                        byte[] name = (byte[]) (nameBytes.ToArray(System.Type.GetType(&quot;System.Byte&quot;)));
+                        strReturn = Encoding.Unicode.GetString(name,0,name.Length);
+
+                        // apply text encoding
+                        name = Encoding.Default.GetBytes(strReturn);
+                        strReturn = encoder.GetString(name,0,name.Length);
+
+                        return strReturn;
+                }
+
+                /// &lt;summary&gt;
+                /// Internal helper for reading ENCINT encoded integer values
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binReader&quot;&gt;reference to the reader&lt;/param&gt;
+                /// &lt;returns&gt;a long value&lt;/returns&gt;
+                internal static long ReadENCINT(ref BinaryReader binReader)
+                {
+                        long nRet = 0;
+                        byte buffer = 0;
+                        int shift = 0;
+
+                        if(binReader.BaseStream.Position &gt;= binReader.BaseStream.Length)
+                                return nRet;
+                        
+                        do
+                        {
+                                buffer = binReader.ReadByte();
+                                nRet |= ((long)((buffer &amp; (byte)0x7F))) &lt;&lt; shift;
+                                shift += 7;
+
+                        }while ( (buffer &amp; (byte)0x80) != 0);
+
+                        return nRet;
+                }
+
+                /// &lt;summary&gt;
+                /// Reads an s/r encoded value from the byte array and decodes it into an integer
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;wclBits&quot;&gt;a byte array containing all bits (contains only 0 or 1 elements)&lt;/param&gt;
+                /// &lt;param name=&quot;s&quot;&gt;scale param for encoding&lt;/param&gt;
+                /// &lt;param name=&quot;r&quot;&gt;root param for encoding&lt;/param&gt;
+                /// &lt;param name=&quot;nBitIndex&quot;&gt;current index in the wclBits array&lt;/param&gt;
+                /// &lt;returns&gt;Returns an decoded integer value.&lt;/returns&gt;
+                internal static int ReadSRItem(byte[] wclBits, int s, int r, ref int nBitIndex)
+                {
+                        int nRet = 0;
+                        int q = r;
+
+                        int nPref1Cnt = 0;
+
+                        while( wclBits[nBitIndex++] == 1)
+                        {
+                                nPref1Cnt++;
+                        }
+
+                        if(nPref1Cnt == 0)
+                        {
+                                int nMask = 0;
+
+                                for(int nbits=0; nbits&lt;q;nbits++)
+                                {
+                                        nMask |= ( 0x01 &amp; (int)wclBits[nBitIndex]) &lt;&lt; (q-nbits-1);
+                                        nBitIndex++;
+                                }
+
+                                nRet = nMask;
+                        } 
+                        else 
+                        {
+                                q += (nPref1Cnt-1);
+
+                                int nMask = 0;
+                                int nRMaxValue = 0;
+
+                                for(int nbits=0; nbits&lt;q;nbits++)
+                                {
+                                        nMask |= ( 0x01 &amp; (int)wclBits[nBitIndex]) &lt;&lt; (q-nbits-1);
+                                        nBitIndex++;
+                                }
+
+                                for(int nsv=0; nsv&lt;r; nsv++)
+                                {
+                                        nRMaxValue = nRMaxValue &lt;&lt; 1;
+                                        nRMaxValue |= 0x1;
+                                }
+        
+                                nRMaxValue++; // startvalue of s/r encoding with 1 prefixing '1'
+
+                                nRMaxValue *= (int) Math.Pow((double)2, (double)(nPref1Cnt-1));
+
+                                nRet = nRMaxValue + nMask;
+                        }
+
+                        return nRet;
+                }
+        }
+}
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMBtree.cs</b></big></div>
<pre class="diff"><small id="info">--- trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMBtree.cs        2005-01-15 19:15:45 UTC (rev 13063)
+++ trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMBtree.cs        2005-01-15 19:27:25 UTC (rev 13064)
@@ -0,0 +1,325 @@
</small></pre><pre class="diff" id="added">+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+
+namespace HtmlHelp.ChmDecoding
+{
+        /// &lt;summary&gt;
+        /// The class &lt;c&gt;CHMBtree&lt;/c&gt; implements methods/properties to decode the binary help index. 
+        /// This class automatically creates an index arraylist for the current CHMFile instance. 
+        /// It does not store the index internally !
+        /// &lt;/summary&gt;
+        /// &lt;remarks&gt;The binary index can be found in the storage file $WWKeywordLinks/BTree&lt;/remarks&gt;
+        internal sealed class CHMBtree : IDisposable
+        {
+                /// &lt;summary&gt;
+                /// Constant specifying the size of the string blocks
+                /// &lt;/summary&gt;
+                private const int BLOCK_SIZE = 2048;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if the object is going to be disposed
+                /// &lt;/summary&gt;
+                private bool disposed = false;
+                /// &lt;summary&gt;
+                /// Internal member storing the binary file data
+                /// &lt;/summary&gt;
+                private byte[] _binaryFileData = null;
+                /// &lt;summary&gt;
+                /// Internal member storing flags
+                /// &lt;/summary&gt;
+                private int _flags = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the data format
+                /// &lt;/summary&gt;
+                private byte[] _dataFormat = new byte[16];
+                /// &lt;summary&gt;
+                /// Internal member storing the index of the last listing block
+                /// &lt;/summary&gt;
+                private int _indexOfLastListingBlock = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the index of the root block
+                /// &lt;/summary&gt;
+                private int _indexOfRootBlock = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the number of blocks
+                /// &lt;/summary&gt;
+                private int _numberOfBlocks = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the tree depth. 
+                /// (1 if no index blocks, 2 one level of index blocks, ...)
+                /// &lt;/summary&gt;
+                private int _treeDepth = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the number of keywords in the file
+                /// &lt;/summary&gt;
+                private int _numberOfKeywords = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the codepage
+                /// &lt;/summary&gt;
+                private int _codePage = 0;
+                /// &lt;summary&gt;
+                /// true if the index is from a CHI or CHM file, else CHW
+                /// &lt;/summary&gt;
+                private bool _isCHI_CHM = true;
+                /// &lt;summary&gt;
+                /// Internal member storing the associated chmfile object
+                /// &lt;/summary&gt;
+                private CHMFile _associatedFile = null;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if we have to read listing or index blocks
+                /// &lt;/summary&gt;
+                private bool _readListingBlocks = true;
+                /// &lt;summary&gt;
+                /// Internal member storing an indexlist of the current file.
+                /// &lt;/summary&gt;
+                private ArrayList _indexList = new ArrayList();
+
+                /// &lt;summary&gt;
+                /// Constructor of the class
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;binaryFileData&quot;&gt;binary file data of the $WWKeywordLinks/BTree file&lt;/param&gt;
+                /// &lt;param name=&quot;associatedFile&quot;&gt;associated chm file&lt;/param&gt;
+                public CHMBtree(byte[] binaryFileData, CHMFile associatedFile)
+                {
+                        if( associatedFile == null)
+                        {
+                                throw new ArgumentException(&quot;CHMBtree.ctor() - Associated CHMFile must not be null !&quot;, &quot;associatedFile&quot;);
+                        }
+
+                        _binaryFileData = binaryFileData;
+                        _associatedFile = associatedFile;
+                        DecodeData();
+
+                        // clear internal binary data after extraction
+                        _binaryFileData = null;
+                }
+
+                /// &lt;summary&gt;
+                /// Decodes the binary file data and fills the internal properties
+                /// &lt;/summary&gt;
+                /// &lt;returns&gt;true if succeeded&lt;/returns&gt;
+                private bool DecodeData()
+                {
+                        bool bRet = true;
+
+                        MemoryStream memStream = new MemoryStream(_binaryFileData);
+                        BinaryReader binReader = new BinaryReader(memStream);
+                        
+                        int nCurOffset = 0;
+                        int nTemp = 0;
+
+                        // decode header
+                        binReader.ReadChars(2); // 2chars signature (not important)
+                        
+                        _flags = (int)binReader.ReadInt16(); // WORD flags
+
+                        binReader.ReadInt16(); // size of blocks (always 2048)
+
+                        _dataFormat = binReader.ReadBytes(16);
+                        
+                        binReader.ReadInt32(); &nbsp;// unknown DWORD
+
+                        _indexOfLastListingBlock = binReader.ReadInt32();
+                        _indexOfRootBlock = binReader.ReadInt32();
+
+                        binReader.ReadInt32(); // unknown DWORD
+
+                        _numberOfBlocks = binReader.ReadInt32();
+                        _treeDepth = binReader.ReadInt16();
+                        _numberOfKeywords = binReader.ReadInt32();
+                        _codePage = binReader.ReadInt32();
+
+                        binReader.ReadInt32(); // lcid DWORD
+                        
+                        nTemp = binReader.ReadInt32();
+                        _isCHI_CHM = (nTemp==1);
+
+                        binReader.ReadInt32(); // unknown DWORD
+                        binReader.ReadInt32(); // unknown DWORD
+                        binReader.ReadInt32(); // unknown DWORD
+                        binReader.ReadInt32(); // unknown DWORD
+
+                        // end of header decode
+
+                        while( (memStream.Position &lt; memStream.Length) &amp;&amp; (bRet) )
+                        {
+                                nCurOffset = (int)memStream.Position;
+                                byte [] dataBlock = binReader.ReadBytes(BLOCK_SIZE);
+                                bRet &amp;= DecodeBlock(dataBlock, ref nCurOffset, _treeDepth-1);
+                        }
+
+                        return bRet;
+                }
+
+                /// &lt;summary&gt;
+                /// Decodes a block of url-string data
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;dataBlock&quot;&gt;block of data&lt;/param&gt;
+                /// &lt;param name=&quot;nOffset&quot;&gt;current file offset&lt;/param&gt;
+                /// &lt;param name=&quot;indexBlocks&quot;&gt;number of index blocks&lt;/param&gt;
+                /// &lt;returns&gt;true if succeeded&lt;/returns&gt;
+                private bool DecodeBlock( byte[] dataBlock, ref int nOffset, int indexBlocks )
+                {
+                        bool bRet = true;
+                        int nblockOffset = nOffset;
+
+                        MemoryStream memStream = new MemoryStream(dataBlock);
+                        BinaryReader binReader = new BinaryReader(memStream);
+
+                        int freeSpace = binReader.ReadInt16(); // length of freespace
+                        int nrOfEntries = binReader.ReadInt16(); // number of entries
+
+                        bool bListingEndReached = false;
+
+                        //while( (memStream.Position &lt; (memStream.Length-freeSpace)) &amp;&amp; (bRet) )
+                        //{
+                                int nIndexOfPrevBlock = -1;
+                                int nIndexOfNextBlock = -1;
+                                int nIndexOfChildBlock = 0;
+                                
+                                if(_readListingBlocks)
+                                {
+                                        nIndexOfPrevBlock = binReader.ReadInt32(); // -1 if this is the header
+                                        nIndexOfNextBlock = binReader.ReadInt32(); // -1 if this is the last block
+                                } 
+                                else 
+                                {
+                                        nIndexOfChildBlock = binReader.ReadInt32(); 
+                                }
+
+                                for(int nE = 0; nE &lt; nrOfEntries; nE++)
+                                {
+                                        if(_readListingBlocks)
+                                        {
+                                                bListingEndReached = (nIndexOfNextBlock==-1);
+
+                                                string keyWord = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
+
+                                                bool isSeeAlsoKeyword = (binReader.ReadInt16()!=0);
+                                
+                                                int indent = binReader.ReadInt16(); // indent of entry
+                                                int nCharIndex = binReader.ReadInt32();
+
+                                                binReader.ReadInt32();
+
+                                                int numberOfPairs =        binReader.ReadInt32();
+
+                                                int[] nTopics = new int[numberOfPairs];
+                                                string[] seeAlso = new string[numberOfPairs];
+
+                                                for(int i=0; i &lt; numberOfPairs; i++)
+                                                {
+                                                        if(isSeeAlsoKeyword)
+                                                        {
+                                                                seeAlso[i] = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
+                                                        } 
+                                                        else 
+                                                        {
+                                                                nTopics[i] = binReader.ReadInt32();
+                                                        }
+                                                }
+
+                                                binReader.ReadInt32(); // unknown
+
+                                                int nIndexOfThisEntry = binReader.ReadInt32();
+
+                                                IndexItem newItem = new IndexItem(_associatedFile, keyWord, isSeeAlsoKeyword, indent, nCharIndex, nIndexOfThisEntry, seeAlso, nTopics);
+                                                _indexList.Add(newItem);
+                                        } 
+                                        else 
+                                        {
+                                                string keyWord = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
+
+                                                bool isSeeAlsoKeyword = (binReader.ReadInt16()!=0);
+                                
+                                                int indent = binReader.ReadInt16(); // indent of entry
+                                                int nCharIndex = binReader.ReadInt32();
+
+                                                binReader.ReadInt32();
+
+                                                int numberOfPairs =        binReader.ReadInt32();
+
+                                                int[] nTopics = new int[numberOfPairs];
+                                                string[] seeAlso = new string[numberOfPairs];
+
+                                                for(int i=0; i &lt; numberOfPairs; i++)
+                                                {
+                                                        if(isSeeAlsoKeyword)
+                                                        {
+                                                                seeAlso[i] = BinaryReaderHelp.ExtractUTF16String(ref binReader, 0, true, _associatedFile.TextEncoding);
+                                                        } 
+                                                        else 
+                                                        {
+                                                                nTopics[i] = binReader.ReadInt32();
+                                                        }
+                                                }
+
+                                                int nIndexChild = binReader.ReadInt32();
+                                                int nIndexOfThisEntry=-1;
+
+                                                IndexItem newItem = new IndexItem(_associatedFile, keyWord, isSeeAlsoKeyword, indent, nCharIndex, nIndexOfThisEntry, seeAlso, nTopics);
+                                                _indexList.Add(newItem);
+
+                                        }
+                                }
+                        //}
+
+                        binReader.ReadBytes(freeSpace);
+                        
+
+                        if( bListingEndReached )
+                                _readListingBlocks = false;
+
+                        return bRet;
+                }
+
+                /// &lt;summary&gt;
+                /// Gets the internal generated index list
+                /// &lt;/summary&gt;
+                internal ArrayList IndexList
+                {
+                        get { return _indexList; }
+                }
+
+                /// &lt;summary&gt;
+                /// Implement IDisposable.
+                /// &lt;/summary&gt;
+                public void Dispose()
+                {
+                        Dispose(true);
+                        // This object will be cleaned up by the Dispose method.
+                        // Therefore, you should call GC.SupressFinalize to
+                        // take this object off the finalization queue 
+                        // and prevent finalization code for this object
+                        // from executing a second time.
+                        GC.SuppressFinalize(this);
+                }
+
+                /// &lt;summary&gt;
+                /// Dispose(bool disposing) executes in two distinct scenarios. 
+                /// If disposing equals true, the method has been called directly 
+                /// or indirectly by a user's code. Managed and unmanaged resources 
+                /// can be disposed. 
+                /// If disposing equals false, the method has been called by the 
+                /// runtime from inside the finalizer and you should not reference &nbsp;
+                /// other objects. Only unmanaged resources can be disposed.
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;disposing&quot;&gt;disposing flag&lt;/param&gt;
+                private void Dispose(bool disposing)
+                {
+                        // Check to see if Dispose has already been called.
+                        if(!this.disposed)
+                        {
+                                // If disposing equals true, dispose all managed 
+                                // and unmanaged resources.
+                                if(disposing)
+                                {
+                                        // Dispose managed resources.
+                                        _binaryFileData = null;
+                                }
+                        }
+                        disposed = true; &nbsp; &nbsp; &nbsp; &nbsp; 
+                }
+        }
+}
</pre></div>
<hr /><div class="file">
<div class="fileheader"><big><b>Added: trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMFile.cs</b></big></div>
<pre class="diff"><small id="info">--- trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMFile.cs        2005-01-15 19:15:45 UTC (rev 13063)
+++ trunk/irc/TechBot/CHMLibrary/CHMDecoding/CHMFile.cs        2005-01-15 19:27:25 UTC (rev 13064)
@@ -0,0 +1,2061 @@
</small></pre><pre class="diff" id="added">+using System;
+using System.Diagnostics;
+using System.Collections;
+using System.Collections.Specialized;
+using System.IO;
+using System.Text;
+using System.Runtime.InteropServices;
+using System.Globalization;
+// using HtmlHelp.Storage;
+
+namespace HtmlHelp.ChmDecoding
+{
+        /// &lt;summary&gt;
+        /// Internal enumeration for specifying the type of the html-help file
+        /// &lt;/summary&gt;
+        internal enum HtmlHelpFileType
+        {
+                /// &lt;summary&gt;
+                /// CHM - compiled contents file
+                /// &lt;/summary&gt;
+                /// &lt;remarks&gt;A file with this extension must always exist. If the file would be too long, some parts 
+                /// can be splitted into the filestypes below.&lt;/remarks&gt;
+                CHM = 0,
+                /// &lt;summary&gt;
+                /// CHI - compiled system file
+                /// &lt;/summary&gt;
+                CHI = 1,
+                /// &lt;summary&gt;
+                /// CHQ - compiled fulltext search file
+                /// &lt;/summary&gt;
+                CHQ = 2,
+                /// &lt;summary&gt;
+                /// CHW - compiled index file
+                /// &lt;/summary&gt;
+                CHW = 3
+
+        }
+
+        /// &lt;summary&gt;
+        /// The class &lt;c&gt;CHMFile&lt;/c&gt; implemts methods and properties for handling a single chmfile.
+        /// &lt;/summary&gt;
+        public sealed class CHMFile : IDisposable
+        {
+                /// &lt;summary&gt;
+                /// Internal member storing a reference to the hosting HtmlHelpSystem instance
+                /// &lt;/summary&gt;
+                private HtmlHelpSystem _systemInstance = null;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if only system data has been loaded
+                /// &lt;/summary&gt;
+                private bool _onlySystem = false;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if the object is going to be disposed
+                /// &lt;/summary&gt;
+                private bool disposed = false;
+                /// &lt;summary&gt;
+                /// Internal arraylist containing the table of contents
+                /// &lt;/summary&gt;
+                private ArrayList _toc = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal arraylist containing items of the toc which are merge-Links
+                /// &lt;/summary&gt;
+                private ArrayList _mergeLinks = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal member storing the read information types
+                /// &lt;/summary&gt;
+                private ArrayList _informationTypes = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal member storing the read categories
+                /// &lt;/summary&gt;
+                private ArrayList _categories = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal arraylist containing the index (klinks)
+                /// &lt;/summary&gt;
+                private ArrayList _indexKLinks = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal arraylist containing the index (alinks)
+                /// &lt;/summary&gt;
+                private ArrayList _indexALinks = new ArrayList();
+                /// &lt;summary&gt;
+                /// Internal member storing the full filename
+                /// &lt;/summary&gt;
+                private string _chmFileName = &quot;&quot;;
+                /// &lt;summary&gt;
+                /// Internal member storing the full filename of the chi-file (includes all system files)
+                /// The file name is zero-length if there is no chi-file
+                /// &lt;/summary&gt;
+                private string _chiFileName = &quot;&quot;;
+                /// &lt;summary&gt;
+                /// Internal member storing the full filename of the chw-file (includes the help index)
+                /// The file name is zero-length if there is no chw-file
+                /// &lt;/summary&gt;
+                private string _chwFileName = &quot;&quot;;
+                /// &lt;summary&gt;
+                /// Internal member storing the full filename of the chq-file (includes the fulltext contents)
+                /// The file name is zero-length if there is no chq-file
+                /// &lt;/summary&gt;
+                private string _chqFileName = &quot;&quot;;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #SYSTEM file
+                /// &lt;/summary&gt;
+                private CHMSystem _systemFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #IDXHDR file
+                /// &lt;/summary&gt;
+                private CHMIdxhdr _idxhdrFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #STRINGS file
+                /// &lt;/summary&gt;
+                private CHMStrings _stringsFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #URLSTR file
+                /// &lt;/summary&gt;
+                private CHMUrlstr _urlstrFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #URLTBL file
+                /// &lt;/summary&gt;
+                private CHMUrltable _urltblFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #TOPICS file
+                /// &lt;/summary&gt;
+                private CHMTopics _topicsFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal #TOCIDX file
+                /// &lt;/summary&gt;
+                private CHMTocidx _tocidxFile = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal binary index file (KLinks).
+                /// &lt;/summary&gt;
+                private CHMBtree _kLinks = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the decoded information from the internal binary index file (ALinks).
+                /// &lt;/summary&gt;
+                private CHMBtree _aLinks = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the fulltext searcher for this file
+                /// &lt;/summary&gt;
+                private FullTextEngine _ftSearcher = null;
+                /// &lt;summary&gt;
+                /// Internal member storing the default encoder
+                /// &lt;/summary&gt;
+                private Encoding _textEncoding = Encoding.GetEncoding(1252); // standard windows-1252 encoder
+                /// &lt;summary&gt;
+                /// Internal memebr storing the chm file info
+                /// &lt;/summary&gt;
+                private ChmFileInfo _chmFileInfo = null;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if the dump must be written (if enabled)
+                /// &lt;/summary&gt;
+                private bool _mustWriteDump = false;
+                /// &lt;summary&gt;
+                /// Internal flag specifying if data was read using the dump
+                /// &lt;/summary&gt;
+                private bool _dumpRead = false;
+                /// &lt;summary&gt;
+                /// Internal member for specifying the number of dump-reading trys.
+                /// If dump-reading fails, this is used that it will not be opened a second time
+                /// (in CHM-Systems with CHM, CHI, etc. files)
+                /// &lt;/summary&gt;
+                private int _dumpReadTrys = 0;
+                /// &lt;summary&gt;
+                /// Internal member storing the dumping info instance
+                /// &lt;/summary&gt;
+                private DumpingInfo _dmpInfo = null;
+
+                private CHMStream.CHMStream _currentWrapper;
+                private CHMStream.CHMStream _baseStream=null;
+                public CHMStream.CHMStream BaseStream
+                {
+                        get 
+                        { 
+                                if (_baseStream==null)
+                                        _baseStream=new CHMStream.CHMStream(this.ChmFilePath);
+                                return _baseStream; 
+                        }
+                }
+
+                /// &lt;summary&gt;
+                /// Creates a new instance of the class
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;systemInstance&quot;&gt;a reference to the hosting HtmlHelpSystem instance&lt;/param&gt;
+                /// &lt;param name=&quot;chmFile&quot;&gt;chm file to read&lt;/param&gt;
+                public CHMFile(HtmlHelpSystem systemInstance, string chmFile) : this(systemInstance, chmFile, false, null)
+                {
+                }
+
+                /// &lt;summary&gt;
+                /// Creates a new instance of the class
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;systemInstance&quot;&gt;a reference to the hosting HtmlHelpSystem instance&lt;/param&gt;
+                /// &lt;param name=&quot;chmFile&quot;&gt;chm file to read&lt;/param&gt;
+                /// &lt;param name=&quot;dmpInfo&quot;&gt;A dumping info class&lt;/param&gt;
+                public CHMFile(HtmlHelpSystem systemInstance, string chmFile, DumpingInfo dmpInfo) : this(systemInstance, chmFile, false, dmpInfo)
+                {
+                }
+
+                /// &lt;summary&gt;
+                /// Creates a new instance of the class
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;systemInstance&quot;&gt;a reference to the hosting HtmlHelpSystem instance&lt;/param&gt;
+                /// &lt;param name=&quot;chmFile&quot;&gt;chm file to read&lt;/param&gt;
+                /// &lt;param name=&quot;onlySystemData&quot;&gt;true if only system data should be extracted (no index or toc)&lt;/param&gt;
+                internal CHMFile(HtmlHelpSystem systemInstance, string chmFile, bool onlySystemData) : this(systemInstance, chmFile, onlySystemData, null)
+                {
+                }
+
+                /// &lt;summary&gt;
+                /// Creates a new instance of the class
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;systemInstance&quot;&gt;a reference to the hosting HtmlHelpSystem instance&lt;/param&gt;
+                /// &lt;param name=&quot;chmFile&quot;&gt;chm file to read&lt;/param&gt;
+                /// &lt;param name=&quot;onlySystemData&quot;&gt;true if only system data should be extracted (no index or toc)&lt;/param&gt;
+                /// &lt;param name=&quot;dmpInfo&quot;&gt;A dumping info class&lt;/param&gt;
+                internal CHMFile(HtmlHelpSystem systemInstance, string chmFile, bool onlySystemData, DumpingInfo dmpInfo)
+                {
+                        _systemInstance = systemInstance;
+                        _dumpReadTrys=0;
+
+                        _dmpInfo = dmpInfo;
+                        if(dmpInfo != null)
+                        {
+                                dmpInfo.ChmFile = this;
+                        }
+
+                        if( ! chmFile.ToLower().EndsWith(&quot;.chm&quot;) )
+                        {
+                                throw new ArgumentException(&quot;HtmlHelp file must have the extension .chm !&quot;, &quot;chmFile&quot;);
+                        }
+
+                        _chmFileName = chmFile;
+                        _chiFileName = &quot;&quot;;
+
+                        // Read the IStorage file system
+                        if( File.Exists(chmFile) )
+                        {
+                                _onlySystem = onlySystemData;
+                                
+                                DateTime dtStartHH = DateTime.Now;
+
+                                string sCHIName = _chmFileName.Substring(0, _chmFileName.Length-3) + &quot;chi&quot;;
+                                string sCHQName = _chmFileName.Substring(0, _chmFileName.Length-3) + &quot;chq&quot;;
+                                string sCHWName = _chmFileName.Substring(0, _chmFileName.Length-3) + &quot;chw&quot;;
+
+                                // If there is a CHI file present (this file includes the internal system files for the current chm file)
+                                if( File.Exists(sCHIName) )
+                                {
+                                        _chiFileName = sCHIName;
+                                
+                                        ReadFile(_chiFileName, HtmlHelpFileType.CHI);
+                                }
+
+                                // If there is a CHW file present (this file includes the internal binary index of the help)
+                                if(( File.Exists(sCHWName) ) &amp;&amp; (!_onlySystem) )
+                                {
+                                        _chwFileName = sCHWName;
+                                
+                                        ReadFile(_chwFileName, HtmlHelpFileType.CHW);
+                                }
+
+                                // If there is a CHQ file present (this file includes the fulltext-search data)
+                                if(( File.Exists(sCHQName) ) &amp;&amp; (!_onlySystem) )
+                                {
+                                        _chqFileName = sCHQName;
+                                
+                                        ReadFile(_chqFileName, HtmlHelpFileType.CHQ);
+                                }
+
+                                ReadFile(chmFile, HtmlHelpFileType.CHM);
+
+                                if(_mustWriteDump)
+                                {                                        
+                                        _mustWriteDump = !SaveDump(dmpInfo);
+
+                                }
+
+                                // check the default-topic setting
+                                if(_systemFile.DefaultTopic.Length &gt; 0)
+                                {
+                                        CHMStream.CHMStream iw=null;
+                                        iw = new CHMStream.CHMStream(chmFile);
+                                        _currentWrapper=iw;
+
+                                        // tryo to open the topic file
+                                        MemoryStream fileObject = iw.OpenStream( _systemFile.DefaultTopic);
+                                        if( fileObject != null)
+                                        {
+                                                // if succeed, the topic default topic is OK
+                                                fileObject.Close();
+                                        } 
+                                        else 
+                                        {
+                                                // set the first topic of the toc-tree as default topic
+                                                if(_toc.Count &gt; 0)
+                                                {
+                                                        _systemFile.SetDefaultTopic( ((TOCItem) _toc[0]).Local );
+                                                }
+                                        }
+                                        _currentWrapper=null;
+                                } 
+                                else 
+                                {
+                                        // set the first topic of the toc-tree as default topic
+                                        if(_toc.Count &gt; 0)
+                                        {
+                                                _systemFile.SetDefaultTopic( ((TOCItem) _toc[0]).Local );
+                                        }
+                                }
+
+                                _chmFileInfo = new ChmFileInfo(this);
+                        } 
+                        else 
+                        {
+                                throw new ArgumentException(&quot;File '&quot; + chmFile + &quot;' not found !&quot;, &quot;chmFile&quot;);
+                        }
+                }
+
+                /// &lt;summary&gt;
+                /// Read a IStorage file
+                /// &lt;/summary&gt;
+                /// &lt;param name=&quot;fname&quot;&gt;filename&lt;/param&gt;
+                /// &lt;param name=&quot;type&quot;&gt;type of file&lt;/param&gt;
+                private void ReadFile(string fname, HtmlHelpFileType type)
+                {
+                        CHMStream.CHMStream iw=null;
+                        iw=new CHMStream.CHMStream();                        
+                        iw.OpenCHM(fname);
+                        _currentWrapper=iw;
+                        MemoryStream fileObject=null;                        
+
+                        // ITStorageWrapper iw = null;
+
+                        // Open the internal chm system files and parse their content
+                        // FileObject fileObject = null;
+                        // iw = new ITStorageWrapper(fname, false);                        
+
+                        if( (type != HtmlHelpFileType.CHQ) &amp;&amp; (type != HtmlHelpFileType.CHW) )
+                        {                                
+                                fileObject = iw.OpenStream(&quot;#SYSTEM&quot;);
+                                if ((fileObject != null) &amp;&amp; (fileObject.Length&gt;0))
+                                        _systemFile = new CHMSystem(fileObject.ToArray(), this);                                                                        
+
+                                fileObject = iw.OpenStream(&quot;#IDXHDR&quot;);
+                                if ((fileObject != null) &amp;&amp; (fileObject.Length&gt;0))
+                                        _idxhdrFile = new CHMIdxhdr(fileObject.ToArray(), this);                                        
+                                
+                                // try to read Dump
+                                if((!_dumpRead)&amp;&amp;(CheckDump(_dmpInfo))&amp;&amp;(_dumpReadTrys==0))
+                                {
+                                        _dumpReadTrys++;
</pre>
<strong class="error">[truncated at 1000 lines; 23868 more skipped]</strong>
</div>

</body>
</html>