Sophie

Sophie

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

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

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>TP Example Code</title>
    <link rel="stylesheet" type="text/css" href="../../../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>TP Example Code</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><font color="#990000">This topic applies to .NET version only </font></p><p>Let's
look at Transparent Persistence example. We will use <a href="sensorpanel.html" class="wikiLink">SensorPanel</a> class from <a href="../../../../object_lifecycle.html" class="wikiLink">Activation</a>
example, which represents a simple linked list.</p><p>First of all we must configure the database to use TP:</p><span name="cs_wiki_filter" csw_filters="cs"><div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">TPExample.cs: <span class="fscMemberName">ConfigureTP</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55"><div><!--

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

--><span style="color: #008080;">1</span><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> IConfiguration ConfigureTP()
</span><span style="color: #008080;">2</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_ConfigureTP_374_55_52_270_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IConfiguration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration();
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">//</span><span style="color: #008000;"> add TP support</span><span style="color: #008000;">
</span><span style="color: #008080;">5</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            configuration.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> TransparentPersistenceSupport());
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> configuration;
</span><span style="color: #008080;">7</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">TPExample.vb: <span class="fscMemberName">ConfigureTP</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55"><div><!--

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

--><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function ConfigureTP()</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_ConfigureTP_483_55_15_282_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> ConfigureTP() </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration
</span><span style="color: #008080;">2</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;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.NewConfiguration
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">'</span><span style="color: #008000;"> add TP support</span><span style="color: #008000;">
</span><span style="color: #008080;">4</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            configuration.Add(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> TransparentPersistenceSupport)
</span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> configuration
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div>
</span><p>Now, we should explicitly store the objects that we want to be persistent:</p><span name="cs_wiki_filter" csw_filters="cs">
<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">TPExample.cs: <span class="fscMemberName">StoreSensorPanel</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60"><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: #0000FF;">private</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;"> StoreSensorPanel()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_47_571_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName);
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(Db4oFactory.NewConfiguration());
</span><span style="color: #008080;">05</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;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_218_561_Open_Text"><span style="color: #000000;">{
</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 id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_256_450_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: #008000;">//</span><span style="color: #008000;"> create a linked list with length 10</span><span style="color: #008000;">
</span><span style="color: #008080;">10</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    SensorPanel list </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> SensorPanel().CreateList(</span><span style="color: #800080;">10</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"/>                    container.Store(list);
</span><span style="color: #008080;">12</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;">13</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;">14</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_StoreSensorPanel_675_60_491_547_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"/>                    CloseDatabase();
</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/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">TPExample.vb: <span class="fscMemberName">StoreSensorPanel</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60"><div><!--

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

--><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub StoreSensorPanel()</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_StoreSensorPanel_795_60_15_525_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> StoreSensorPanel()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            File.Delete(Db4oFileName)
</span><span style="color: #008080;">03</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(Db4oFactory.NewConfiguration)
</span><span style="color: #008080;">04</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;">Not</span><span style="color: #000000;"> (container </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">) </span><span style="color: #0000FF;">Then</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"/>                </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</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: #008000;">'</span><span style="color: #008000;"> create a linked list with length 10</span><span style="color: #008000;">
</span><span style="color: #008080;">07</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> list </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> SensorPanel </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> SensorPanel).CreateList(</span><span style="color: #800080;">10</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"/>                    container.Set(list)
</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;">Finally</span><span style="color: #000000;">
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</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;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">12</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;">13</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>In order to test if TP actually works, we will select all the SensorPanel objects from the database, modify them and commit the transaction. If TP took place the objects will be modified in the database:</p><span name="cs_wiki_filter" csw_filters="cs">

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">TPExample.cs: <span class="fscMemberName">TestTransparentPersistence</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70"><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: #0000FF;">private</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;"> TestTransparentPersistence()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Open_Text').style.display='inline';"/>        </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_57_2666_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            StoreSensorPanel();
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IConfiguration configuration </span><span style="color: #000000;">=</span><span style="color: #000000;"> ConfigureTP();
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(configuration);
</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;">if</span><span style="color: #000000;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_263_1678_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;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_301_1371_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"/>                    IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.QueryByExample(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> SensorPanel(</span><span style="color: #800080;">1</span><span style="color: #000000;">));
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    SensorPanel sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</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"/>                    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (result.Size() </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Open_Text').style.display='inline';"/>                    </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_539_1353_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Before modification: </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"/>                        sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> (SensorPanel)result[</span><span style="color: #800080;">0</span><span style="color: #000000;">];
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> the object is a linked list, so each call to next()
</span><span style="color: #008080;">19</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> will need to activate a new object</span><span style="color: #008000;">
</span><span style="color: #008080;">20</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        SensorPanel next </span><span style="color: #000000;">=</span><span style="color: #000000;"> sensor.Next;
</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;">while</span><span style="color: #000000;"> (next </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Open_Text').style.display='inline';"/>                        </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_939_1201_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            System.Console.WriteLine(next);
</span><span style="color: #008080;">24</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            </span><span style="color: #008000;">//</span><span style="color: #008000;"> modify the next sensor</span><span style="color: #008000;">
</span><span style="color: #008080;">25</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                            next.Sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">object</span><span style="color: #000000;">)(</span><span style="color: #800080;">10</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;">)next.Sensor);
</span><span style="color: #008080;">26</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            next </span><span style="color: #000000;">=</span><span style="color: #000000;"> next.Next;
</span><span style="color: #008080;">27</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;">28</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">//</span><span style="color: #008000;"> Explicit commit stores and commits the changes at any time</span><span style="color: #008000;">
</span><span style="color: #008080;">29</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        container.Commit();
</span><span style="color: #008080;">30</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;">31</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;">32</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;">33</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1412_1664_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">34</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> If there are unsaved changes to activatable objects, they 
</span><span style="color: #008080;">35</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> will be implicitly saved and committed when the database 
</span><span style="color: #008080;">36</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> is closed</span><span style="color: #008000;">
</span><span style="color: #008080;">37</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    CloseDatabase();
</span><span style="color: #008080;">38</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;">39</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;">40</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">//</span><span style="color: #008000;"> reopen the database and check the modifications</span><span style="color: #008000;">
</span><span style="color: #008080;">41</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(configuration);
</span><span style="color: #008080;">42</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;"> (container </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">43</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Open_Text').style.display='inline';"/>            </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1838_2656_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">44</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;">45</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_1876_2545_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">46</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;"> container.QueryByExample(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> SensorPanel(</span><span style="color: #800080;">1</span><span style="color: #000000;">));
</span><span style="color: #008080;">47</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result);
</span><span style="color: #008080;">48</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    SensorPanel sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
</span><span style="color: #008080;">49</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;"> (result.Size() </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)
</span><span style="color: #008080;">50</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Open_Text').style.display='inline';"/>                    </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2114_2527_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">51</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">After modification: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">52</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> (SensorPanel)result[</span><span style="color: #800080;">0</span><span style="color: #000000;">];
</span><span style="color: #008080;">53</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        SensorPanel next </span><span style="color: #000000;">=</span><span style="color: #000000;"> sensor.Next;
</span><span style="color: #008080;">54</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #0000FF;">while</span><span style="color: #000000;"> (next </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
</span><span style="color: #008080;">55</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Open_Text').style.display='inline';"/>                        </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2372_2505_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">56</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            System.Console.WriteLine(next);
</span><span style="color: #008080;">57</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            next </span><span style="color: #000000;">=</span><span style="color: #000000;"> next.Next;
</span><span style="color: #008080;">58</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;">59</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;">60</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;">61</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;">62</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Open_Text').style.display='inline';"/>                </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesCS.ZipsTPExample.Cs_TPExample.Cs_TestTransparentPersistence_1127_70_2586_2642_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">63</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase();
</span><span style="color: #008080;">64</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;">65</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;">66</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">TPExample.vb: <span class="fscMemberName">TestTransparentPersistence</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70"><div><!--

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

