Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var folders = MailProvider.GetFolderHierarchy();

            foreach (var folder in folders)
            {
                RecursivelyPrintHierarchy(folder);
            }

            Console.Read();
        }
Exemplo n.º 2
0
        private void FirstRunWindow_OnLoaded(object sender, RoutedEventArgs e)
        {
            var folders = MailProvider.GetFolderHierarchy();

            var flat = new List <MailFolder>();

            var queue = new Queue <MailFolder>();

            queue.Enqueue(folders.First());

            while (queue.Count > 0)
            {
                var f = queue.Dequeue();

                flat.Add(f);

                f.Children.ForEach(x => queue.Enqueue(x));
            }

            DataContext = flat.OrderBy(f => f.Name);
        }