rplan ui2plan() { DateTime starttm = DateTime.Parse(dt1_plan.Text + " " + dt2_plan.Text); int cycle = 0; int.TryParse(text_plancycle.Text, out cycle); cycleunit unit = str2unit(cb_planunit.Text); string msg = text_planmsg.Text.Trim(); if (string.IsNullOrWhiteSpace(msg)) { plan_log_func("!E: msg cannot be null or empty!"); return(null); } if (plan_msghash.ContainsKey(msg)) { if (!plan_override) { plan_log_func("!E: <" + msg + "> already exists!"); return(null); } plan_del(msg); } return(new rplan(plan_log_func, starttm, cycle, unit, msg, plan_panel.add(msg, null, plan_click))); }
void httpd_add_path(string p) { p = Path.GetFullPath(p); if (httpd_phash.ContainsValue(p)) { return; } if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { httpd_add_path(p); })); return; } TextBox tb = http_fpannel.add(p, null, httpd_dir_click); httpd_phash.Add(tb, p); if (File.Exists(p)) { httpd.add_file(p); } else if (Directory.Exists(p)) { httpd.add_dir(p); } saveconf(); }
TextBox tftpd_add_dir() { TextBox tb = tftpd_dpanel.add("", tftpd_dir_click, null); tftpd_dirs.Add(tb); tftpd_set_dir(tb, lasttftpddir); return(tb); }
void start_scan() { scan_parse_args(); Byte[] ipbytes = IPAddress.Parse(scan_startip).GetAddressBytes(); int iplen = ipbytes.Length; for (int i = ipbytes[iplen - 1]; i <= scan_lastbyte && i < 255; i++) { TextBox tb = scan_panel.add(i.ToString(), null, null); tb.Width = tb.Height = 28; tb.TextAlign = HorizontalAlignment.Center; ipbytes[iplen - 1] = (Byte)i; rping s = new rping(scan_log_func); s.start((new IPAddress(ipbytes)).ToString(), scan_opts, scan_reply, tb); scansshash.Add(tb, s); } }
void add_user(IPEndPoint ep, string user) { if (this.InvokeRequired) { this.Invoke(new MethodInvoker(delegate { add_user(ep, user); })); return; } //chat_log_func("I: " + ep.ToString() + " " + user); if (chatephash.ContainsKey(ep)) { chatephash.Remove(ep); } chatephash.Add(ep, user); TextBox tb = chat_upanel.add(user, user_click, null); tb.TextAlign = HorizontalAlignment.Center; chatbtnhash.Add(tb, ep); }