Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MK 426 posts 902 karma points
    Mar 04, 2012 @ 13:48
    MK
    0

    DynamicNodeList shuffling

    Hi there,

    Is there an quick way to shuffle DynamicNodeList?

    Cheers

    mkariti

  • MK 426 posts 902 karma points
    Mar 04, 2012 @ 14:43
    MK
    0

    Got it! I used this:

     

    Random r = new Random(); 
         for (int n = pagesToList.Count() - 1; n > 0; --n)
         {
             int k = r.Next(n + 1);
             DynamicNode temp = pagesToList.Items[n];
             pagesToList.Items[n] = pagesToList.Items[k];
             pagesToList.Items[k] = temp;
         }
      
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies