static void Main(string[] args) { EditorSetting setting = EditorSetting.Read(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain(setting)); }
public static EditorSetting Read() { FileStream stream = new FileStream("UCSEditorSetting.xml", FileMode.Open, FileAccess.Read); XmlSerializer serializer = new XmlSerializer(typeof(EditorSetting)); EditorSetting editorSetting = serializer.Deserialize(stream) as EditorSetting; return(editorSetting); }
public frmMain(EditorSetting setting) { InitializeComponent(); this.setting = setting; googleTransApiReq = new GoogleTranslateAPIRequest("<unknown>"); googleTransApiReq.TranslateFinished += GoogleTransApi_TranslateFinished; foreach (var kpl in setting.GoogleTranslateAPISetting.TranslateLanguages) { cmbGoogleTranslationAPILanguages.Items.Add(kpl.DisplayName); } if (cmbGoogleTranslationAPILanguages.Items.Count > 0) { cmbGoogleTranslationAPILanguages.SelectedIndex = 0; } }