示例#1
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
示例#2
0
 public void SaveFiltersToRegistry(LogFilterCollection filters)
 {
     foreach (LogFilter filter in filters)
     {
         SaveFilter(filter);
     }
 }
示例#3
0
 public LogFilterCollection GetFiltersFromRegistry()
 {
     LogFilterCollection filters = new LogFilterCollection();
     RegistryKey SoftwareKey = Registry.CurrentUser.CreateSubKey("Software");
     RegistryKey ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
     RegistryKey SuiteKey = ManufacturerKey.CreateSubKey("T8SuitePro");
     try
     {
         using (RegistryKey Settings = SuiteKey.CreateSubKey("LogFilters"))
         {
             if (Settings != null)
             {
                 string[] vals = Settings.GetSubKeyNames();
                 foreach (string a in vals)
                 {
                     try
                     {
                         LogFilter filter = LoadFilter(a);
                         filters.Add(filter);
                     }
                     catch (Exception E)
                     {
                         logger.Debug(E.Message);
                     }
                 }
             }
         }
     }
     catch (Exception E2)
     {
         logger.Debug(E2.Message);
     }
     return filters;
 }
示例#4
0
        public LogFilterCollection GetFiltersFromRegistry()
        {
            LogFilterCollection filters         = new LogFilterCollection();
            RegistryKey         SoftwareKey     = Registry.CurrentUser.CreateSubKey("Software");
            RegistryKey         ManufacturerKey = SoftwareKey.CreateSubKey("MattiasC");
            RegistryKey         SuiteKey        = ManufacturerKey.CreateSubKey(_suiteRegistry.getRegistryPath());

            try
            {
                using (RegistryKey Settings = SuiteKey.CreateSubKey("LogFilters"))
                {
                    if (Settings != null)
                    {
                        string[] vals = Settings.GetSubKeyNames();
                        foreach (string a in vals)
                        {
                            try
                            {
                                LogFilter filter = LoadFilter(a);
                                filters.Add(filter);
                            }
                            catch (Exception E)
                            {
                                logger.Debug(E.Message);
                            }
                        }
                    }
                }
            }
            catch (Exception E2)
            {
                logger.Debug(E2.Message);
            }
            return(filters);
        }
        private void btnFilters_Click(object sender, EventArgs e)
        {
            // setup the export filters
            LogFilters          filterhelper = new LogFilters(_suiteRegistry);
            frmLogFilters       frmfilters   = new frmLogFilters();
            LogFilterCollection filters      = filterhelper.GetFiltersFromRegistry();

            logger.Debug("filters: " + filters.Count);
            frmfilters.SetFilters(filters);
            if (gridControl1.DataSource != null)
            {
                DataTable dt = (DataTable)gridControl1.DataSource;

                int[] selrows = gridView1.GetSelectedRows();
                foreach (int rowhandle in selrows)
                {
                    DataRowView dv = (DataRowView)gridView1.GetRow(rowhandle);
                    if (dv != null)
                    {
                        SymbolHelper sh = new SymbolHelper();
                        sh.Varname = dv.Row["SYMBOLNAME"].ToString();
                        sh.Color   = Color.FromArgb(Convert.ToInt32(dv.Row["COLOR"]));
                        _sc.Add(sh);
                    }
                }
            }
            frmfilters.SetSymbols(_sc);
            if (frmfilters.ShowDialog() == DialogResult.OK)
            {
                DialogResult = DialogResult.None;
                filterhelper.SaveFiltersToRegistry(frmfilters.GetFilters());
            }
        }
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     :
     base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index      = idx;
 }
示例#7
0
 public LogFilterCollection GetFiltersFromRegistry()
 {
     LogFilterCollection filters = new LogFilterCollection();
     RegistryKey TempKey = null;
     TempKey = Registry.CurrentUser.CreateSubKey("Software");
     try
     {
         RegistryKey testKey = TempKey.OpenSubKey("T8SuitePro");
         using (RegistryKey Settings = TempKey.CreateSubKey("T8SuitePro\\LogFilters"))
         {
             if (Settings != null)
             {
                 string[] vals = Settings.GetSubKeyNames();
                 foreach (string a in vals)
                 {
                     try
                     {
                         LogFilter filter = LoadFilter(a);
                         filters.Add(filter);
                     }
                     catch (Exception E)
                     {
                         logger.Debug(E.Message);
                     }
                 }
             }
         }
     }
     catch (Exception E2)
     {
         logger.Debug(E2.Message);
     }
     return filters;
 }
 public void SetFilters(LogFilterCollection filters)
 {
     if (filters == null)
     {
         logger.Debug("setting filters as null");
     }
     gridControl1.DataSource = filters;
     gridView1.BestFitColumns();
 }
        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();
        }
示例#10
0
 public void SetFilters(LogFilterCollection filters)
 {
     _filters = filters;
 }
示例#11
0
 public void SetFilters(LogFilterCollection filters)
 {
     _filters = filters;
 }
 public LogFilterCollectionPropertyDescriptor(LogFilterCollection coll, int idx)
     : base("#" + idx.ToString(), null)
 {
     this.collection = coll;
     this.index = idx;
 }