Guest User

Untitled

a guest
Jan 30th, 2012
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using MonoTouch.Dialog;
  3.  
  4. public class DialogTest: DialogViewController
  5. {
  6.     RootElement root = new RootElement("");
  7.     string letters = "xxxxxxxxxxxxxxxxxxxxxxxxx";
  8.    
  9.     public DialogTest () : base(null, true)
  10.     {
  11.         Random r = new Random();
  12.         var max = r.Next(10);
  13.         for (int i = 0; i < max; i++) {
  14.             AddSection();
  15.         }
  16.        
  17.         this.Root = root;
  18.     }
  19.    
  20.     private void AddSection() {
  21.         Section section = new Section("");
  22.         Random r = new Random();
  23.         var max = r.Next(10);
  24.        
  25.         for (int i = 0; i < max; i++) {
  26.             var maxLetters = r.Next(20);
  27.             MojoEntryElement entry = new MojoEntryElement(letters.Substring(0, maxLetters), "", "");
  28.             section.Add (entry);
  29.         }
  30.        
  31.         root.Add (section);
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment