Esempio n. 1
0
 private LogFilter LoadFilter(string index)
 {
     LogFilter filter = new LogFilter();
     RegistryKey TempKey = null;
     if (index != "")
     {
         TempKey = Registry.CurrentUser.CreateSubKey("Software");
         using (RegistryKey Settings = TempKey.CreateSubKey("MotronicSuite\\LogFilters\\" + index))
         {
             try
             {
                 filter.Index = Convert.ToInt32(index);
                 filter.Active = Convert.ToBoolean(Settings.GetValue("active").ToString());
                 filter.Type = (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;
 }
Esempio n. 2
0
            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));
            }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
        private void SaveFilter(LogFilter filter)
        {
            RegistryKey TempKey = null;

            TempKey = Registry.CurrentUser.CreateSubKey("Software");
            if (filter.Symbol != "")
            {
                using (RegistryKey saveSettings = TempKey.CreateSubKey("MotronicSuite\\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);
                }
            }
        }
Esempio n. 5
0
 public bool Contains(LogFilter value)
 {
     // If value is not of type Int16, this will return false.
     return (List.Contains(value));
 }
Esempio n. 6
0
 public int Add(LogFilter value)
 {
     return (List.Add(value));
 }
Esempio n. 7
0
 public void Remove(LogFilter value)
 {
     List.Remove(value);
 }
Esempio n. 8
0
 public void Insert(int index, LogFilter value)
 {
     List.Insert(index, value);
 }
Esempio n. 9
0
 public int IndexOf(LogFilter value)
 {
     return (List.IndexOf(value));
 }
Esempio n. 10
0
 private void SaveFilter(LogFilter filter)
 {
     RegistryKey TempKey = null;
     TempKey = Registry.CurrentUser.CreateSubKey("Software");
     if (filter.Symbol != "")
     {
         using (RegistryKey saveSettings = TempKey.CreateSubKey("MotronicSuite\\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);
         }
     }
 }
Esempio n. 11
0
 public bool Contains(LogFilter value)
 {
     // If value is not of type Int16, this will return false.
     return(List.Contains(value));
 }
Esempio n. 12
0
 public void Remove(LogFilter value)
 {
     List.Remove(value);
 }
Esempio n. 13
0
 public void Insert(int index, LogFilter value)
 {
     List.Insert(index, value);
 }
Esempio n. 14
0
 public int IndexOf(LogFilter value)
 {
     return(List.IndexOf(value));
 }
Esempio n. 15
0
 public int Add(LogFilter value)
 {
     return(List.Add(value));
 }