Sophie

Sophie

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

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

<html>
  <head>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Inserting Class Into A Hierarchy</title>
    <link rel="stylesheet" type="text/css" href="../../../../style.css">
  </head>
  <body>
    <div class="CommonContent">
      <div class="CommonContentArea">
        <h1>Inserting Class Into A Hierarchy</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>We will use the same <a href="a.html" class="wikiLink">A</a>, <a href="b.html" class="wikiLink">B</a> and <a href="c.html" class="wikiLink">C</a> classes
as in the <a href="removing_class_from_a_hierarchy.html" class="wikiLink">previous example</p>

<p></a>. The goal is to insert a new class with additional members
between B and C class in the hierarchy.</p>

<p>Let's store some class objects first:</p>



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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">refactoringExample.cs: <span class="fscMemberName">StoreData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82"><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;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> StoreData()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Open_Text').style.display='inline';"/>        </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_39_658_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;"> Db4oFactory.OpenFile(Db4oFileName);
</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 id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_185_565_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"/>                A a </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> A();
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                a.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">A class</span><span style="color: #800000;">&quot;</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"/>                container.Set(a);
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                B b </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> B();
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                b.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">B class</span><span style="color: #800000;">&quot;</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"/>                b.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">1</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"/>                container.Set(b);
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                C c </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> C();
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                c.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">C class</span><span style="color: #800000;">&quot;</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"/>                c.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">2</span><span style="color: #000000;">;
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                container.Set(c);
</span><span style="color: #008080;">20</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;">21</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;">22</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_StoreData_354_82_598_648_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"/>                container.Close();
</span><span style="color: #008080;">24</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;">25</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">refactoringExample.cs: <span class="fscMemberName">ReadData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81"><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;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> ReadData()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Open_Text').style.display='inline';"/>        </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_38_774_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"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName);
</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;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_145_681_Open_Text"><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"/>                IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> A());
</span><span style="color: #008080;">07</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;">A class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result);
</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: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> B());
</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: #008080;">12</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;">B class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result);
</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: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> C());
</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: #008080;">17</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;">C class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result);
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>            }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">20</span><span style="color: #000000;"><img 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;">21</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsinitialrefactoringExample.Cs_InitialrefactoringExample.Cs_ReadData_440_81_714_764_Open_Text"><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"/>                container.Close();
</span><span style="color: #008080;">23</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;">24</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">refactoringExample.vb: <span class="fscMemberName">StoreData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub StoreData()</span><span id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_StoreData_585_82_14_625_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> StoreData()
</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;"> Db4oFactory.OpenFile(Db4oFileName)
</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;">Try</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;">Dim</span><span style="color: #000000;"> a </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> A()
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                a.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">A class</span><span style="color: #800000;">&quot;</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"/>                container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](a)
</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: #008080;">09</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;"> b </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> B()
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                b.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">B class</span><span style="color: #800000;">&quot;</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"/>                b.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> </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"/>                container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](b)
</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: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> c </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> C()
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                c.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">C class</span><span style="color: #800000;">&quot;</span><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"/>                c.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">2</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"/>                container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](c)
</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: #0000FF;">Finally</span><span style="color: #000000;">
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                container.Close()
</span><span style="color: #008080;">20</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;">21</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>

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">refactoringExample.vb: <span class="fscMemberName">ReadData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub ReadData()</span><span id="..ComplexRefactoring2VB.ZipsinitialrefactoringExample.Vb_InitialrefactoringExample.Vb_ReadData_671_81_14_740_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> ReadData()
</span><span style="color: #008080;">02</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;"> Db4oFactory.OpenFile(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;">Try</span><span style="color: #000000;">
</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;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> A())
</span><span style="color: #008080;">05</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;">A class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result)
</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: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> B())
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                System.Console.WriteLine()
</span><span style="color: #008080;">10</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;">B class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result)
</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: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> C())
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                System.Console.WriteLine()
</span><span style="color: #008080;">15</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;">C class: </span><span style="color: #800000;">&quot;</span><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"/>                ListResult(result)
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">Finally</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"/>                container.Close()
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">20</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 following class will be inserted:</p>



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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">D.cs</span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Open_Text').style.display='inline';"/><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_0_62_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;"> Copyright (C) 2007  db4objects Inc.  </span><span style="color: #008000; text-decoration: underline;">http://www.db4o.com</span><span style="color: #008000;"> </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Db4objects.Db4odoc.Refactoring.Initial;
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Refactoring.Refactored
</span><span style="color: #008080;">06</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Open_Text').style.display='inline';"/></span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_176_365_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;">class</span><span style="color: #000000;"> D: B
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Open_Text').style.display='inline';"/>    </span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_197_363_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> DateTime storedDate;
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">override</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> ToString()
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Open_Text').style.display='inline';"/>        </span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredD.Cs_RefactoredD.Cs_868_58_286_357_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> name </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">/</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> number </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> storedDate;
</span><span style="color: #008080;">14</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;">15</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;">16</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">D.vb</span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58"><div><!--

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

