Пример #1
0
 /// <summary>Initializes the query with the reference to the browser tree</summary>
 /// <param name="Browser">ViewModel of the browser tree</param>
 public QueryViewModel(ref ServerBrowserViewModel Browser)
 {
     _dab = DataAccessFactory.GetDataAccess(
         Browser.ActiveConnection.ConnectionType,
         Browser.ActiveConnection.DataSource,
         Browser.ActiveConnection.SelectedDatabase,
         Browser.ActiveConnection.Authentication,
         Browser.ActiveConnection.Username,
         Browser.ActiveConnection.Password
         );
     _dab.BuildKeywords();
     _browser = Browser;
 }
Пример #2
0
        /// <summary>Initializes the tab</summary>
        /// <param name="Browser">BrowserViewModel to use</param>
        public QueryView(ref ServerBrowserViewModel Browser)
        {
            InitializeComponent();
            _queryViewModel = new QueryViewModel(ref Browser);
            this.dgResults.DataBindings.Add("DataSource", _queryViewModel.Results, "Data");
            this.tbMessages.DataBindings.Add("Text", _queryViewModel.Results, "Messages");
            this.Name = Guid.NewGuid().ToString();

            _queryViewModel.BeginQuery += this.BeginQuery;
            _queryViewModel.EndQuery += this.EndQuery;

            _bgWorker.WorkerReportsProgress = true;
            _bgWorker.WorkerSupportsCancellation = true;
            _bgWorker.DoWork += this.TimeQuery;
            _bgWorker.ProgressChanged += (s, e) => { this.BeginInvoke(new UpdatingTimer(this.UpdateTimer), new object[] { s, e }); };
        }
Пример #3
0
 /// <summary>Creates the query</summary>
 /// <param name="Dab">Data Access object to run the queries</param>
 /// <param name="Browser">Server tree from the active browser</param>
 public DataAccessQuery(DataAccessBase Dab, ref ServerBrowserViewModel Browser)
 {
     _dab = Dab;
     _browser = Browser;
 }
Пример #4
0
 /// <summary>Creates the instance of the model</summary>
 /// <param name="ViewModel">The ViewModel that initializes it</param>
 public ServerBrowserModel(ServerBrowserViewModel ViewModel)
 {
     _cache = new Dictionary<string, List<BaseItem>>();
     _viewModel = ViewModel;
 }
Пример #5
0
 /// <summary>Adds all the event handlers and states of the browser</summary>
 private void InitializeServerBrowser()
 {
     _browserViewModel = new ServerBrowserViewModel();
     this.treeViewAdv1.Model = _browserViewModel.Tree;
 }