private void urlnamebox_SelectedIndexChanged(object sender, EventArgs e) { try { FetchTarget ft = (FetchTarget)urlnamebox.Items[urlnamebox.SelectedIndex]; Target = ft; } catch (InvalidCastException ex) { return; } }
public static FetchTarget Deserialize(string msg) { string[] r = msg.Split(','); FetchTarget ft = new FetchTarget(); if (r.Length != Enum.GetNames(typeof(ftfield)).Length) return ft; ft.ParseNASD = Convert.ToBoolean(r[(int)ftfield.nasd]); ft.ParseNYSE = Convert.ToBoolean(r[(int)ftfield.nyse]); ft.Url = r[(int)ftfield.url]; ft.Name = r[(int)ftfield.name]; ft.RemoveDupes = Convert.ToBoolean(r[(int)ftfield.xdupe]); ft.ClickableOnly = Convert.ToBoolean(r[(int)ftfield.linked]); return ft; }
public bool NameInUse(string newname) { foreach (object i in urlnamebox.Items) { try { FetchTarget ft = (FetchTarget)i; if (newname == ft.Name) { return(true); } continue; } catch (InvalidCastException) { continue; } } return(false); }
public static FetchTarget Deserialize(string msg) { string[] r = msg.Split(','); FetchTarget ft = new FetchTarget(); if (r.Length != Enum.GetNames(typeof(ftfield)).Length) { return(ft); } ft.ParseNASD = Convert.ToBoolean(r[(int)ftfield.nasd]); ft.ParseNYSE = Convert.ToBoolean(r[(int)ftfield.nyse]); ft.Url = r[(int)ftfield.url]; ft.Name = r[(int)ftfield.name]; ft.RemoveDupes = Convert.ToBoolean(r[(int)ftfield.xdupe]); ft.ClickableOnly = Convert.ToBoolean(r[(int)ftfield.linked]); return(ft); }
public FetchBasket(FetchTarget ft) { InitializeComponent(); Target = ft; }