--><span style="color: #008080;">01</span><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #008000;">'</span><span style="color: #008000;"> Copyright (C) 2007  db4objects Inc.  http://www.db4o.com </span><span style="color: #008000;">
</span><span style="color: #008080;">02</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>'</span><span style="color: #008000;">Imports Db4objects.Db4odoc.Refactoring.Initial</span><span style="color: #008000;">
</span><span style="color: #008080;">03</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #000000;">
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Open_Text').style.display='inline';"/></span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Namespace Db4objects</span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_109_442_Open_Text"><span style="color: #0000FF;">Namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Refactoring.Refactored
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Open_Text').style.display='inline';"/>    </span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Class D</span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_165_428_Open_Text"><span style="color: #0000FF;">Class</span><span style="color: #000000;"> D
</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;">Inherits</span><span style="color: #000000;"> Initial.B
</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: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> storedDate </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> System.DateTime
</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: #008080;">10</span><span style="color: #000000;"><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Open_Text').style.display='inline';"/>        </span><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Overloads</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Overrides</span><span style="color: #000000;"> </span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function ToString()</span><span id="..ComplexRefactoring2VB.ZipsrefactoredD.Vb_RefactoredD.Vb_990_58_282_413_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> ToString() </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">String</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"/>            </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> name </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">/</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> number.ToString() </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> storedDate.ToString()
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Function</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: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    </span><span style="color: #0000FF;">End Class</span></span><span style="color: #000000;">
</span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/></span><span style="color: #0000FF;">End Namespace</span></span></div></pre></div></div>

</span>

<p>Now C class must inherit from D. We can't change C class
itself, because its data will be lost. Therefore we will create a new E class
to hold C data:</p>



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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">E.cs</span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Open_Text').style.display='inline';"/><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">/**/</span><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_0_62_Open_Text"><span style="color: #008000;">/*</span><span style="color: #008000;"> Copyright (C) 2007  db4objects Inc.  </span><span style="color: #008000; text-decoration: underline;">http://www.db4o.com</span><span style="color: #008000;"> </span><span style="color: #008000;">*/</span></span><span style="color: #000000;">
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #008080;">03</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/>
</span><span style="color: #008080;">04</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Refactoring.Refactored
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Open_Text').style.display='inline';"/></span><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_130_169_Open_Text"><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;">class</span><span style="color: #000000;"> E: D
</span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Open_Text').style.display='inline';"/>    </span><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredE.Cs_RefactoredE.Cs_1279_58_151_167_Open_Text"><span style="color: #000000;">{
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>        
</span><span style="color: #008080;">09</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;">10</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">E.vb</span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58"><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: #008000;">'</span><span style="color: #008000;"> Copyright (C) 2007  db4objects Inc.  http://www.db4o.com </span><span style="color: #008000;">
</span><span style="color: #008080;">2</span><span style="color: #008000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/></span><span style="color: #000000;">
</span><span style="color: #008080;">3</span><span style="color: #000000;"><img id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Open_Text').style.display='inline';"/></span><span id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Namespace Db4objects</span><span id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_61_171_Open_Text"><span style="color: #0000FF;">Namespace</span><span style="color: #000000;"> Db4objects.Db4odoc.Refactoring.Refactored
</span><span style="color: #008080;">4</span><span style="color: #000000;"><img id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Open_Text').style.display='inline';"/>    </span><span id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Class E</span><span id="..ComplexRefactoring2VB.ZipsrefactoredE.Vb_RefactoredE.Vb_1401_58_117_157_Open_Text"><span style="color: #0000FF;">Class</span><span style="color: #000000;"> E
</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;">Inherits</span><span style="color: #000000;"> D
</span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>    </span><span style="color: #0000FF;">End Class</span></span><span style="color: #000000;">
</span><span style="color: #008080;">7</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/></span><span style="color: #0000FF;">End Namespace</span></span></div></pre></div></div>

</span>

