public void Learn(string name, int number, Dictionary <string, double> result) { if (result == null || result.Count <= 0) { return; } Data[number].Add(result); TrainingStrength += result.Count; ThreadedDictionary <string, double> buffor = (ThreadedDictionary <string, double>)result; string data = buffor.XmlSerialize(); Database.Set(name + "-" + number, data); }
public static void SaveProperty(this Control control, string propertyName) { if (control == null) { return; } string directory = Directories.Create(@"Asmodat\Extensions.Windows.Forms.ControlEx").FullName; string fileName = Files.RemoveInvalidFilenameCharacters(control.GetFullPathName()); string path = directory + @"\" + fileName + ".adbs"; DatabseSimpleton dbs = new DatabseSimpleton(path, false); object value = control.GetType().GetProperty(propertyName).GetValue(control, null); dbs.Set(propertyName, value); dbs.Save(); }