--><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Open_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Closed_Image" src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub TestTransparentPersistence()</span><span id="ResourcesReferenceImplementation_StrategiesEnhancement_ToolsEnhancement_For_.NETBuild_Time_EnhancementTP_Example_CodeTPExamplesVB.ZipsTPExample.Vb_TPExample.Vb_TestTransparentPersistence_1263_70_15_2673_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> TestTransparentPersistence()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            StoreSensorPanel()
</span><span style="color: #008080;">03</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;"> configuration </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IConfiguration </span><span style="color: #000000;">=</span><span style="color: #000000;"> ConfigureTP()
</span><span style="color: #008080;">04</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;"> container </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectContainer </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(configuration)
</span><span style="color: #008080;">05</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;">Not</span><span style="color: #000000;"> (container </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">) </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</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;">Try</span><span style="color: #000000;">
</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;">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;"> container.QueryByExample(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> SensorPanel(</span><span style="color: #800080;">1</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;"> sensor </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> SensorPanel </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</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"/>                    ListResult(result)
</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;">If</span><span style="color: #000000;"> result.Size </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</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"/>                        System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Before modification: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">CType</span><span style="color: #000000;">(result(</span><span style="color: #800080;">0</span><span style="color: #000000;">), SensorPanel)
</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: #008000;">'</span><span style="color: #008000;"> the object is a linked list, so each call to next()</span><span style="color: #008000;">
</span><span style="color: #008080;">14</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        </span><span style="color: #008000;">'</span><span style="color: #008000;"> will need to activate a new object</span><span style="color: #008000;">
</span><span style="color: #008080;">15</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> nextSensor </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> SensorPanel </span><span style="color: #000000;">=</span><span style="color: #000000;"> sensor.NextSensor
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #0000FF;">While</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Not</span><span style="color: #000000;"> (nextSensor </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</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"/>                            System.Console.WriteLine(nextSensor)
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            </span><span style="color: #008000;">'</span><span style="color: #008000;"> modify the next sensor</span><span style="color: #008000;">
</span><span style="color: #008080;">19</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                            nextSensor.Sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">CType</span><span style="color: #000000;">((</span><span style="color: #800080;">10</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #0000FF;">CType</span><span style="color: #000000;">(nextSensor.Sensor, Int32)), </span><span style="color: #0000FF;">Object</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"/>                            nextSensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> nextSensor.NextSensor
</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;">While</span><span style="color: #000000;">
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #008000;">'</span><span style="color: #008000;"> Explicit commit stores and commits the changes at any time</span><span style="color: #008000;">
</span><span style="color: #008080;">23</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                        container.Commit()
</span><span style="color: #008080;">24</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;">25</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;">26</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> If there are unsaved changes to activatable objects, they </span><span style="color: #008000;">
</span><span style="color: #008080;">27</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> will be implicitely saved and committed when the database </span><span style="color: #008000;">
</span><span style="color: #008080;">28</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    </span><span style="color: #008000;">'</span><span style="color: #008000;"> is closed</span><span style="color: #008000;">
</span><span style="color: #008080;">29</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">                    CloseDatabase()
</span><span style="color: #008080;">30</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;">31</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;">32</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #008000;">'</span><span style="color: #008000;"> reopen the database and check the modifications</span><span style="color: #008000;">
</span><span style="color: #008080;">33</span><span style="color: #008000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;">            container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Database(configuration)
</span><span style="color: #008080;">34</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;">Not</span><span style="color: #000000;"> (container </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">) </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">35</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;">36</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;"> container.QueryByExample(</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> SensorPanel(</span><span style="color: #800080;">1</span><span style="color: #000000;">))
</span><span style="color: #008080;">37</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;"> sensor </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> SensorPanel </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">
</span><span style="color: #008080;">38</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    ListResult(result)
</span><span style="color: #008080;">39</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;"> result.Size </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Then</span><span style="color: #000000;">
</span><span style="color: #008080;">40</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        System.Console.WriteLine(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">After modification: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">41</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        sensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">CType</span><span style="color: #000000;">(result(</span><span style="color: #800080;">0</span><span style="color: #000000;">), SensorPanel)
</span><span style="color: #008080;">42</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;"> nextSensor </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> SensorPanel </span><span style="color: #000000;">=</span><span style="color: #000000;"> sensor.NextSensor
</span><span style="color: #008080;">43</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                        </span><span style="color: #0000FF;">While</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Not</span><span style="color: #000000;"> (nextSensor </span><span style="color: #0000FF;">Is</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Nothing</span><span style="color: #000000;">)
</span><span style="color: #008080;">44</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            System.Console.WriteLine(nextSensor)
</span><span style="color: #008080;">45</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                            nextSensor </span><span style="color: #000000;">=</span><span style="color: #000000;"> nextSensor.NextSensor
</span><span style="color: #008080;">46</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;">While</span><span style="color: #000000;">
</span><span style="color: #008080;">47</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;">48</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;">49</span><span style="color: #000000;"><img src="../../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    CloseDatabase()
</span><span style="color: #008080;">50</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;">51</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;">52</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>The code above is ready to accommodate TP, however TP is not possible now as SensorPanel does not implement IActivatable interface. In the <a href="example_enhancement.html" class="wikiLink">following chapter</a> we will learn how to enable TP for the project classes in the build time. </p><p>The
whole project code can be downloaded here: <a href="tp_example_code/tpexamplescs.zip.html" class="wikiLink">c#</a>&nbsp; <a href="tp_example_code/tpexamplesvb.zip.html" class="wikiLink">vb</a></p><p><br>&nbsp;</p>
</div>
    </div>
    <div id="footer">
					This revision (3) was last Modified 2008-01-20T10:09:50 by Tetyana.
				</div>
  </body>
</html>