コード例 #1
0
ファイル: MainForm.cs プロジェクト: crashracer/EasyTerm
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        /// <created>UPh,31.10.2015</created>
        /// <changed>UPh,31.10.2015</changed>
        // ********************************************************************************
        public MainForm()
        {
            CultureInfo ci = new CultureInfo("en-US");

            Thread.CurrentThread.CurrentCulture   = ci;
            Thread.CurrentThread.CurrentUICulture = ci;

            Icon = Resources.app;

            string inipath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            inipath = Path.Combine(inipath, "EasyTermViewer\\profile.ini");
            PlProfile.SetProfileName(inipath, PlProfile.ProfileType.IniFile);
            EasyTermCoreSettings.ProfilePath = inipath;

            _StorePosition = new PlStorePosition();
            _StorePosition.Initialize(this);

            InitializeComponent();

            _TermbaseSet = new TermBaseSet();
            _TermbaseSet.SettingsFile = Environment.ExpandEnvironmentVariables("%appdata%\\EasyTermViewer\\settings.xml");
            Directory.CreateDirectory(Path.GetDirectoryName(_TermbaseSet.SettingsFile));

            _TermbaseSet.LoadStoredAndLocal();
            _TermBaseQuery = _TermbaseSet.Query;

            _TermBaseQuery.TermListResult    += TermBaseQuery_TermListResult;
            _TermBaseQuery.TermInfoResult    += TermBaseQuery_TermInfoResult;
            _TermBaseQuery.TerminologyResult += TermBaseQuery_TerminologyResult;

            _TermListResult    = new TermListResultCallback(OnTermListResult);
            _TermInfoResult    = new TermInfoResultCallback(OnTermInfoResult);
            _TerminologyResult = new TerminologyResultCallback(OnTerminologyResult);

            lstTerms.TermBaseSet       = _TermbaseSet;
            lstTerminology.TermBaseSet = _TermbaseSet;

            lstTerms.Dock       = DockStyle.Fill;
            lstTerminology.Dock = DockStyle.Fill;

            FindType = FindTypes.Text;

            InitializeLanguageComboBoxes();
            InitializeLanguageSelection();
        }
コード例 #2
0
        // ********************************************************************************
        /// <summary>
        ///
        /// </summary>
        /// <param name="set"></param>
        /// <returns></returns>
        /// <created>UPh,29.08.2015</created>
        /// <changed>UPh,29.08.2015</changed>
        // ********************************************************************************
        public TermBaseSelectionForm(TermBaseSet set)
        {
            if (PlProfile.Type != PlProfile.ProfileType.Unknown)
            {
                _StorePosition = new PlStorePosition();
                _StorePosition.Initialize(this);
            }
            InitializeComponent();

            DataChanged  = false;
            _TermbaseSet = set;

            lstFiles.FillList(_TermbaseSet);
            lstFiles.ActiveChanged += lstFiles_ActiveChanged;

            UpdateControls();
        }