예제 #1
0
 public void Remove(DataStoreElement details)
 {
     if (BaseIndexOf(details) >= 0)
     {
         BaseRemove(details.Name);
     }
 }
예제 #2
0
        public DataStoreCollection()
        {
            DataStoreElement details = (DataStoreElement)CreateNewElement( );

            if (details.Name != "")
            {
                Add(details);
            }
        }
예제 #3
0
        static void Main()
        {
            try
            {
                DataPhilosophiaeSection dps = cm.GetSection("DataPhilosophiaeSection") as DataPhilosophiaeSection;
                if (dps != null)
                {
                    System.Console.WriteLine(dps.Stage.PathDir);
                    foreach (DataStoreElement ds in dps.DataStores)
                    {
                        System.Console.WriteLine(ds.Name);
                        System.Console.WriteLine(ds.LoadDefaultDatabaseOnly);
                        System.Console.WriteLine(ds.LoadSystemObjects);
                        System.Console.WriteLine(ds.WithFields);
                        if (string.IsNullOrWhiteSpace(ds.PathDir))
                        {
                            ds.PathDir = System.IO.Path.Combine(dps.Stage.PathDir, ds.Name);
                            cm.Save(System.Configuration.ConfigurationSaveMode.Minimal, true);
                        }
                        System.Console.WriteLine(ds.PathDir);
                    }
                }
                //DataStoreElement dse = new DataStoreElement(  );
                //cm.Save( System.Configuration.ConfigurationSaveMode.Minimal, false );
            }
            catch (System.Configuration.ConfigurationErrorsException ex)
            {
                System.Console.WriteLine(ex.Message);
            }
            try
            {
                System.Configuration.ConnectionStringSettingsCollection settings = System.Configuration.ConfigurationManager.ConnectionStrings;
                if (settings != null)
                {
                    foreach (System.Configuration.ConnectionStringSettings cs in settings)
                    {
                        System.Console.WriteLine("            Name:" + cs.Name);
                        System.Console.WriteLine("    ProviderName:" + cs.ProviderName);
                        System.Console.WriteLine("ConnectionString:" + cs.ConnectionString);
                    }
                }
            }
            catch (System.Configuration.ConfigurationErrorsException ex)
            {
                System.Console.WriteLine(ex.Message);
            }
            {
                DataPhilosophiaeSection dps = cm.GetSection("DataPhilosophiaeSection") as DataPhilosophiaeSection;
                DataStoreElement        ds  = dps.DataStores[0];
                System.Configuration.ConnectionStringSettingsCollection settings = System.Configuration.ConfigurationManager.ConnectionStrings;
                System.Configuration.ConnectionStringSettings           cs       = settings[ds.ConnectionStringName];
                //

                ActiveQueryBuilder.Core.SyntaxProviderList syntaxProviderList = new ActiveQueryBuilder.Core.SyntaxProviderList( );
                ActiveQueryBuilder.Core.SQLContext         sc = new ActiveQueryBuilder.Core.SQLContext( )
                {
                    SyntaxProvider   = new ActiveQueryBuilder.Core.AutoSyntaxProvider( ),
                    MetadataProvider = new ActiveQueryBuilder.Core.OLEDBMetadataProvider
                    {
                        Connection = new System.Data.OleDb.OleDbConnection( )
                        {
                            ConnectionString = cs.ConnectionString
                        }
                    }
                };
            }
            {
                DataPhilosophiaeSection dps = cm.GetSection("DataPhilosophiaeSection") as DataPhilosophiaeSection;
                DataStoreElement        ds  = dps.DataStores[0];
                System.Configuration.ConnectionStringSettingsCollection settings = System.Configuration.ConfigurationManager.ConnectionStrings;
                System.Configuration.ConnectionStringSettings           cs       = settings[ds.ConnectionStringName];
                //
                ActiveQueryBuilder.Core.SyntaxProviderList syntaxProviderList = new ActiveQueryBuilder.Core.SyntaxProviderList( );
                ActiveQueryBuilder.Core.SQLContext         sc = new ActiveQueryBuilder.Core.SQLContext( )
                {
                    SyntaxProvider   = new ActiveQueryBuilder.Core.SQLiteSyntaxProvider( ),
                    MetadataProvider = new ActiveQueryBuilder.Core.SQLiteMetadataProvider( )
                    {
                        Connection = new System.Data.SQLite.SQLiteConnection( )
                        {
                            ConnectionString = cs.ConnectionString
                        }
                    }
                };
                ActiveQueryBuilder.Core.MetadataLoadingOptions loadingOptions = sc.MetadataContainer.LoadingOptions;
                loadingOptions.LoadDefaultDatabaseOnly = ds.LoadDefaultDatabaseOnly == 1 ? true : false;
                loadingOptions.LoadSystemObjects       = ds.LoadSystemObjects == 1 ? true : false;
                //loadingOptions.IncludeFilter.Types = MetadataType.Field;
                //loadingOptions.ExcludeFilter.Schemas.Add(“dbo”);
                sc.MetadataContainer.LoadAll(ds.WithFields == 1 ? true : false);
            }

            //TunnelSection ts = System.Configuration.ConfigurationManager.GetSection( "TunnelSection" ) as TunnelSection;
            TunnelSection       ts                = cm.GetSection("TunnelSection") as TunnelSection;
            int                 count1            = ts.Tunnels.Count;
            HostConfigElement   hc                = ts.Tunnels[0];
            string              sSHServerHostname = hc.SSHServerHostname;
            string              username          = hc.Username;
            TunnelCollection    tunnels           = hc.Tunnels;
            int                 count2            = tunnels.Count;
            TunnelConfigElement tce               = tunnels[0];
            string              name              = tce.Name;
            int                 localPort         = tce.LocalPort;

            //ProductSettings productSettings = System.Configuration.ConfigurationManager.GetSection( "ProductSettings" ) as ProductSettings;
            //ConfigurationClassLoader x = System.Configuration.ConfigurationManager.GetSection( "Plugins" ) as ConfigurationClassLoader;

            //
            System.Configuration.ConfigurationSectionGroup      a        = cm.GetSectionGroup("DataStoreGroup");
            System.Configuration.ConfigurationSectionCollection sections = a.Sections;
            int count = sections.Count;

            System.Configuration.ConfigurationSection get = sections.Get(0);

            //         NewMethod( );
            //
            System.Windows.Forms.Application.EnableVisualStyles( );
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            System.Windows.Forms.Application.Run(new Form1( ));
        }
예제 #4
0
 public void Add(DataStoreElement details)
 {
     BaseAdd(details);
 }
예제 #5
0
 public int IndexOf(DataStoreElement details)
 {
     return(BaseIndexOf(details));
 }