

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.IO;

namespace Microsoft.MultiverseInterfaceStudio.FrameXml.Controls
{
	public class ImageNameTypeConverter : StringConverter
	{
		public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
		{
			return true;
		}

		public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
		{
            BaseControl baseControl = (BaseControl)context.Instance;
			string directoryName = Path.GetDirectoryName(baseControl.DesignerLoader.DocumentMoniker);
			DirectoryInfo directoryInfo = new DirectoryInfo(directoryName);
			FileInfo[] fileInfos = directoryInfo.GetFiles("*.tga");
			var q = from fileInfo in fileInfos select fileInfo.Name;
			return new StandardValuesCollection(q.ToArray<string>());
		}
	}
}
