示例#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;
 }
示例#2
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
示例#3
0
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     :
     base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index      = idx;
 }
示例#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);
        }
示例#5
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
示例#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();
 }
示例#7
0
 public void SetFilters(LogFilterCollection filters)
 {
     _filters = filters;
 }
示例#8
0
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     : base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index = idx;
 }
示例#9
0
 public void SetFilters(LogFilterCollection filters)
 {
     if (filters == null) Console.WriteLine("setting filters as null");
     gridControl1.DataSource = filters;
     gridView1.BestFitColumns();
 }