private LogFilter LoadFilter(string index) { LogFilter filter = new LogFilter(); RegistryKey TempKey = null; if (index != "") { TempKey = Registry.CurrentUser.CreateSubKey("Software"); using (RegistryKey Settings = TempKey.CreateSubKey("T5Suite2\\LogFilters\\" + index)) { try { filter.Index = Convert.ToInt32(index); filter.Active = Convert.ToBoolean(Settings.GetValue("active").ToString()); filter.Type = (Trionic5Tools.LogFilter.MathType)Convert.ToInt32(Settings.GetValue("type")); filter.Symbol = Settings.GetValue("symbol").ToString(); filter.Value = (float)ConvertToDouble(Settings.GetValue("value").ToString()); } catch (Exception E) { Console.WriteLine(E.Message); } } } return filter; }
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType) { if (destType == typeof(string) && value is LogFilter) { // Cast the value to an Employee type LogFilter pp = (LogFilter)value; return(pp.Symbol + ", " + pp.Type.ToString()); } return(base.ConvertTo(context, culture, value, destType)); }
private void simpleButton1_Click(object sender, EventArgs e) { LogFilterCollection filters = (LogFilterCollection)gridControl1.DataSource; if (filters == null) filters = new LogFilterCollection(); LogFilter newfilter = new LogFilter(); newfilter.Index = filters.Count; filters.Add(newfilter); gridControl1.DataSource = filters; gridView1.RefreshData(); gridView1.BestFitColumns(); //gridView1.AddNewRow(); }
private void SaveFilter(LogFilter filter) { RegistryKey TempKey = null; TempKey = Registry.CurrentUser.CreateSubKey("Software"); if (filter.Symbol != "") { using (RegistryKey saveSettings = TempKey.CreateSubKey("T5Suite2\\LogFilters\\" + filter.Index.ToString())) { saveSettings.SetValue("value", filter.Value.ToString()); saveSettings.SetValue("type", (int)filter.Type); saveSettings.SetValue("index", filter.Index); saveSettings.SetValue("symbol", filter.Symbol); saveSettings.SetValue("active", filter.Active); } } }
private void simpleButton1_Click(object sender, EventArgs e) { LogFilterCollection filters = (LogFilterCollection)gridControl1.DataSource; if (filters == null) { filters = new LogFilterCollection(); } LogFilter newfilter = new LogFilter(); newfilter.Index = filters.Count; filters.Add(newfilter); gridControl1.DataSource = filters; gridView1.RefreshData(); gridView1.BestFitColumns(); //gridView1.AddNewRow(); }
public LogFilterCollection GetFiltersFromRegistry() { LogFilterCollection filters = new LogFilterCollection(); RegistryKey TempKey = null; TempKey = Registry.CurrentUser.CreateSubKey("Software"); // als "T5Suite2" niet bestaat, eerst inlezen uit "T5SuitePro" en dan meteen weer opslaan try { RegistryKey testKey = TempKey.OpenSubKey("T5Suite2"); using (RegistryKey Settings = TempKey.CreateSubKey("T5Suite2\\LogFilters")) { if (Settings != null) { string[] vals = Settings.GetSubKeyNames(); foreach (string a in vals) { try { LogFilter filter = LoadFilter(a); filters.Add(filter); } catch (Exception E) { Console.WriteLine(E.Message); } } } } } catch (Exception E2) { Console.WriteLine(E2.Message); } return(filters); }
public void Remove(LogFilter value) { List.Remove(value); }
public void Insert(int index, LogFilter value) { List.Insert(index, value); }
public int IndexOf(LogFilter value) { return (List.IndexOf(value)); }
public bool Contains(LogFilter value) { // If value is not of type Int16, this will return false. return(List.Contains(value)); }
public int IndexOf(LogFilter value) { return(List.IndexOf(value)); }
public int Add(LogFilter value) { return(List.Add(value)); }
public int Add(LogFilter value) { return (List.Add(value)); }
public bool Contains(LogFilter value) { // If value is not of type Int16, this will return false. return (List.Contains(value)); }