public static void Load()
{
string DisplayAdaptationDataLine;
string FileName;
char[] delimiterChars = { ',', '\t' };
StreamReader MyStreamReader;
FileName = @"C:\ASTERIX\ADAPTATION\DisplayAttributes.txt";
if (System.IO.File.Exists(FileName))
{
MyStreamReader = System.IO.File.OpenText(FileName);
while (MyStreamReader.Peek() >= 0)
{
DisplayAdaptationDataLine = MyStreamReader.ReadLine();
string[] words = DisplayAdaptationDataLine.Split(delimiterChars);
if (words[0][0] != '#')
{
DisplayAttributes.DisplayAttributesType DisplayAttribute = new DisplayAttributes.DisplayAttributesType();
DisplayAttribute.ItemName = words[0];
DisplayAttribute.TextSize = int.Parse(words[1]);
DisplayAttribute.TextFont = new FontFamily(words[2]);
DisplayAttribute.TextColor = Color.FromName(words[3]);
DisplayAttribute.LineWidth = int.Parse(words[4]);
DisplayAttribute.LineColor = Color.FromName(words[5]);
DisplayAttribute.LineStyle = DisplayAttributes.GetLineStypefromString(words[6]);
DisplayAttribute.AreaPolygonColor = Color.FromName(words[7]);
DisplayAttribute.ImageSize = new Size(int.Parse(words[8]), int.Parse((words[9])));
DisplayAttributes.SetDisplayAttribute((DisplayAttributes.DisplayItemsType)Enum.Parse(typeof(DisplayAttributes.DisplayItemsType), DisplayAttribute.ItemName, true), DisplayAttribute);
}
}
}
}