Exemplo n.º 1
0
        //�N�����ɁA�R���X�g���N�^����Ăяo����鏉����
        private void DefaultInitialize(MainForm mainForm, ListView listViewLog, MenuStrip menuStrip, NotifyIcon notifyIcon)
        {
            RunMode = RunMode.Normal;
            RemoteConnect = null;//�����[�g����Őڑ�����Ă��鎞���������������

            //logger�����������܂ł̃��O��ꎞ�I�ɕۊǂ���
            //ArrayList<LogTemporary> tmpLogger = new ArrayList<>();

            //�v���Z�X�N�����ɏ����������
            View = new View(this, mainForm, listViewLog, notifyIcon);
            //logView = new LogView(listViewLog);
            LogView = new LogView(this,listViewLog);
            Menu = new Menu(this, menuStrip); //�����ł́A�I�u�W�F�N�g�̐����̂݁Amenu.Initialize()�́AlistInitialize()�̒��ŌĂяo�����
            DnsCache = new DnsCache();
            Wait = new Wait();

            Ver = new Ver(); //�o�[�W�����Ǘ�

            //Java fix
            //RunMode�̏�����
            if (mainForm == null){
                RunMode = RunMode.Service; //�T�[�r�X�N��
            } else{
                if (Environment.GetCommandLineArgs().Length > 1){
                    RunMode = RunMode.Remote; //�����[�g�N���C�A���g
                } else{
                    //�T�[�r�X�o�^�̏�Ԃ�擾����
                    var setupService = new SetupService(this);
                    if (setupService.IsRegist)
                        RunMode = RunMode.NormalRegist; //�T�[�r�X�o�^�������
                }
            }

            //Ver5.8.6 Java fix
            //OptionIni.Create(this); //�C���X�^���X�̏�����

            IniDb = new IniDb(ProgDir(), (RunMode == RunMode.Remote) ? "$remote" : "Option");

            MailBox = null;

            ListInitialize(); //�T�[�o�ċN���ŁA�ēx���s����鏉����

            if (_isTest){
                return;
            }

            //�E�C���h�T�C�Y�̕���
            var path = string.Format("{0}\\BJD.ini", ProgDir());
            try{
                //�E�C���h�E�̊O�ς�ۑ��E����(View���O�ɏ���������)
                WindowSize = new WindowSize(new Conf(ListOption.Get("Basic")), path);
                View.Read(WindowSize);
            } catch (IOException){
                WindowSize = null;
                // �w�肳�ꂽWindow���ۑ��t�@�C��(BJD.ini)��IO�G���[���������Ă���
                _logger.Set(LogKind.Error, null, 9000022, path);
            }

            //TraceDlg = new TraceDlg(this, (mainForm != null) ? mainForm.getFrame() : null); //�g���[�X�\��
            TraceDlg = new TraceDlg(this); //�g���[�X�\��

            switch (RunMode){
                case RunMode.Normal:
                    MenuOnClick("StartStop_Start"); //���j���[�I��C�x���g
                    break;
                case RunMode.Remote:
                    RemoteClient = new RemoteClient(this);
                    RemoteClient.Start();
                    break;
                //Java fix Ver5.8.3
                case RunMode.NormalRegist:
                case RunMode.Service:
                    break;
                default:
                    Util.RuntimeException("Kernel.defaultInitialize() not implement (RunMode)");
                    break;
            }

            //Java fix Ver5.8.3
            View.SetColor();//�E�C���h�F�̏�����
        }
Exemplo n.º 2
0
 public void Read(WindowSize windowSize)
 {
     if (MainForm == null || ListView == null || windowSize == null){
         return;
     }
     windowSize.Read(MainForm);
     windowSize.Read(ListView);
 }
Exemplo n.º 3
0
 public void Save(WindowSize windowSize)
 {
     if (MainForm == null || ListView == null || windowSize == null){
         return;
     }
     windowSize.Save(MainForm);
     windowSize.Save(ListView);
 }
Exemplo n.º 4
0
        //�N�����ɁA�R���X�g���N�^����Ăяo����鏉����
        private void DefaultInitialize(MainForm mainForm, ListView listViewLog, MenuStrip menuStrip, NotifyIcon notifyIcon)
        {
            RunMode       = RunMode.Normal;
            RemoteConnect = null;//�����[�g����Őڑ�����Ă��鎞���������������

            //logger�����������܂ł̃��O��ꎞ�I�ɕۊǂ���
            //ArrayList<LogTemporary> tmpLogger = new ArrayList<>();

            //�v���Z�X�N�����ɏ����������
            View = new View(this, mainForm, listViewLog, notifyIcon);
            //logView = new LogView(listViewLog);
            LogView  = new LogView(this, listViewLog);
            Menu     = new Menu(this, menuStrip); //�����ł́A�I�u�W�F�N�g�̐����̂݁Amenu.Initialize()�́AlistInitialize()�̒��ŌĂяo�����
            DnsCache = new DnsCache();
            Wait     = new Wait();

            Ver = new Ver(); //�o�[�W�����Ǘ�

            //Java fix
            //RunMode�̏�����
            if (mainForm == null)
            {
                RunMode = RunMode.Service; //�T�[�r�X�N��
            }
            else
            {
                if (Environment.GetCommandLineArgs().Length > 1)
                {
                    RunMode = RunMode.Remote; //�����[�g�N���C�A���g
                }
                else
                {
                    //�T�[�r�X�o�^�̏�Ԃ�擾����
                    var setupService = new SetupService(this);
                    if (setupService.IsRegist)
                    {
                        RunMode = RunMode.NormalRegist; //�T�[�r�X�o�^�������
                    }
                }
            }

            //Ver5.8.6 Java fix
            //OptionIni.Create(this); //�C���X�^���X�̏�����

            IniDb = new IniDb(ProgDir(), (RunMode == RunMode.Remote) ? "$remote" : "Option");

            MailBox = null;

            ListInitialize(); //�T�[�o�ċN���ŁA�ēx���s����鏉����


            if (_isTest)
            {
                return;
            }

            //�E�C���h�T�C�Y�̕���
            var path = string.Format("{0}\\BJD.ini", ProgDir());

            try{
                //�E�C���h�E�̊O�ς�ۑ��E����(View���O�ɏ���������)
                WindowSize = new WindowSize(new Conf(ListOption.Get("Basic")), path);
                View.Read(WindowSize);
            } catch (IOException) {
                WindowSize = null;
                // �w�肳�ꂽWindow���ۑ��t�@�C��(BJD.ini)��IO�G���[���������Ă���
                _logger.Set(LogKind.Error, null, 9000022, path);
            }

            //TraceDlg = new TraceDlg(this, (mainForm != null) ? mainForm.getFrame() : null); //�g���[�X�\��
            TraceDlg = new TraceDlg(this); //�g���[�X�\��

            switch (RunMode)
            {
            case RunMode.Normal:
                MenuOnClick("StartStop_Start");     //���j���[�I��C�x���g
                break;

            case RunMode.Remote:
                RemoteClient = new RemoteClient(this);
                RemoteClient.Start();
                break;

            //Java fix Ver5.8.3
            case RunMode.NormalRegist:
            case RunMode.Service:
                break;

            default:
                Util.RuntimeException("Kernel.defaultInitialize() not implement (RunMode)");
                break;
            }

            //Java fix Ver5.8.3
            View.SetColor();//�E�C���h�F�̏�����
        }