//RunMode��Remote�̏ꍇ�AKernel��MenuOnClick����A�����炪�Ă�� public void MenuOnClick(String cmd) { //�I�v�V�������j���[�̏ꍇ if (cmd.IndexOf("Option_") == 0) { var oneOption = _kernel.ListOption.Get(cmd.Substring(7)); if (oneOption != null) { var dlg = new OptionDlg(_kernel, oneOption); if (DialogResult.OK == dlg.ShowDialog()) { oneOption.Save(_kernel.IniDb);//�I�v�V������ۑ����� //�T�[�o���֑��M���� string optionStr; using (var sr = new StreamReader(_optionFileName, Encoding.GetEncoding("Shift_JIS"))) { optionStr = sr.ReadToEnd(); sr.Close(); } //Option�̑��M(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdOption, optionStr); } } //�u�c�[���v���j���[�̏ꍇ } else if (cmd.IndexOf("Tool_") == 0) { var oneTool = _kernel.ListTool.Get(cmd.Substring(5)); if (oneTool != null) { _toolDlg = oneTool.CreateDlg(_sockTcp); _toolDlg.ShowDialog(); _toolDlg.Dispose(); _toolDlg = null; } //�u�N���^��~�v�̏ꍇ } else if (cmd.IndexOf("StartStop_") == 0) { string nameTag = cmd.Substring(10); if (nameTag == "Restart") { if (_sockTcp != null) { //�u�ċN���v���j���[�I��(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdRestart, ""); } } } }
//RunModeがRemoteの場合、KernelのMenuOnClickから、こちらが呼ばれる public void MenuOnClick(String cmd) { //オプションメニューの場合 if (cmd.IndexOf("Option_") == 0) { var oneOption = _kernel.ListOption.Get(cmd.Substring(7)); if (oneOption != null) { var dlg = new OptionDlg(_kernel, oneOption); if (DialogResult.OK == dlg.ShowDialog()) { oneOption.Save(_kernel.IniDb);//オプションを保存する //サーバ側へ送信する string optionStr; using (var sr = new StreamReader(_optionFileName, Encoding.GetEncoding("Shift_JIS"))) { optionStr = sr.ReadToEnd(); sr.Close(); } //Optionの送信(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdOption, optionStr); } } //「ツール」メニューの場合 } else if (cmd.IndexOf("Tool_") == 0) { var oneTool = _kernel.ListTool.Get(cmd.Substring(5)); if (oneTool != null) { _toolDlg = oneTool.CreateDlg(_sockTcp); _toolDlg.ShowDialog(); _toolDlg.Dispose(); _toolDlg = null; } //「起動/停止」の場合 } else if (cmd.IndexOf("StartStop_") == 0) { string nameTag = cmd.Substring(10); if (nameTag == "Restart") { if (_sockTcp != null) { //「再起動」メニュー選択(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdRestart, ""); } } } }
//RunMode��Remote�̏ꍇ�AKernel��MenuOnClick����A�����炪�Ă�� public void MenuOnClick(String cmd) { //�I�v�V�������j���[�̏ꍇ if (cmd.IndexOf("Option_") == 0){ var oneOption = _kernel.ListOption.Get(cmd.Substring(7)); if (oneOption != null) { var dlg = new OptionDlg(_kernel, oneOption); if (DialogResult.OK == dlg.ShowDialog()) { oneOption.Save(_kernel.IniDb);//�I�v�V������ۑ����� //�T�[�o���֑��M���� string optionStr; using (var sr = new StreamReader(_optionFileName, Encoding.GetEncoding("Shift_JIS"))) { optionStr = sr.ReadToEnd(); sr.Close(); } //Option�̑��M(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdOption, optionStr); } } //�u�c�[���v���j���[�̏ꍇ }else if (cmd.IndexOf("Tool_") == 0){ var oneTool = _kernel.ListTool.Get(cmd.Substring(5)); if (oneTool != null) { _toolDlg = oneTool.CreateDlg(_sockTcp); _toolDlg.ShowDialog(); _toolDlg.Dispose(); _toolDlg = null; } //�u�N���^��~�v�̏ꍇ } else if (cmd.IndexOf("StartStop_") == 0) { string nameTag = cmd.Substring(10); if (nameTag == "Restart") { if (_sockTcp != null) { //�u�ċN���v���j���[�I��(C->S) RemoteData.Send(_sockTcp, RemoteDataKind.CmdRestart, ""); } } } }