コード例 #1
0
 private static ArrangeResult Arrange(IEnumerable<IndivData> inds, CancellationToken cancellationToken)
 {
     ArrangeSet oRet = null;
     try
     {
         var indivs = inds.ToList();
         int n = indivs.Count;
         if (!cancellationToken.IsCancellationRequested)
         {
             for (int i = 0; i < n; ++i)
             {
                 if (!cancellationToken.IsCancellationRequested)
                 {
                     ArrangeSet pSet = new ArrangeSet(indivs, indivs[i]);
                     if (pSet.arrange(cancellationToken))
                     {
                         if (pSet.IsValid && (!cancellationToken.IsCancellationRequested))
                         {
                             if (oRet == null)
                             {
                                 oRet = pSet;
                             }
                             else if (pSet.Criteria < oRet.Criteria)
                             {
                                 oRet = pSet;
                             }
                         }// valid
                     }// arrange
                 }// process
             }// i
         }// ok
     }
     catch (Exception /* ex */)
     {
         oRet = null;
     }
     if (cancellationToken.IsCancellationRequested)
     {
         oRet = null;
     }
     ArrangeResult pRet = null;
     if ((oRet != null) && oRet.IsValid)
     {
         pRet = new ArrangeResult(oRet.Criteria, oRet.CurrentList);
     }
     return pRet;
 }
コード例 #2
0
 public object Clone()
 {
     ArrangeResult p = new ArrangeResult();
     p.Criteria = this.Criteria;
     p.Indivs = this.Indivs;
     return p;
 }