Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 864d1c3c3cd8df4e3a2692faf8776e05 > files > 1190

db4o-doc-7.4-2.fc13.i686.rpm

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Diagnostic Messages Filter</title>
    <link rel="stylesheet" type="text/css" href="../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Diagnostic Messages Filter</h1><script>
//We attach this function to a browser object as a variable so that if multiple of these blocks are
//present on the same page, then they will simply over-write eachother with the same function instead
//of generating a naming collision.
window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){
	var sContent = document.getElementById(sID).innerText;
	if( window.clipboardData && clipboardData.setData )
	{
		clipboardData.setData("Text", sContent);
	}
	else
	{
		alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions.");
	}
}
</script>


<p>The standard listeners can potentially produce quite a lot of messages. By writing your own DiagnosticListener you can filter that information.</p>

<p>
On the stage of application tuning you can be interested in optimizing perfor<span id="__firefox-findbar-search-id" style="padding:0pt;background-color:yellow;color:black;display:inline;font-size:inherit;"></span>mance through indexing. Diagnostics can help you with that giving information about queries that are running on un-indexed fields. Having this information you can decide which queries are frequent and heavy and should be indexed, and which have little performance impact and do not need an index. Field indexes dramatically improve query performance but they may considerably reduce storage and update performance. </p>

<p>
In order to get rid of all unnecessary diagnostic information and&nbsp;concentrate on indexes let's create special diagnostic listener:</p>



<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">IndexDiagListener.cs</span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Open_Text').style.display='inline';"/><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_0_67_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;"> Copyright (C) 2004 - 2006 db4objects Inc. </span><span style="color: #008000; text-decoration: underline;">http://www.db4o.com</span><span style="color: #008000;"> </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Diagnostics;
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Db4objects.Db4o.Diagnostic;
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Diagnostics
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Open_Text').style.display='inline';"/></span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_185_490_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>  </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> IndexDiagListener: DiagnosticToConsole
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Open_Text').style.display='inline';"/>  </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_241_488_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>    </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> OnDiagnostic(Db4objects.Db4o.Diagnostic.IDiagnostic d) 
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Open_Text').style.display='inline';"/>    </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_324_485_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (d.GetType().Equals(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Db4objects.Db4o.Diagnostic.LoadedFromClassIndex)))
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsIndexDiagListener.Cs_IndexDiagListener.Cs_1002_52_431_481_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        System.Console.WriteLine(d.ToString());
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>  }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>}</span></span></div></pre></div></div>

</span>

<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">IndexDiagListener.vb</span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #008000;">'</span><span style="color: #008000;"> Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com </span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #000000;">
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> System
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> System.Diagnostics
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> Db4objects.Db4o
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">Imports</span><span style="color: #000000;"> Db4objects.Db4o.Diagnostic
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Open_Text').style.display='inline';"/></span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Namespace Db4objects</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_168_543_Open_Text"><span style="color: #0000FF;">Namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Diagnostics
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Open_Text').style.display='inline';"/>    </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Class IndexDiagListener</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_220_529_Open_Text"><span style="color: #0000FF;">Class</span><span style="color: #000000;"> IndexDiagListener
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Implements</span><span style="color: #000000;"> IDiagnosticListener
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Open_Text').style.display='inline';"/>        </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub OnDiagnostic()</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsIndexDiagListener.Vb_IndexDiagListener.Vb_1118_52_299_515_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> OnDiagnostic(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> d </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IDiagnostic) </span><span style="color: #0000FF;">Implements</span><span style="color: #000000;"> IDiagnosticListener.OnDiagnostic
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> </span><span style="color: #0000FF;">TypeOf</span><span style="color: #000000;"> d </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> LoadedFromClassIndex </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                System.Console.WriteLine(d)
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">If</span><span style="color: #000000;">
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span><span style="color: #000000;">
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    </span><span style="color: #0000FF;">End Class</span></span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/></span><span style="color: #0000FF;">End Namespace</span></span></div></pre></div></div>

<p>[/filter] <br>
</p>

<p>The following command will install the new listener:</p>

