public OptionDlg(Kernel kernel, OneOption oneOption) { InitializeComponent(); //メニューの項目名をダイアログのタイトルにする var text = oneOption.MenuStr; var index = text.LastIndexOf(','); Text = index != 0 ? text.Substring(index + 1) : text; //(&R)のようなショートカット指定を排除する index = Text.IndexOf('('); if (0 <= index) { Text = Text.Substring(0, index); } //&を排除する Text = Util.SwapChar('&', '\b', Text); _oneOption = oneOption; oneOption.CreateDlg(panelMain); buttonCancel.Text = (kernel.IsJp()) ? "キャンセル" : "Cancel"; }
public static void BeforeClass() { //設定ファイルの退避と上書き _op = new TmpOption("WebServerTest","WebServerTest.ini"); var _kernel = new Kernel(); option = _kernel.ListOption.Get("Web-localhost:88"); }
public Conf(OneOption oneOption) { NameTag = oneOption.NameTag; var list = oneOption.ListVal.GetList(null); foreach (var o in list) { var ctrlType = o.OneCtrl.GetCtrlType(); switch (ctrlType) { case CtrlType.Dat: if (o.Value != null) { _ar.Add(o.Name, o.Value); } else { _ar.Add(o.Name, new Dat(((CtrlDat)o.OneCtrl).CtrlTypeList)); } break; case CtrlType.CheckBox: case CtrlType.TextBox: case CtrlType.AddressV4: case CtrlType.AddressV6: case CtrlType.BindAddr: case CtrlType.Folder: case CtrlType.File: case CtrlType.ComboBox: case CtrlType.Int: case CtrlType.Memo: case CtrlType.Font: case CtrlType.Radio: case CtrlType.Hidden: _ar.Add(o.Name, o.Value); break; case CtrlType.TabPage: case CtrlType.Group: case CtrlType.Label: break; default: Util.RuntimeException(string.Format("未定義 {0}", ctrlType)); break; } } }
public static void BeforeClass() { //設定ファイルの退避と上書き _op = new TmpOption("WebServerTest","WebServerTest.ini"); Kernel kernel = new Kernel(); option = kernel.ListOption.Get("Web-localhost:88"); //サーバ起動 _v4Sv = new Server(kernel, new Conf(option), new OneBind(new Ip(IpKind.V4Localhost), ProtocolKind.Tcp)); _v4Sv.Start(); _v6Sv = new Server(kernel, new Conf(option), new OneBind(new Ip(IpKind.V6Localhost), ProtocolKind.Tcp)); _v6Sv.Start(); }
public Conf(OneOption oneOption) { NameTag = oneOption.NameTag; var list = oneOption.ListVal.GetList(null); foreach (var o in list){ var ctrlType = o.OneCtrl.GetCtrlType(); switch (ctrlType){ case CtrlType.Dat: if (o.Value != null){ _ar.Add(o.Name, o.Value); } else { _ar.Add(o.Name, new Dat(((CtrlDat)o.OneCtrl).CtrlTypeList)); } break; case CtrlType.CheckBox: case CtrlType.TextBox: case CtrlType.AddressV4: case CtrlType.AddressV6: case CtrlType.BindAddr: case CtrlType.Folder: case CtrlType.File: case CtrlType.ComboBox: case CtrlType.Int: case CtrlType.Memo: case CtrlType.Font: case CtrlType.Radio: case CtrlType.Hidden: _ar.Add(o.Name, o.Value); break; case CtrlType.TabPage: case CtrlType.Group: case CtrlType.Label: break; default: Util.RuntimeException(string.Format("未定義 {0}", ctrlType)); break; } } }
public MlOption(Kernel kernel,OneOption op) { var maxSummary = (int)op.GetValue("maxSummary"); var maxGet = (int)op.GetValue("maxGet"); var autoRegistration = (bool)op.GetValue("autoRegistration");//自動登録 var titleKind = (int)op.GetValue("title"); var docs = new List<string>(); foreach (MlDocKind docKind in Enum.GetValues(typeof(MlDocKind))) { var buf = (string)op.GetValue(docKind.ToString().ToLower() + "Document"); if (buf.Length < 2 || buf[buf.Length - 2] != '\r' || buf[buf.Length - 1] != '\n'){ buf = buf + "\r\n"; } docs.Add(buf); } var manageDir = (string)op.GetValue("manageDir"); //Ver6.0.1 manageDir = kernel.ReplaceOptionEnv(manageDir); //Ver6.0.0で間違えたフォルダの修復 if (Directory.Exists("%ExecutablePath%") && Directory.Exists("%ExecutablePath%\\ml")) { try{ var path = Path.GetFullPath("%ExecutablePath%"); var dir = Path.GetDirectoryName(path); if (dir != null){ Directory.Move(path + "\\ml", dir + "\\ml"); Directory.Delete(path); } } catch (Exception){ ; } } var memberList = (Dat)op.GetValue("memberList"); if (memberList == null){ memberList = new Dat(new[] { CtrlType.TextBox, CtrlType.TextBox, CtrlType.CheckBox, CtrlType.CheckBox, CtrlType.CheckBox, CtrlType.TextBox }); } Init(maxSummary, maxGet, autoRegistration, titleKind, docs, manageDir, memberList); }
public OptionDlg(Kernel kernel, OneOption oneOption) { InitializeComponent(); //メニューの項目名をダイアログのタイトルにする var text = oneOption.MenuStr; var index = text.LastIndexOf(','); Text = index != 0 ? text.Substring(index+1) : text; //(&R)のようなショートカット指定を排除する index = Text.IndexOf('('); if (0 <= index) { Text = Text.Substring(0, index); } //&を排除する Text = Util.SwapChar('&','\b',Text); _oneOption = oneOption; oneOption.CreateDlg(panelMain); buttonCancel.Text = (kernel.IsJp()) ? "キャンセル" : "Cancel"; }