Exemplo n.º 1
0
 private LogFilter LoadFilter(string index)
 {
     LogFilter filter = new LogFilter();
     if (index != "")
     {
         RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
         RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
         RegistryKey SuiteKey = ManufacturerKey.CreateSubKey("T8SuitePro");
         using (RegistryKey Settings = SuiteKey.CreateSubKey("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)
             {
                 logger.Debug(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));
            }
Exemplo 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();
        }
Exemplo n.º 4
0
        private void SaveFilter(LogFilter filter)
        {
            RegistryKey SoftwareKey     = Registry.CurrentUser.CreateSubKey("Software");
            RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
            RegistryKey SuiteKey        = ManufacturerKey.CreateSubKey(_suiteRegistry.getRegistryPath());

            if (filter.Symbol != "")
            {
                using (RegistryKey saveSettings = SuiteKey.CreateSubKey("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);
                }
            }
        }
Exemplo n.º 5
0
        private void SaveFilter(LogFilter filter)
        {
            RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
            RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
            RegistryKey SuiteKey = ManufacturerKey.CreateSubKey("T8SuitePro");

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