<p>[filter=java]</p>

<p>Java:</p><p><code>configuration.diagnostic().addListener(new IndexDiagListener())</code></p>

</span>

<span name="cs_wiki_filter" csw_filters="cs">

<p>c#: </p><p><code>configuration.Diagnostic().AddListener(new IndexDiagListener())</code></p>

</span>

<span name="cs_wiki_filter" csw_filters="vb">

<p>VB: </p><p><code>configuration.Diagnostic().AddListener(new IndexDiagListener())</code></p>

</span>

<p>We can check the efficacy of IndexDiagListener using queries from&nbsp;the previous paragraphs:</p>



<span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">DiagnosticExample.cs: <span class="fscMemberName">TestIndexDiagnostics</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Open_Text').style.display='inline';"/><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> TestIndexDiagnostics() </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_42_800_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        Db4oFactory.Configure().Diagnostic().RemoveAllListeners();
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        Db4oFactory.Configure().Diagnostic().AddListener(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> IndexDiagListener());
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        Db4oFactory.Configure().UpdateDepth(</span><span style="color: #800080;">3</span><span style="color: #000000;">);
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      File.Delete(YapFileName);    
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>      IObjectContainer db</span><span style="color: #000000;">=</span><span style="color: #000000;">Db4oFactory.OpenFile(YapFileName);
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Open_Text').style.display='inline';"/>      </span><span style="color: #0000FF;">try</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_334_762_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Pilot pilot1 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">,</span><span style="color: #800080;">99</span><span style="color: #000000;">);
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            db.Set(pilot1);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Pilot pilot2 </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">,</span><span style="color: #800080;">100</span><span style="color: #000000;">);
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            db.Set(pilot2);
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            QueryPilot(db);
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            SetEmptyObject(db);
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IQuery query </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query();
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            query.Constrain(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(Pilot));
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">99</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        IObjectSet  result </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute();
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        ListResult(result);
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Open_Text').style.display='inline';"/>      </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsCS.ZipsDiagnosticExample.Cs_DiagnosticExample.Cs_TestIndexDiagnostics_1873_73_774_796_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        db.Close();
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>      }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>    }</span></span></div></pre></div></div>

</span>

<span name="cs_wiki_filter" csw_filters="vb">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">DiagnosticExample.vb: <span class="fscMemberName">TestIndexDiagnostics</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73"><div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span style="color: #008080;">01</span><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestIndexDiagnostics()</span><span id="ResourcesReferenceTuningDiagnosticsdiagnosticsVB.ZipsDiagnosticExample.Vb_DiagnosticExample.Vb_TestIndexDiagnostics_2010_73_14_983_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestIndexDiagnostics()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Db4oFactory.Configure().Diagnostic().RemoveAllListeners()
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Db4oFactory.Configure().Diagnostic().AddListener(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> IndexDiagListener())
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            Db4oFactory.Configure().UpdateDepth(</span><span style="color: #800080;">3</span><span style="color: #000000;">)
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(YapFileName)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> db </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(YapFileName)
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilot1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Rubens Barrichello</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">99</span><span style="color: #000000;">)
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(pilot1)
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> pilot2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Pilot(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Michael Schumacher</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800080;">100</span><span style="color: #000000;">)
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Set(pilot2)
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                QueryPilot(db)
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                SetEmptyObject(db)
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> query </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IQuery </span><span style="color: #000000;">=</span><span style="color: #000000;"> db.Query()
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                query.Constrain(</span><span style="color: #0000FF;">GetType</span><span style="color: #000000;">(Pilot))
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                query.Descend(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">_points</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">).Constrain(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">99</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> query.Execute()
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                ListResult(result)
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Finally</span><span style="color: #000000;">
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                db.Close()
</span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>

</span>

<p>Potentially this piece of code triggers all the diagnostic objects, but we are getting only index warning messages due to IndexDiagListener.</p></div>
    </div>
    <div id="footer">
					This revision (9) was last Modified 2007-05-07T16:59:33 by Tetyana.
				</div>
  </body>
</html>