Exemple #1
0
        static void Main(string[] args)
        {
            EditorSetting setting = EditorSetting.Read();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain(setting));
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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;
            }
        }