//listValの初期化 // protected void Init() { // // // //「ACL」タブの追加 // if (_useAcl) { // var list = new ListVal(); // list.Add(new OneVal("enableAcl", 0, Crlf.Nextline, new CtrlRadio((Kernel.IsJp()) ? "指定したアドレスからのアクセスのみを" : "Access of ths user who appoint it", new List<string> { (Kernel.IsJp()) ? "許可する" : "Allow", (Kernel.IsJp()) ? "禁止する" : "Deny" }, OptionDlg.Width() - 15, 2))); // {//DAT // var l = new ListVal(); // l.Add(new OneVal("aclName", "", Crlf.Nextline, new CtrlTextBox((Kernel.IsJp()) ? "名前(表示名)" : "Name(Display)", 200))); // l.Add(new OneVal("aclAddress", "", Crlf.Nextline, new CtrlTextBox((Kernel.IsJp()) ? "アドレス" : "Address", 300))); // list.Add(new OneVal("acl", null, Crlf.Nextline, new CtrlDat((Kernel.IsJp()) ? "利用者(アドレス)の指定" : "Access Control List", l, 600, 340, Kernel.IsJp()))); // }//DAT // Add(new OneVal("ACL", list, Crlf.Nextline, new CtrlTabPage("ACL"))); // } // // //名前重複の確認 + ar.Valsの初期化 // foreach (var a in ListVal.Vals) { // if (1 != ListVal.Vals.Count(o => o.Name == a.Name)) { // throw new Exception(string.Format("Name repetition {0}-{1}\r\n", this, a.Name)); // } // } // // //レジストリからの読み込み // _iniDb.Read(NameTag, ListVal); // } // protected OnePage PageAcl() { var onePage = new OnePage("ACL", "ACL"); onePage.Add(new OneVal("enableAcl", 0, Crlf.Nextline, new CtrlRadio(_isJp ? "指定したアドレスからのアクセスのみを": "Access of ths user who appoint it", new[] { _isJp ? "許可する" : "Allow", _isJp ? "禁止する" : "Deny" }, OptionDlg.Width() - 15, 2))); var list = new ListVal(); list.Add(new OneVal("aclName", "", Crlf.Nextline, new CtrlTextBox(_isJp ? "名前(表示名)" : "Name(Display)", 20))); list.Add(new OneVal("aclAddress", "", Crlf.Nextline, new CtrlTextBox(_isJp ? "アドレス" : "Address", 20))); onePage.Add(new OneVal("acl", null, Crlf.Nextline, new CtrlDat(_isJp ? "利用者(アドレス)の指定" : "Access Control List", list, 310, Lang.LangKind))); return(onePage); }
private OnePage Page2(string name, string title) { var onePage = new OnePage(name, title); var key = "isDisplay"; onePage.Add(new OneVal(key, 1, Crlf.Nextline, new CtrlRadio(Lang.Value(key), new[] { Lang.Value(key + "1"), Lang.Value(key + "2") }, OptionDlg.Width() - 15, 2))); var list = new ListVal(); key = "Character"; list.Add(new OneVal(key, "", Crlf.Nextline, new CtrlTextBox(Lang.Value(key), 50))); key = "limitString"; onePage.Add(new OneVal(key, null, Crlf.Nextline, new CtrlDat(Lang.Value(key), list, 230, Lang.LangKind))); key = "useLimitString"; onePage.Add(new OneVal(key, false, Crlf.Nextline, new CtrlCheckBox(Lang.Value(key)))); return(onePage); }
//���j���[�I����̏��� public void MenuOnClick(String cmd) { if (cmd.IndexOf("Option_") == 0){ if (RunMode == RunMode.Remote){ //Java fix RunMOde==Remote�̏ꍇ�̃��j���[���� RemoteClient.MenuOnClick(cmd); } else{ var oneOption = ListOption.Get(cmd.Substring(7)); if (oneOption != null){ var dlg = new OptionDlg(this, oneOption); if (DialogResult.OK == dlg.ShowDialog()){ //Ver5.8.6 Java fix //oneOption.Save(OptionIni.GetInstance()); oneOption.Save(IniDb); MenuOnClick("StartStop_Reload"); } } } } else if (cmd.IndexOf("Tool_") == 0){ if (RunMode == RunMode.Remote){ //Java fix RunMOde==Remote�̏ꍇ�̃��j���[���� RemoteClient.MenuOnClick(cmd); } else{ var nameTag = cmd.Substring(5); var oneTool = ListTool.Get(nameTag); if (oneTool == null) return; //BJD.EXE�ȊO�̏ꍇ�A�T�[�o�I�u�W�F�N�g�ւ̃|�C���^���K�v�ɂȂ� OneServer oneServer = null; if (nameTag != "BJD"){ oneServer = ListServer.Get(nameTag); if (oneServer == null){ return; } } ToolDlg dlg = oneTool.CreateDlg(oneServer); dlg.ShowDialog(); } } else if (cmd.IndexOf("StartStop_") == 0){ if (RunMode == RunMode.Remote){ //Java fix RunMOde==Remote�̏ꍇ�̃��j���[���� RemoteClient.MenuOnClick(cmd); } else{ switch (cmd){ case "StartStop_Start": Start(); break; case "StartStop_Stop": Stop(); break; case "StartStop_Restart": Stop(); Thread.Sleep(300); Start(); break; case "StartStop_Reload": Stop(); ListInitialize(); Start(); break; case "StartStop_Service": SetupService(); //�T�[�r�X�̐ݒ� break; default: Util.RuntimeException(string.Format("cmd={0}", cmd)); break; } View.SetColor(); //�E�C���h�̃J���[������ Menu.SetEnable(); //��Ԃɉ������L���E���� } } else{ switch (cmd){ case "File_LogClear": LogView.Clear(); break; case "File_LogCopy": LogView.SetClipboard(); break; case "File_Trace": TraceDlg.Open(); break; case "File_Exit": View.MainForm.Close(); break; case "Help_Version": var dlg = new VersionDlg(this); dlg.ShowDialog(); break; case "Help_Homepage": Process.Start(Define.WebHome()); break; case "Help_Document": Process.Start(Define.WebDocument()); break; case "Help_Support": Process.Start(Define.WebSupport()); break; } } }
//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, ""); } } } }