private static StainCollection Load() { StainCollection result = new StainCollection(); MySqlCommand cmd = new MySqlCommand("Select JSONValue from tblStain;"); cmd.CommandType = CommandType.Text; using (MySqlConnection cn = new MySqlConnection(YellowstonePathology.Properties.Settings.Default.CurrentConnectionString)) { cn.Open(); cmd.Connection = cn; using (MySqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { string jString = dr[0].ToString(); Stain stain = JsonStainFactory.FromJson(jString); result.Add(stain); } } } return(result); }
static public StainCollection Refresh() { instance = null; return(Instance); }