Esempio n. 1
0
		public static void Fill(TreeEntry entry, double chance)
		{
			double f;
			while ((f = r.NextDouble()) < chance) {
				var e = new TextTreeEntry(f.ToString());
				entry.Add(e);
				Fill(e, chance * chance);
			}
		}
Esempio n. 2
0
        public static void Fill(TreeEntry entry, double chance)
        {
            double f;

            while ((f = r.NextDouble()) < chance)
            {
                var e = new TextTreeEntry(f.ToString());
                entry.Add(e);
                Fill(e, chance * chance);
            }
        }
Esempio n. 3
0
		void Discover(TreeEntry entry, DirectoryInfo di, int level, int maxlevel) 
		{
			if (level > maxlevel) {
				return;
			}

			var child = new TextTreeEntry(di.Name);
			entry.Add(child);

			foreach (var dir in di.GetDirectories()) {
				Discover(child, dir, level + 1, maxlevel);
			}
		}
Esempio n. 4
0
        void Discover(TreeEntry entry, DirectoryInfo di, int level, int maxlevel)
        {
            if (level > maxlevel)
            {
                return;
            }

            var child = new TextTreeEntry(di.Name);

            entry.Add(child);

            foreach (var dir in di.GetDirectories())
            {
                Discover(child, dir, level + 1, maxlevel);
            }
        }