Ejemplo 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;
 }
Ejemplo 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));
            }
Ejemplo 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();
 }
Ejemplo 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);
                }
            }
        }
Ejemplo n.º 5
0
 public bool Contains(LogFilter value)
 {
     // If value is not of type Int16, this will return false.
     return (List.Contains(value));
 }
Ejemplo n.º 6
0
 public int Add(LogFilter value)
 {
     return (List.Add(value));
 }
Ejemplo n.º 7
0
 public void Remove(LogFilter value)
 {
     List.Remove(value);
 }
Ejemplo n.º 8
0
 public void Insert(int index, LogFilter value)
 {
     List.Insert(index, value);
 }
Ejemplo n.º 9
0
 public int IndexOf(LogFilter value)
 {
     return (List.IndexOf(value));
 }
Ejemplo 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);
         }
     }
 }
Ejemplo n.º 11
0
 public bool Contains(LogFilter value)
 {
     // If value is not of type Int16, this will return false.
     return(List.Contains(value));
 }
Ejemplo n.º 12
0
 public void Remove(LogFilter value)
 {
     List.Remove(value);
 }
Ejemplo n.º 13
0
 public void Insert(int index, LogFilter value)
 {
     List.Insert(index, value);
 }
Ejemplo n.º 14
0
 public int IndexOf(LogFilter value)
 {
     return(List.IndexOf(value));
 }
Ejemplo n.º 15
0
 public int Add(LogFilter value)
 {
     return(List.Add(value));
 }