ColorTranslator
ColorTranslator is a fairly simple, sealed class that acts as a utility tool to convert between the various formats of colors: HTML, OLE, Win32, system and so on.
Read about ColorTranslator via Dino Esposito’s WebLog
Random thoughts about .Net development
ColorTranslator is a fairly simple, sealed class that acts as a utility tool to convert between the various formats of colors: HTML, OLE, Win32, system and so on.
Read about ColorTranslator via Dino Esposito’s WebLog
using System;
using System.Collections;
using System.IO;
namespace Devintelligence.IO
{
public class IOUtils
{
private IOUtils()
{
}
public static string[] GetAllDirectories(string root)
{
ArrayList list = new ArrayList();
Stack stack = new Stack();
string[] folders = Directory.GetDirectories(root);
AddRange(folders, stack);
while (stack.Count > 0)
{
string path = (string)stack.Pop();
list.Add(path);
folders = Directory.GetDirectories(path);
AddRange(folders, stack);
}
return (string[])list.ToArray(typeof(string));
}
private static void AddRange(string[] elements, Stack stack)
{
foreach (string element in elements)
{
stack.Push(element);
}
}
}
}