/// <summary>Attach the model and view to this presenter and populate the view.</summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { dataStore = model as IDataStore; this.view = view as IDataStoreView; this.explorerPresenter = explorerPresenter; intellisense = new IntellisensePresenter(this.view as ViewBase); intellisense.ItemSelected += OnIntellisenseItemSelected; this.view.TableList.IsEditable = false; this.view.Grid.ReadOnly = true; this.view.Grid.NumericFormat = "N3"; if (dataStore != null) { this.view.TableList.Values = dataStore.Reader.TableNames.ToArray(); if (Utility.Configuration.Settings.MaximumRowsOnReportGrid > 0) { this.view.MaximumNumberRecords.Value = Utility.Configuration.Settings.MaximumRowsOnReportGrid.ToString(); } } this.view.FileName.Value = dataStore.FileName; this.view.TableList.Changed += this.OnTableSelected; this.view.ColumnFilter.Changed += OnColumnFilterChanged; this.view.ColumnFilter.IntellisenseItemsNeeded += OnIntellisenseNeeded; this.view.RowFilter.Changed += OnColumnFilterChanged; this.view.MaximumNumberRecords.Changed += OnMaximumNumberRecordsChanged; this.view.FileNameChanged += OnFileNameChanged; PopulateGrid(); }
/// <summary> /// Attach the model and view to this presenter and populate the view. /// </summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.dataStore = model as DataStore; this.dataStoreView = view as IDataStoreView; this.explorerPresenter = explorerPresenter; this.dataStoreView.AutoExport = dataStore.AutoExport; this.dataStoreView.OnTableSelected += this.OnTableSelected; this.dataStoreView.AutoExportClicked += OnAutoExportClicked; this.dataStoreView.Grid.ReadOnly = true; this.dataStoreView.Grid.NumericFormat = "N3"; this.dataStoreView.TableNames = this.GetTableNames(); }
/// <summary> /// Attach the model and view to this presenter and populate the view. /// </summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { this.dataStore = model as DataStore; this.dataStoreView = view as IDataStoreView; this.explorerPresenter = explorerPresenter; this.dataStoreView.AutoExport = dataStore.AutoExport; this.dataStoreView.OnTableSelected += this.OnTableSelected; this.dataStoreView.AutoExportClicked += OnAutoExportClicked; this.dataStoreView.Grid.ReadOnly = true; this.dataStoreView.Grid.NumericFormat = "N3"; this.dataStoreView.TableNames = this.GetTableNames(); this.dataStoreView.Grid.ResizeControls(); }
/// <summary>Attach the model and view to this presenter and populate the view.</summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { dataStore = model as DataStore; this.view = view as IDataStoreView; this.explorerPresenter = explorerPresenter; this.view.TableList.IsEditable = false; this.view.Grid.ReadOnly = true; this.view.Grid.NumericFormat = "N3"; this.view.TableList.Values = this.GetTableNames(); if (dataStore != null && dataStore.MaximumResultsPerPage > 0) this.view.MaximumNumberRecords.Value = dataStore.MaximumResultsPerPage.ToString(); this.view.Grid.ResizeControls(); this.view.TableList.Changed += this.OnTableSelected; this.view.ColumnFilter.Changed += OnColumnFilterChanged; this.view.MaximumNumberRecords.Changed += OnMaximumNumberRecordsChanged; PopulateGrid(); }
/// <summary>Attach the model and view to this presenter and populate the view.</summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { dataStore = model as DataStore; this.view = view as IDataStoreView; this.explorerPresenter = explorerPresenter; this.view.TableList.IsEditable = false; this.view.Grid.ReadOnly = true; this.view.Grid.NumericFormat = "N3"; this.view.TableList.Values = this.GetTableNames(); if (dataStore != null && dataStore.MaximumResultsPerPage > 0) { this.view.MaximumNumberRecords.Value = dataStore.MaximumResultsPerPage.ToString(); } this.view.Grid.ResizeControls(); this.view.TableList.Changed += this.OnTableSelected; this.view.ColumnFilter.Changed += OnColumnFilterChanged; this.view.MaximumNumberRecords.Changed += OnMaximumNumberRecordsChanged; PopulateGrid(); }
/// <summary>Attach the model and view to this presenter and populate the view.</summary> /// <param name="model">The data store model to work with.</param> /// <param name="view">Data store view to work with.</param> /// <param name="explorerPresenter">Parent explorer presenter.</param> public void Attach(object model, object view, ExplorerPresenter explorerPresenter) { dataStore = model as IStorageReader; this.view = view as IDataStoreView; this.explorerPresenter = explorerPresenter; this.view.TableList.IsEditable = false; this.view.Grid.ReadOnly = true; this.view.Grid.NumericFormat = "N3"; this.view.TableList.Values = dataStore.TableNames.ToArray(); if (dataStore != null && Configuration.Settings.MaximumRowsOnReportGrid > 0) { this.view.MaximumNumberRecords.Value = Configuration.Settings.MaximumRowsOnReportGrid.ToString(); } this.view.Grid.ResizeControls(); this.view.TableList.Changed += this.OnTableSelected; this.view.ColumnFilter.Changed += OnColumnFilterChanged; this.view.MaximumNumberRecords.Changed += OnMaximumNumberRecordsChanged; PopulateGrid(); }
public DataStorePresenter() { view = new DataStoreView(this); }