Esempio n. 1
0
 public MotronicTools.LogFilterCollection GetFiltersFromRegistry()
 {
     LogFilterCollection filters = new LogFilterCollection();
     RegistryKey TempKey = null;
     TempKey = Registry.CurrentUser.CreateSubKey("Software");
     try
     {
         RegistryKey testKey = TempKey.OpenSubKey("MotronicSuite");
         using (RegistryKey Settings = TempKey.CreateSubKey("MotronicSuite\\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;
 }
Esempio n. 2
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
Esempio n. 3
0
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     :
     base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index      = idx;
 }
Esempio n. 4
0
        public MotronicTools.LogFilterCollection GetFiltersFromRegistry()
        {
            LogFilterCollection filters = new LogFilterCollection();
            RegistryKey         TempKey = null;

            TempKey = Registry.CurrentUser.CreateSubKey("Software");
            try
            {
                RegistryKey testKey = TempKey.OpenSubKey("MotronicSuite");
                using (RegistryKey Settings = TempKey.CreateSubKey("MotronicSuite\\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);
        }
Esempio n. 5
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
Esempio n. 6
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. 7
0
 public void SetFilters(LogFilterCollection filters)
 {
     _filters = filters;
 }
Esempio n. 8
0
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     : base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index = idx;
 }
Esempio n. 9
0
 public void SetFilters(LogFilterCollection filters)
 {
     if (filters == null) Console.WriteLine("setting filters as null");
     gridControl1.DataSource = filters;
     gridView1.BestFitColumns();
 }