<p>When all the necessary classes are created we can copy C
data into E class:</p>



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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">refactoringUtil.cs: <span class="fscMemberName">MoveValues</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83"><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;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> MoveValues()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Open_Text').style.display='inline';"/>        </span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_40_689_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"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName);
</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;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_147_546_Open_Text"><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"/>                IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> C());
</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;">for</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">; i </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> result.Count; i</span><span style="color: #000000;">++</span><span style="color: #000000;">)
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Open_Text').style.display='inline';"/>                </span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_280_531_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"/>                    C c </span><span style="color: #000000;">=</span><span style="color: #000000;"> (C)result[i];
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    E e </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> E();
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    e.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> c.name;
</span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    e.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> c.number;
</span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Delete(c);
</span><span style="color: #008080;">14</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Set(e);
</span><span style="color: #008080;">15</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;">16</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>
</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/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">finally</span><span style="color: #000000;">
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredrefactoringUtil.Cs_RefactoredrefactoringUtil.Cs_MoveValues_1614_83_579_679_Open_Text"><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"/>                container.Close();
</span><span style="color: #008080;">21</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;">Done</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
</span><span style="color: #008080;">22</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>            }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">23</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>

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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">refactoringUtil.vb: <span class="fscMemberName">MoveValues</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub MoveValues()</span><span id="..ComplexRefactoring2VB.ZipsrefactoredrefactoringUtil.Vb_RefactoredrefactoringUtil.Vb_MoveValues_1761_83_14_689_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> MoveValues()
</span><span style="color: #008080;">02</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;"> Db4oFactory.OpenFile(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;">Try</span><span style="color: #000000;">
</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;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> Initial.C())
</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;">For</span><span style="color: #000000;"> i </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Integer</span><span style="color: #000000;"> </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;"> </span><span style="color: #0000FF;">To</span><span style="color: #000000;"> result.Count </span><span style="color: #000000;">-</span><span style="color: #000000;"> </span><span style="color: #800080;">1</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;">Dim</span><span style="color: #000000;"> c </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Initial.C </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">DirectCast</span><span style="color: #000000;">(result(i), Initial.C)
</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;"> e </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">New</span><span style="color: #000000;"> E()
</span><span style="color: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    e.name </span><span style="color: #000000;">=</span><span style="color: #000000;"> c.name
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    e.number </span><span style="color: #000000;">=</span><span style="color: #000000;"> c.number
</span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.Delete(c)
</span><span style="color: #008080;">11</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                    container.[</span><span style="color: #0000FF;">Set</span><span style="color: #000000;">](e)
</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: #008080;">13</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                </span><span style="color: #0000FF;">Next</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;">Finally</span><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"/>                container.Close()
</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;">Done</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
</span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>            </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        </span><span style="color: #0000FF;">End Sub</span></span></div></pre></div></div>

</span>

<p>Now C classes can be safely removed from the project and all
the references to it updated to E(or D). We can check that all the values are
in place:</p>



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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">RefactoringExample.cs: <span class="fscMemberName">ReadData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84"><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;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> ReadData()
</span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Open_Text').style.display='inline';"/>        </span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_38_589_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"/>            IObjectContainer container </span><span style="color: #000000;">=</span><span style="color: #000000;"> Db4oFactory.OpenFile(Db4oFileName);
</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;">try</span><span style="color: #000000;">
</span><span style="color: #008080;">05</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_145_496_Open_Text"><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"/>                IObjectSet result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> D());
</span><span style="color: #008080;">07</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;">D class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result);
</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: #008080;">10</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Get(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> E());
</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: #008080;">12</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;">E class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result);
</span><span style="color: #008080;">14</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;">15</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;">16</span><span style="color: #000000;"><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Open_Text').style.display='inline';"/>            </span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="..ComplexRefactoring2CS.ZipsrefactoredRefactoringExample.Cs_RefactoredRefactoringExample.Cs_ReadData_2073_84_529_579_Open_Text"><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"/>                container.Close();
</span><span style="color: #008080;">18</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/>            }</span></span><span style="color: #000000;">
</span><span style="color: #008080;">19</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/>        }</span></span></div></pre></div></div>

</span>

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

<div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">RefactoringExample.vb: <span class="fscMemberName">ReadData</span></span></div><div class="fscCode"><pre ID="..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84"><div><!--

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

--><span style="color: #008080;">01</span><img id="..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Open_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Open_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Closed_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Closed_Text').style.display='inline';"/><img id="..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Closed_Image" src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Closed_Text').style.display='none'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Open_Image').style.display='inline'; document.getElementById('..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub ReadData()</span><span id="..ComplexRefactoring2VB.ZipsrefactoredRefactoringExample.Vb_RefactoredRefactoringExample.Vb_ReadData_2221_84_14_557_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> ReadData()
</span><span style="color: #008080;">02</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;"> Db4oFactory.OpenFile(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;">Try</span><span style="color: #000000;">
</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;"> result </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> IObjectSet </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> D())
</span><span style="color: #008080;">05</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;">D class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result)
</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: #008080;">08</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.[</span><span style="color: #0000FF;">Get</span><span style="color: #000000;">](</span><span style="color: #0000FF;">New</span><span style="color: #000000;"> E())
</span><span style="color: #008080;">09</span><span style="color: #000000;"><img src="../../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/>                System.Console.WriteLine()
</span><span style="color: #008080;">10</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;">E class: </span><span style="color: #800000;">&quot;</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"/>                ListResult(result)
</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;">Finally</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"/>                container.Close()
</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;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;">
</span><span style="color: #008080;">15</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>When performing refactoring on your working application do
not forget to make a copy of the code and data before making any changes!</p></div>
    </div>
    <div id="footer">
					This revision (2) was last Modified 2007-09-30T18:47:14 by Tetyana.
				</div>
  </body>
</html>