예제 #1
0
        private static void AddDirectory(string dir, List <ISwatch> swatches)
        {
            foreach (string swatchFile in Directory.EnumerateFiles(dir, "*"))
            {
                string ext = Path.GetExtension(swatchFile);

                ISwatch swatch = null;

                if (ext.ToLower() == ".swtch")
                {
                    swatch = new MCSwatch(swatchFile);
                }
                else if (ext.ToLower() == ".gpl" || ext.ToLower() == ".gimp")
                {
                    swatch = new GIMPSwatch(swatchFile);
                }
                else if (ext.ToLower() == ".act")
                {
                    swatch = new ACTSwatch(swatchFile);
                }
                else if (ext.ToLower() == ".aco")
                {
                    swatch = new ACOSwatch(swatchFile);
                }

                if (swatch != null)
                {
                    swatches.Add(swatch);
                    swatch.Load();
                }
            }
        }
예제 #2
0
        private static void AddDirectory(string dir, List<ISwatch> swatches)
        {
            foreach (string swatchFile in Directory.GetFiles(dir, "*"))
            {
                string ext = Path.GetExtension(swatchFile);

                ISwatch swatch = null;

                if (ext.ToLower() == ".swtch")
                    swatch = new MCSwatch(swatchFile);
                else if (ext.ToLower() == ".gpl" || ext.ToLower() == ".gimp")
                    swatch = new GIMPSwatch(swatchFile);
                else if (ext.ToLower() == ".act")
                    swatch = new ACTSwatch(swatchFile);
                else if (ext.ToLower() == ".aco")
                    swatch = new ACOSwatch(swatchFile);

                if (swatch != null)
                {
                    swatches.Add(swatch);
                    swatch.Load();
                }
            }
        }