Пример #1
0
        public static void LoadEnvironment(InitialAction act)
        {
            ThemeUtil.Init();

            OptionPreservePlace place = GetOptionPreservePlace();

            _options              = new ContainerOptions();
            _history              = new ConnectionHistory();
            _macroManager         = new MacroManager();
            _container            = new PoderosaContainer();
            _globalCommandTarget  = new ContainerGlobalCommandTarget();
            _interThreadUIService = new ContainerInterThreadUIService();
            _sshKnownHosts        = new SSHKnownHosts();


            //この時点ではOSの言語設定に合ったリソースをロードする。起動直前で必要に応じてリロード
            ReloadStringResource();

            GEnv.Init(_container);
            GEnv.Options              = _options;
            GEnv.GlobalCommandTarget  = _globalCommandTarget;
            GEnv.InterThreadUIService = _interThreadUIService;
            GEnv.SSHKnownHosts        = _sshKnownHosts;
            string dir = GetOptionDirectory(place);

            LoadConfigFiles(dir, act);
            _options.OptionPreservePlace = place;

            //ここまできたら言語設定をチェックし、必要なら読み直し
            if (GUtil.CurrentLanguage != _options.Language)
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = _options.Language == Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture;
                ReloadStringResource();
            }
        }
Пример #2
0
        public static void LoadEnvironment(InitialAction act)
        {
            ThemeUtil.Init();

            OptionPreservePlace place = GetOptionPreservePlace();
            _options = new ContainerOptions();
            _history = new ConnectionHistory();
            _macroManager = new MacroManager();
            _container = new PoderosaContainer();
            _globalCommandTarget = new ContainerGlobalCommandTarget();
            _interThreadUIService = new ContainerInterThreadUIService();
            _sshKnownHosts = new SSHKnownHosts();

            _options.Init();

            //���̎��_�ł�OS�̌���ݒ�ɍ��������\�[�X����[�h����B�N�����O�ŕK�v�ɉ����ă����[�h
            ReloadStringResource();

            GEnv.Init(_container);
            GEnv.Options = _options;
            GEnv.GlobalCommandTarget = _globalCommandTarget;
            GEnv.InterThreadUIService = _interThreadUIService;
            GEnv.SSHKnownHosts = _sshKnownHosts;
            string dir = GetOptionDirectory(place);
            LoadConfigFiles(dir, act);
            _options.OptionPreservePlace = place;

            //�����܂ł����猾��ݒ��`�F�b�N���A�K�v�Ȃ�ǂݒ���
            if(GUtil.CurrentLanguage!=_options.Language) {
                System.Threading.Thread.CurrentThread.CurrentUICulture = _options.Language==Language.Japanese? new CultureInfo("ja") : CultureInfo.InvariantCulture;
                ReloadStringResource();
            }
        }
Пример #3
0
        private static void LoadEnvironment(InitialAction act)
        {
            ThemeUtil.Init();

            OptionPreservePlace place = GetOptionPreservePlace();
            _options = new ContainerOptions();
            _history = new ConnectionHistory();
            _macroManager = new MacroManager();
            _container = new PoderosaContainer();
            _globalCommandTarget = new ContainerGlobalCommandTarget();
            _interThreadUIService = new ContainerInterThreadUIService();
            _sshKnownHosts = new SSHKnownHosts();

            //���̎��_�ł�OS�̌���ݒ�ɍ��������\�[�X����[�h����B�N�����O�ŕK�v�ɉ����ă����[�h
            ReloadStringResource();

            GEnv.Init(_container);
            GEnv.Options = _options;
            GEnv.GlobalCommandTarget = _globalCommandTarget;
            GEnv.InterThreadUIService = _interThreadUIService;
            GEnv.SSHKnownHosts = _sshKnownHosts;
            string dir = GetOptionDirectory(place);
            LoadConfigFiles(dir, act);
            _options.OptionPreservePlace = place;

            // Check the language settings, re-read it if needed.
            if (GUtil.CurrentLanguage != _options.Language) {
                switch (_options.Language) {
                    case Language.Japanese:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("ja");
                    break;
                    case Language.Chinese:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh");
                    break;
                    default:
                        System.Threading.Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;
                    break;
                }
                ReloadStringResource();
            }
        }