Beispiel #1
0
        //constructor
        public ServerDatabaseTableSelector()
        {
            InitializeComponent();

            if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
            {
                return;
            }

            _workerRefreshDatabases.DoWork += UpdateDatabaseListAsync;
            _workerRefreshDatabases.WorkerSupportsCancellation = true;
            _workerRefreshDatabases.RunWorkerCompleted        += UpdateDatabaseAsyncCompleted;

            _workerRefreshTables.DoWork += UpdateTablesListAsync;
            _workerRefreshTables.WorkerSupportsCancellation = true;
            _workerRefreshTables.RunWorkerCompleted        += UpdateTablesAsyncCompleted;

            var r = new RecentHistoryOfControls(cbxServer, new Guid("01ccc304-0686-4145-86a5-cc0468d40027"));

            r.AddHistoryAsItemsToComboBox(cbxServer);

            var r2 = new RecentHistoryOfControls(cbxDatabase, new Guid("e1a4e7a8-3f7a-4018-8ff5-2fd661ee06a3"));

            r2.AddHistoryAsItemsToComboBox(cbxDatabase);

            _helper = DatabaseCommandHelper.For(DatabaseType);
        }
Beispiel #2
0
        public void TestOverflowPrevention()
        {
            var t = new System.Windows.Forms.TextBox();

            var c = new RecentHistoryOfControls(t, new Guid("b3ccaf14-702a-438a-8cf4-d550d6d7775d"));

            c.Clear();
            int overFlowCounter = 100000;

            for (int i = 0; i < overFlowCounter; i++)
            {
                c.AddResult("testOverflowValue" + Guid.NewGuid(), i % 1000 == 0);//only save every X values added for performance
            }
            c.Clear();
        }