示例#1
0
 public void Remove(HostConfigElement details)
 {
     if (BaseIndexOf(details) >= 0)
     {
         BaseRemove(details.SSHServerHostname);
     }
 }
示例#2
0
            public HostCollection()
            {
                HostConfigElement details = (HostConfigElement)CreateNewElement();

                if (!string.IsNullOrEmpty(details.SSHServerHostname))
                {
                    Add(details);
                }
            }
示例#3
0
        public HostCollection()
        {
            HostConfigElement details = (HostConfigElement)this.CreateNewElement();

            if (details.SSHServerHostname != string.Empty)
            {
                this.Add(details);
            }
        }
示例#4
0
 public void ConfigureHost(HostConfigElement config)
 {
     this.Hostname = config.SSHServerHostname;
     this.UserName = config.Username;
     this.Password = config.Password;
     this.Port     = config.SSHPort;
     this._config  = config;
     InitDisplay();
 }
示例#5
0
 public void Add(HostConfigElement details)
 {
     BaseAdd(details);
 }
示例#6
0
 public int IndexOf(HostConfigElement details)
 {
     return(BaseIndexOf(details));
 }
示例#7
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( ));
        }