public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     TypeConverter.StandardValuesCollection valuess = this._standardValues;
     if (this._standardValues == null)
     {
         DataTable     elements = new OleDbEnumerator().GetElements();
         DataColumn    column2  = elements.Columns["SOURCES_NAME"];
         DataColumn    column   = elements.Columns["SOURCES_TYPE"];
         List <string> values   = new List <string>(elements.Rows.Count);
         foreach (DataRow row in elements.Rows)
         {
             int num = (int)row[column];
             if ((1 == num) || (3 == num))
             {
                 string item = (string)row[column2];
                 if (!OleDbConnectionString.IsMSDASQL(item.ToLower(CultureInfo.InvariantCulture)) && (0 > values.IndexOf(item)))
                 {
                     values.Add(item);
                 }
             }
         }
         valuess = new TypeConverter.StandardValuesCollection(values);
         this._standardValues = valuess;
     }
     return(valuess);
 }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);



            var oledb12Installed = new System.Data.OleDb.OleDbEnumerator()
                                   .GetElements().AsEnumerable()
                                   .Any(x => x.Field <string>("SOURCES_NAME") ==
                                        "Microsoft.ACE.OLEDB.12.0");

            //MessageBox.Show(oledb12Installed.ToString());
            CreateEmployerFolder();
            Application.Run(new Form1());
        }
 public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
 {
     TypeConverter.StandardValuesCollection valuess = this._standardValues;
     if (this._standardValues == null)
     {
         DataTable elements = new OleDbEnumerator().GetElements();
         DataColumn column2 = elements.Columns["SOURCES_NAME"];
         DataColumn column = elements.Columns["SOURCES_TYPE"];
         List<string> values = new List<string>(elements.Rows.Count);
         foreach (DataRow row in elements.Rows)
         {
             int num = (int) row[column];
             if ((1 == num) || (3 == num))
             {
                 string item = (string) row[column2];
                 if (!OleDbConnectionString.IsMSDASQL(item.ToLower(CultureInfo.InvariantCulture)) && (0 > values.IndexOf(item)))
                 {
                     values.Add(item);
                 }
             }
         }
         valuess = new TypeConverter.StandardValuesCollection(values);
         this._standardValues = valuess;
     }
     return valuess;
 }