<html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Sorting</title> <link rel="stylesheet" type="text/css" href="../../../style.css"> </head> <body> <div class="CommonContent"> <div class="CommonContentArea"> <h1>Sorting</h1><div id="TOC"><div id="TOCinner"><span class="TOCtitle">Contents</span><div class="TOCcontents"><ul><li><a href ="#GetSortedPilots">GetSortedPilots</a></li><li><a href ="#GetPilotsSortByNameAndPoints">GetPilotsSortByNameAndPoints</a></li><li><a href ="#GetPilotsSortWithComparator">GetPilotsSortWithComparator</a></li></ul></li></ul></div></div></div><script> //We attach this function to a browser object as a variable so that if multiple of these blocks are //present on the same page, then they will simply over-write eachother with the same function instead //of generating a naming collision. window.WikiCodeFormattingCopyToClipboard = function copyToClipboard(sID){ var sContent = document.getElementById(sID).innerText; if( window.clipboardData && clipboardData.setData ) { clipboardData.setData("Text", sContent); } else { alert("You must enable javascript access to your clipboard for this feature to work. Please referr to your browser documentation or Google search for instructions."); } } </script><p>The following examples represent NQ sorting techniques. <a href="store_pilots.html" class="wikiLink">Store Pilots</a> function is used to fill in the database. <br></p><a name="GetSortedPilots"></a><h2>GetSortedPilots</h2><p>Select all the pilots from the database and sort descending by points. </p> <span name="cs_wiki_filter" csw_filters="cs"> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.cs: <span class="fscMemberName">GetSortedPilots</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66"><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;"> GetSortedPilots() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_45_610_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;"> Database(); </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="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_128_519_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"/> IList</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">(</span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot pilot) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_229_281_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: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">; </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/InBlock.gif" align="top"/> </span><span style="color: #008000;">//</span><span style="color: #008000;"> sort by points</span><span style="color: #008000;"> </span><span style="color: #008080;">11</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;"> </span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot p1, Pilot p2) </span><span style="color: #008080;">12</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_390_467_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;"> p2.Points </span><span style="color: #000000;">-</span><span style="color: #000000;"> p1.Points; </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"/> ListResult(result); </span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/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 id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetSortedPilots_290_66_552_600_Open_Text"><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"/> CloseDatabase(); </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/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">SimpleExamples.vb: <span class="fscMemberName">GetSortedPilots</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub GetSortedPilots()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetSortedPilots_420_66_15_474_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> GetSortedPilots() </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;"> Database() </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;"> IList(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot) </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot)(</span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> AllPilotsMatch, </span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> PilotPointsCompare) </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result) </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;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception </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;">"</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message) </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;">Finally</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"/> CloseDatabase() </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">11</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">SimpleExamples.vb: <span class="fscMemberName">AllPilotsMatch</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function AllPilotsMatch()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_490_65_15_163_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> AllPilotsMatch(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Boolean</span><span style="color: #000000;"> </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #008000;">'</span><span style="color: #008000;"> each Pilot is included in the result</span><span style="color: #008000;"> </span><span style="color: #008080;">3</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;"> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">True</span><span style="color: #000000;"> </span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.vb: <span class="fscMemberName">PilotPointsCompare</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function PilotPointsCompare()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsCompare_559_69_15_153_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> PilotPointsCompare(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot, </span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </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: #008080;">2</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;"> p2.Points </span><span style="color: #000000;">-</span><span style="color: #000000;"> p1.Points </span><span style="color: #008080;">3</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> </span><a name="GetPilotsSortByNameAndPoints"></a><h2>GetPilotsSortByNameAndPoints</h2><p>Select all pilots, sort descending by name and by points. </p> <span name="cs_wiki_filter" csw_filters="cs"> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.cs: <span class="fscMemberName">GetPilotsSortByNameAndPoints</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79"><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;"> GetPilotsSortByNameAndPoints() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_58_989_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;"> Database(); </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="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_141_898_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"/> IList</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">(</span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot pilot) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_242_295_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: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</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"/> </span><span style="color: #008080;">10</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: #0000FF;">new</span><span style="color: #000000;"> System.Comparison</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></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: #008000;">//</span><span style="color: #008000;"> sort by name then by points: descending</span><span style="color: #008000;"> </span><span style="color: #008080;">12</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;"> </span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot p1, Pilot p2) </span><span style="color: #008080;">13</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_459_845_Open_Text"><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;">int</span><span style="color: #000000;"> compareResult </span><span style="color: #000000;">=</span><span style="color: #000000;"> p1.Name.CompareTo(p2.Name); </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;">if</span><span style="color: #000000;"> (compareResult </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: #008080;">16</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_605_690_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"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> p1.Points </span><span style="color: #000000;">-</span><span style="color: #000000;"> p2.Points; </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/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span style="color: #008080;">20</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_744_822_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">21</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">compareResult; </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/InBlock.gif" align="top"/> </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/InBlock.gif" align="top"/> ListResult(result); </span><span style="color: #008080;">26</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;">27</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;">28</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortByNameAndPoints_803_79_931_979_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">29</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> CloseDatabase(); </span><span style="color: #008080;">30</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">31</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/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">SimpleExamples.vb: <span class="fscMemberName">GetPilotsSortByNameAndPoints</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_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="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Sub GetPilotsSortByNameAndPoints()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_GetPilotsSortByNameAndPoints_946_79_14_493_Open_Text"><span style="color: #0000FF;">Sub</span><span style="color: #000000;"> GetPilotsSortByNameAndPoints() </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;"> Database() </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;"> IList(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot) </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query(</span><span style="color: #0000FF;">Of</span><span style="color: #000000;"> Pilot)(</span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> AllPilotsMatch, </span><span style="color: #0000FF;">AddressOf</span><span style="color: #000000;"> PilotPointsAndNameCompare) </span><span style="color: #008080;">05</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> ListResult(result) </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;">Catch</span><span style="color: #000000;"> ex </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Exception </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;">"</span><span style="color: #800000;">System Exception: </span><span style="color: #800000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> ex.Message) </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;">Finally</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"/> CloseDatabase() </span><span style="color: #008080;">10</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Try</span><span style="color: #000000;"> </span><span style="color: #008080;">11</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">SimpleExamples.vb: <span class="fscMemberName">AllPilotsMatch</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function AllPilotsMatch()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_AllPilotsMatch_1029_65_15_163_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> AllPilotsMatch(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Boolean</span><span style="color: #000000;"> </span><span style="color: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #008000;">'</span><span style="color: #008000;"> each Pilot is included in the result</span><span style="color: #008000;"> </span><span style="color: #008080;">3</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;"> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">True</span><span style="color: #000000;"> </span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.vb: <span class="fscMemberName">PilotPointsAndNameCompare</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">1</span><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Open_Text').style.display='inline';"/><span style="color: #0000FF;">Private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">Shared</span><span style="color: #000000;"> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">Function PilotPointsAndNameCompare()</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionVB.ZipsSimpleExamples.Vb_SimpleExamples.Vb_PilotPointsAndNameCompare_1098_76_15_402_Open_Text"><span style="color: #0000FF;">Function</span><span style="color: #000000;"> PilotPointsAndNameCompare(</span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p1 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot, </span><span style="color: #0000FF;">ByVal</span><span style="color: #000000;"> p2 </span><span style="color: #0000FF;">As</span><span style="color: #000000;"> Pilot) </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: #008080;">2</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #008000;">'</span><span style="color: #008000;"> sort by name then by points: descending</span><span style="color: #008000;"> </span><span style="color: #008080;">3</span><span style="color: #008000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/></span><span style="color: #000000;"> </span><span style="color: #0000FF;">Dim</span><span style="color: #000000;"> compareResult </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;"> p1.Name.CompareTo(p2.Name) </span><span style="color: #008080;">4</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> (compareResult </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;">Then</span><span style="color: #000000;"> </span><span style="color: #008080;">5</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Return</span><span style="color: #000000;"> p1.Points </span><span style="color: #000000;">-</span><span style="color: #000000;"> p2.Points </span><span style="color: #008080;">6</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">Else</span><span style="color: #000000;"> </span><span style="color: #008080;">7</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;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">compareResult </span><span style="color: #008080;">8</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">End</span><span style="color: #000000;"> </span><span style="color: #0000FF;">If</span><span style="color: #000000;"> </span><span style="color: #008080;">9</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> </span><span style="color: #0000FF;">End Function</span></span></div></pre></div></div> </span><a name="GetPilotsSortWithComparator"></a><h2>GetPilotsSortWithComparator</h2> <p>Sort by points using pre-defined comparator.<br></p> <span name="cs_wiki_filter" csw_filters="cs"> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.cs: <span class="fscMemberName">GetPilotsSortWithComparator</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78"><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;"> GetPilotsSortWithComparator() </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_57_461_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;"> Database(); </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="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_140_370_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"/> IList </span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> container.Query</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;">(</span><span style="color: #0000FF;">delegate</span><span style="color: #000000;">(Pilot pilot) </span><span style="color: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_242_295_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: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</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"/> </span><span style="color: #008080;">10</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: #0000FF;">new</span><span style="color: #000000;"> PilotComparator()); </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/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">13</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">finally</span><span style="color: #000000;"> </span><span style="color: #008080;">14</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_GetPilotsSortWithComparator_1337_78_403_451_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">15</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> CloseDatabase(); </span><span style="color: #008080;">16</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"/> }</span></span><span style="color: #000000;"> </span><span style="color: #008080;">17</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div> <div class="FormattedSourceCode"><div class="fscHeader"><span class="fscFileName">SimpleExamples.cs: <span class="fscMemberName">PilotComparator</span></span></div><div class="fscCode"><pre ID="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66"><div><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><span style="color: #008080;">01</span><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/None.gif" align="top"/><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> PilotComparator : IComparer</span><span style="color: #000000;"><</span><span style="color: #000000;">Pilot</span><span style="color: #000000;">></span><span style="color: #000000;"> </span><span style="color: #008080;">02</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_57_416_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"/> </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> Compare(Pilot p1, Pilot p2) </span><span style="color: #008080;">04</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_122_406_Open_Text"><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;">int</span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> p1.Name.CompareTo(p2.Name); </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;">if</span><span style="color: #000000;"> (result </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: #008080;">07</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_230_299_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: #0000FF;">return</span><span style="color: #000000;"> p1.Points </span><span style="color: #000000;">-</span><span style="color: #000000;"> p2.Points; </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/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span style="color: #008080;">11</span><span style="color: #000000;"><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Open_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Open_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Closed_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Closed_Text').style.display='inline';"/><img id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Closed_Image" src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/ContractedSubBlock.gif" align="top" style="display: none;" onClick="this.style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Closed_Text').style.display='none'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Open_Image').style.display='inline'; document.getElementById('ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Open_Text').style.display='inline';"/> </span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Closed_Text" style="border: solid 1px #808080; background-color: #FFFFFF; display: none;">...</span><span id="ResourcesReferenceImplementation_StrategiesNative_Query_CollectionnqcollectionCS.ZipsSimpleExamples.Cs_SimpleExamples.Cs_PilotComparator_1419_66_337_392_Open_Text"><span style="color: #000000;">{ </span><span style="color: #008080;">12</span><span style="color: #000000;"><img src="../../../Utility/ActiPro.CodeHighligher/OutliningIndicators/InBlock.gif" align="top"/> </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #000000;">-</span><span style="color: #000000;">result; </span><span style="color: #008080;">13</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;">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/ExpandedBlockEnd.gif" align="top"/> }</span></span></div></pre></div></div> </span></div> </div> <div id="footer"> This revision (2) was last Modified 2007-04-23T19:46:09 by Tetyana. </div> </body> </html>