View Code
1 ///2 /// 3 /// 4 public enum DRErrorMessage 5 { 6 German = 5, 7 Czech = 6, 8 Danish = 7, 9 Greek = 8, 10 Spanish = 9, 11 Finnish = 10, 12 French = 11, 13 Hungarian = 12, 14 Italian = 13, 15 Japanese = 14, 16 Korean = 15, 17 Dutch = 16, 18 Norwegian = 17, 19 Polish = 18, 20 Portuguese = 19, //pt-br (Portuguese-LatinAmer : Portuguese Brazil ) 21 PortugueseIberian = 20, //pt-PT (Portuguese) 22 Romanian = 21, 23 Russian = 22, 24 Swedish = 23, 25 Turkish = 24, 26 ChineseS = 25, //SimplifiedChinese 27 ChineseT = 26 //TraditionalChinese 28 } 29 30 ///31 /// 32 /// 33 /// 34 ///35 public static Dictionary dtGetAllConfigurationFiles() 36 { 37 38 Dictionary myDictionaryResult = new Dictionary (); 39 40 #region add key value pair for dictionary. 41 42 //myDictionaryResult.Add((int)DRErrorMessage.German, DRErrorMessage.German.ToString() + suffixFileName); 43 //myDictionaryResult.Add((int)DRErrorMessage.Czech, DRErrorMessage.Czech.ToString() + suffixFileName); 44 //myDictionaryResult.Add((int)DRErrorMessage.Danish, DRErrorMessage.Danish.ToString() + suffixFileName); 45 //myDictionaryResult.Add((int)DRErrorMessage.Greek, DRErrorMessage.Greek.ToString() + suffixFileName); 46 //myDictionaryResult.Add((int)DRErrorMessage.Spanish, DRErrorMessage.Spanish.ToString() + suffixFileName); 47 //myDictionaryResult.Add((int)DRErrorMessage.Finnish, DRErrorMessage.Finnish.ToString() + suffixFileName); 48 49 //myDictionaryResult.Add((int)DRErrorMessage.French, DRErrorMessage.French.ToString() + suffixFileName); 50 //myDictionaryResult.Add((int)DRErrorMessage.Hungarian, DRErrorMessage.Hungarian.ToString() + suffixFileName); 51 //myDictionaryResult.Add((int)DRErrorMessage.Italian, DRErrorMessage.Italian.ToString() + suffixFileName); 52 //myDictionaryResult.Add((int)DRErrorMessage.Japanese, DRErrorMessage.Japanese.ToString() + suffixFileName); 53 //myDictionaryResult.Add((int)DRErrorMessage.Korean, DRErrorMessage.Korean.ToString() + suffixFileName); 54 //myDictionaryResult.Add((int)DRErrorMessage.Dutch, DRErrorMessage.Dutch.ToString() + suffixFileName); 55 56 //myDictionaryResult.Add((int)DRErrorMessage.Norwegian, DRErrorMessage.Norwegian.ToString() + suffixFileName); 57 //myDictionaryResult.Add((int)DRErrorMessage.Polish, DRErrorMessage.Polish.ToString() + suffixFileName); 58 //myDictionaryResult.Add((int)DRErrorMessage.Portuguese, DRErrorMessage.Portuguese.ToString() + suffixFileName); //pt-br (Portuguese-LatinAmer) 59 //myDictionaryResult.Add((int)DRErrorMessage.PortugueseIberian, DRErrorMessage.PortugueseIberian.ToString() + suffixFileName); //pt-PT (Portuguese) 60 //myDictionaryResult.Add((int)DRErrorMessage.Romanian, DRErrorMessage.Romanian.ToString() + suffixFileName); 61 //myDictionaryResult.Add((int)DRErrorMessage.Russian, DRErrorMessage.Russian.ToString() + suffixFileName); 62 63 //myDictionaryResult.Add((int)DRErrorMessage.Swedish, DRErrorMessage.Swedish.ToString() + suffixFileName); 64 //myDictionaryResult.Add((int)DRErrorMessage.Turkish, DRErrorMessage.Turkish.ToString() + suffixFileName); 65 //myDictionaryResult.Add((int)DRErrorMessage.ChineseS, DRErrorMessage.ChineseS.ToString() + suffixFileName); //SimplifiedChinese 66 //myDictionaryResult.Add((int)DRErrorMessage.ChineseT, DRErrorMessage.ChineseT.ToString() + suffixFileName); //TraditionalChinese 67 68 #endregion 69 70 foreach (DRErrorMessage enumDRErrorMessage in Enum.GetValues(typeof(DRErrorMessage))) 71 { 72 //myDictionaryResult.Add((int)enumDRErrorMessage, enumDRErrorMessage.ToString() + suffixFileName); 73 addDictionaryKeyValeuPairs( myDictionaryResult, enumDRErrorMessage); 74 } 75 76 return myDictionaryResult; 77 }
View Code
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Collections; 6 7 8 namespace WindowsFormsApplication1 9 { 10 public class MatchCalssInitialition 11 { 12 public static string originalBinPath = @"C:\Program Files\Kodak\CaptureConsole\Bin\"; 13 14 public static string excelFilePath = @"D:\DRErrorMessageConfigurationFiles\segscbincidents_error_translations_form_011012_01(old) - Copy.xls"; 15 16 public static string suffixFileName = "DRErrorMessages.config"; 17 18 ///19 /// 20 /// 21 public enum DRErrorMessage 22 { 23 German = 5, 24 Czech = 6, 25 Danish = 7, 26 Greek = 8, 27 Spanish = 9, 28 Finnish = 10, 29 French = 11, 30 Hungarian = 12, 31 Italian = 13, 32 Japanese = 14, 33 Korean = 15, 34 Dutch = 16, 35 Norwegian = 17, 36 Polish = 18, 37 Portuguese = 19, //pt-br (Portuguese-LatinAmer : Portuguese Brazil ) 38 PortugueseIberian = 20, //pt-PT (Portuguese) 39 Romanian = 21, 40 Russian = 22, 41 Swedish = 23, 42 Turkish = 24, 43 ChineseS = 25, //SimplifiedChinese 44 ChineseT = 26 //TraditionalChinese 45 } 46 47 ///48 /// 49 /// 50 /// 51 ///52 public static Dictionary dtGetAllConfigurationFiles() 53 { 54 55 Dictionary myDictionaryResult = new Dictionary (); 56 57 #region add key value pair for dictionary. 58 59 //myDictionaryResult.Add((int)DRErrorMessage.German, DRErrorMessage.German.ToString() + suffixFileName); 60 //myDictionaryResult.Add((int)DRErrorMessage.Czech, DRErrorMessage.Czech.ToString() + suffixFileName); 61 //myDictionaryResult.Add((int)DRErrorMessage.Danish, DRErrorMessage.Danish.ToString() + suffixFileName); 62 //myDictionaryResult.Add((int)DRErrorMessage.Greek, DRErrorMessage.Greek.ToString() + suffixFileName); 63 //myDictionaryResult.Add((int)DRErrorMessage.Spanish, DRErrorMessage.Spanish.ToString() + suffixFileName); 64 //myDictionaryResult.Add((int)DRErrorMessage.Finnish, DRErrorMessage.Finnish.ToString() + suffixFileName); 65 66 //myDictionaryResult.Add((int)DRErrorMessage.French, DRErrorMessage.French.ToString() + suffixFileName); 67 //myDictionaryResult.Add((int)DRErrorMessage.Hungarian, DRErrorMessage.Hungarian.ToString() + suffixFileName); 68 //myDictionaryResult.Add((int)DRErrorMessage.Italian, DRErrorMessage.Italian.ToString() + suffixFileName); 69 //myDictionaryResult.Add((int)DRErrorMessage.Japanese, DRErrorMessage.Japanese.ToString() + suffixFileName); 70 //myDictionaryResult.Add((int)DRErrorMessage.Korean, DRErrorMessage.Korean.ToString() + suffixFileName); 71 //myDictionaryResult.Add((int)DRErrorMessage.Dutch, DRErrorMessage.Dutch.ToString() + suffixFileName); 72 73 //myDictionaryResult.Add((int)DRErrorMessage.Norwegian, DRErrorMessage.Norwegian.ToString() + suffixFileName); 74 //myDictionaryResult.Add((int)DRErrorMessage.Polish, DRErrorMessage.Polish.ToString() + suffixFileName); 75 //myDictionaryResult.Add((int)DRErrorMessage.Portuguese, DRErrorMessage.Portuguese.ToString() + suffixFileName); //pt-br (Portuguese-LatinAmer) 76 //myDictionaryResult.Add((int)DRErrorMessage.PortugueseIberian, DRErrorMessage.PortugueseIberian.ToString() + suffixFileName); //pt-PT (Portuguese) 77 //myDictionaryResult.Add((int)DRErrorMessage.Romanian, DRErrorMessage.Romanian.ToString() + suffixFileName); 78 //myDictionaryResult.Add((int)DRErrorMessage.Russian, DRErrorMessage.Russian.ToString() + suffixFileName); 79 80 //myDictionaryResult.Add((int)DRErrorMessage.Swedish, DRErrorMessage.Swedish.ToString() + suffixFileName); 81 //myDictionaryResult.Add((int)DRErrorMessage.Turkish, DRErrorMessage.Turkish.ToString() + suffixFileName); 82 //myDictionaryResult.Add((int)DRErrorMessage.ChineseS, DRErrorMessage.ChineseS.ToString() + suffixFileName); //SimplifiedChinese 83 //myDictionaryResult.Add((int)DRErrorMessage.ChineseT, DRErrorMessage.ChineseT.ToString() + suffixFileName); //TraditionalChinese 84 85 #endregion 86 87 foreach (DRErrorMessage enumDRErrorMessage in Enum.GetValues(typeof(DRErrorMessage))) 88 { 89 //myDictionaryResult.Add((int)enumDRErrorMessage, enumDRErrorMessage.ToString() + suffixFileName); 90 addDictionaryKeyValeuPairs( myDictionaryResult, enumDRErrorMessage); 91 } 92 93 return myDictionaryResult; 94 } 95 96 /// 97 /// 98 /// 99 /// 100 ///101 public static string getSingleConfigurationFilePath(int columnIndex) 102 { 103 string path = string.Empty; 104 Dictionary myDictionary = dtGetAllConfigurationFiles(); 105 foreach (KeyValuePair keyValue in myDictionary) 106 { 107 if (keyValue.Key == columnIndex) 108 { 109 path = originalBinPath + keyValue.Value; 110 break; 111 } 112 } 113 return path; 114 } 115 116 /// 117 /// 118 /// 119 /// 120 /// 121 public static void addDictionaryKeyValeuPairs( DictionarymyDictionary, DRErrorMessage drErrorMessage) 122 { 123 int index = (int)drErrorMessage; 124 if (!myDictionary.Keys.Contains(index)) 125 { 126 myDictionary.Add(index, drErrorMessage.ToString() + suffixFileName); 127 } 128 } 129 } 130 }