Exemplo 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);
            }
        }
Exemplo n.º 2
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);
            }
        }