public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _activator = activator; _collection = (DatasetRacewayObjectCollection)collection; SetItemActivator(activator); btnAddCatalogue.Image = _activator.CoreIconProvider.GetImage(RDMPConcept.Catalogue, OverlayKind.Import); btnAddExtractableDatasetPackage.Image = _activator.CoreIconProvider.GetImage(RDMPConcept.ExtractableDataSetPackage, OverlayKind.Import); ddShowPeriod.ComboBox.SelectedItem = _collection.ShowPeriod; cbIgnoreRowCounts.Checked = _collection.IgnoreRows; UpdateIgnoreRowCountCheckBoxIconAndText(); if (isFirstTime) { isFirstTime = false; racewayRenderArea.RequestDeletion += (c) => { _collection.RemoveCatalogue(c); SaveCollectionChanges(); }; racewayRenderArea.NotifyEditModeChange(_isEditmodeOn); } CommonFunctionality.Add(btnAddCatalogue); CommonFunctionality.Add(btnAddExtractableDatasetPackage); CommonFunctionality.Add(btnRemoveAll); CommonFunctionality.Add(toolStripLabel1); CommonFunctionality.Add(ddShowPeriod); CommonFunctionality.Add(cbIgnoreRowCounts); GenerateChart(); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _bLoading = true; SetItemActivator(activator); _collection = (GoodBadCataloguePieChartObjectCollection)collection; if (firstTime) { SetupFlags(); } btnAllCatalogues.Checked = !_collection.IsSingleCatalogueMode; btnSingleCatalogue.Checked = _collection.IsSingleCatalogueMode; btnShowLabels.Checked = _collection.ShowLabels; CommonFunctionality.Add(btnAllCatalogues); CommonFunctionality.Add(toolStripLabel1); CommonFunctionality.Add(btnAllCatalogues); CommonFunctionality.Add(btnSingleCatalogue); CommonFunctionality.Add(btnShowLabels); CommonFunctionality.Add(btnRefresh); foreach (var mi in _flagOptions) { CommonFunctionality.AddToMenu(mi); } GenerateChart(); _bLoading = false; }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { SetItemActivator(activator); Collection = (SessionCollection)collection; if (!CommonTreeFunctionality.IsSetup) { CommonTreeFunctionality.SetUp(RDMPCollection.None, olvTree, activator, olvName, olvName, new RDMPCollectionCommonFunctionalitySettings() { // add custom options here }); } RefreshSessionObjects(); CommonFunctionality.ClearToolStrip(); CommonFunctionality.Add(new ToolStripButton("Add...", null, AddObjectToSession)); CommonFunctionality.Add(new ToolStripButton("Remove...", null, RemoveObjectsFromSession)); if (_firstTime) { CommonTreeFunctionality.SetupColumnTracking(olvName, new Guid("a6abe085-f5cc-4ce0-85ef-0d42e7dbfced")); _firstTime = false; } }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (CohortSummaryAggregateGraphObjectCollection)collection; SetItemActivator(activator); base.SetAggregate(activator, _collection.Graph); LoadGraphAsync(); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (FilterGraphObjectCollection)collection; SetItemActivator(activator); SetAggregate(Activator, _collection.GetGraph()); LoadGraphAsync(); }
public T Activate <T>(IPersistableObjectCollection collection) where T : Control, IObjectCollectionControl, new() { T t = new T(); _uiTests.AndLaunch(t); t.SetCollection(this, collection); return(t); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { SetItemActivator(activator); _collection = (DataLoadsGraphObjectCollection)collection; if (IsHandleCreated && !IsDisposed) { RefreshChartAsync(); } }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (IViewSQLAndResultsCollection)collection; CommonFunctionality.ClearToolStrip(); btnExecuteSql.Image = activator.CoreIconProvider.GetImage(RDMPConcept.SQL, OverlayKind.Execute); var overlayer = new IconOverlayProvider(); btnResetSql.Image = overlayer.GetOverlay(FamFamFamIcons.text_align_left, OverlayKind.Problem); if (_autoComplete == null) { _autoComplete = new AutoCompleteProviderFactory(activator).Create(_collection.GetQuerySyntaxHelper()); _collection.AdjustAutocomplete(_autoComplete); _autoComplete.RegisterForEvents(_scintilla); } SetItemActivator(activator); CommonFunctionality.Add(btnExecuteSql); CommonFunctionality.Add(btnResetSql); foreach (var c in _timeoutControls.GetControls()) { CommonFunctionality.Add(c); } foreach (DatabaseEntity d in _collection.GetToolStripObjects()) { CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, d, 0, true)); } CommonFunctionality.Add(new ToolStripSeparator()); CommonFunctionality.Add(_serverHeader); try { var dap = _collection.GetDataAccessPoint(); _serverHeader.Text = $"Server: {dap.Server} Database: {dap.Database}"; _serverHeader.Image = _databaseTypeIconProvider.GetImage(dap.DatabaseType); } catch (Exception) { _serverHeader.Text = "Server:Unknown"; } RefreshUIFromDatabase(); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (ExtractionAggregateGraphObjectCollection)collection; SetItemActivator(activator); var config = _collection.SelectedDataSets.ExtractionConfiguration; var ds = _collection.SelectedDataSets.ExtractableDataSet; Request = new ExtractDatasetCommand(config, new ExtractableDatasetBundle(ds)); Request.GenerateQueryBuilder(); SetAggregate(activator, _collection.Graph); LoadGraphAsync(); }
private bool PopExisting(Type windowType, IPersistableObjectCollection collection, out Control existingHostedControlInstance) { var existing = _windowManager.GetActiveWindowIfAnyFor(windowType, collection); existingHostedControlInstance = null; if (existing != null) { existingHostedControlInstance = existing.GetControl(); existing.Activate(); existing.HandleUserRequestingTabRefresh(this); } return(existing != null); }
public T Activate <T>(IPersistableObjectCollection collection) where T : Control, IObjectCollectionControl, new() { Control existingHostedControlInstance; if (PopExisting(typeof(T), collection, out existingHostedControlInstance)) { return((T)existingHostedControlInstance); } var uiInstance = new T(); Activate(uiInstance, collection); return(uiInstance); }
/// <summary> /// Serializes the current state settings of the IDashboardableControl into <see cref="PersistenceString"/> /// </summary> /// <param name="collection"></param> public void SaveCollectionState(IPersistableObjectCollection collection) { //save ourselves PersistenceString = collection.SaveExtraText(); SaveToDatabase(); //save our objects foreach (var o in ObjectsUsed) { o.DeleteInDatabase(); } foreach (IMapsDirectlyToDatabaseTable objectToSave in collection.DatabaseObjects) { new DashboardObjectUse((ICatalogueRepository)Repository, this, objectToSave); } }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _bLoading = true; _activator = activator; _collection = (GoodBadCataloguePieChartObjectCollection)collection; btnAllCatalogues.Image = _activator.CoreIconProvider.GetImage(RDMPConcept.CatalogueItemsNode); btnSingleCatalogue.Image = _activator.CoreIconProvider.GetImage(RDMPConcept.Catalogue, OverlayKind.Link); btnAllCatalogues.Checked = !_collection.IsSingleCatalogueMode; btnSingleCatalogue.Checked = _collection.IsSingleCatalogueMode; btnShowLabels.Checked = _collection.ShowLabels; activator.Theme.ApplyTo(toolStrip1); GenerateChart(); _bLoading = false; }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { SetItemActivator(activator); Collection = (LoadEventsTreeViewObjectCollection)collection; CommonFunctionality.ClearToolStrip(); CommonFunctionality.Add(new ToolStripLabel("Filter:")); CommonFunctionality.Add(_tbFilterBox); CommonFunctionality.Add(_btnApplyFilter); CommonFunctionality.Add(new ToolStripSeparator()); CommonFunctionality.Add(new ToolStripLabel("Fetch:")); CommonFunctionality.Add(_tbToFetch); CommonFunctionality.Add(_btnFetch); PopulateLoadHistory(); }
private bool PopExisting(Type windowType, IPersistableObjectCollection collection, out Control existingHostedControlInstance) { var existing = _windowManager.GetActiveWindowIfAnyFor(windowType, collection); existingHostedControlInstance = null; if (existing != null) { existingHostedControlInstance = existing.GetControl(); existing.Activate(); // only refresh if there are changes to some of the underlying objects if (collection.DatabaseObjects.OfType <IRevertable>().Any(r => r.HasLocalChanges().Evaluation == ChangeDescription.DatabaseCopyDifferent)) { existing.HandleUserRequestingTabRefresh(this); } } return(existing != null); }
public T Activate <T>(IPersistableObjectCollection collection) where T : Control, IObjectCollectionControl, new() { //if the window is already open if (PopExisting(typeof(T), collection, out var existingHostedControlInstance)) { //just update it's state var existing = (T)existingHostedControlInstance; existing.SetCollection(this, collection); return(existing); } var uiInstance = new T(); Activate(uiInstance, collection); return(uiInstance); }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { SetItemActivator(activator); Collection = (LoadEventsTreeViewObjectCollection)collection; RDMPCollectionCommonFunctionality.SetupColumnSortTracking(treeView1, new Guid("ccbea22e-a784-4968-a127-7c3a55b6d281")); CommonFunctionality.ClearToolStrip(); CommonFunctionality.Add(new ToolStripLabel("Filter:")); CommonFunctionality.Add(_tbFilterBox); CommonFunctionality.Add(_btnApplyFilter); CommonFunctionality.Add(new ToolStripSeparator()); CommonFunctionality.Add(new ToolStripLabel("Fetch:")); CommonFunctionality.Add(_tbToFetch); CommonFunctionality.Add(_btnFetch); PopulateLoadHistory(); }
public DeserializeInstruction ShouldCreateObjectCollection(string persistString, IRDMPPlatformRepositoryServiceLocator repositoryLocator) { if (!persistString.StartsWith(PersistableObjectCollectionDockContent.Prefix)) { return(null); } if (!persistString.Contains(PersistStringHelper.ExtraText)) { throw new PersistenceException("Persistence string did not contain '" + PersistStringHelper.ExtraText); } //Looks something like this RDMPObjectCollection:MyCoolControlUI:MyControlUIsBundleOfObjects:[CatalogueRepository:AggregateConfiguration:105,CatalogueRepository:AggregateConfiguration:102,CatalogueRepository:AggregateConfiguration:101]###EXTRA_TEXT###I've got a lovely bunch of coconuts var tokens = persistString.Split(PersistStringHelper.Separator); var uiType = GetTypeByName(tokens[1], typeof(Control), repositoryLocator); var collectionType = GetTypeByName(tokens[2], typeof(IPersistableObjectCollection), repositoryLocator); ObjectConstructor objectConstructor = new ObjectConstructor(); IPersistableObjectCollection collectionInstance = (IPersistableObjectCollection)objectConstructor.Construct(collectionType); if (collectionInstance.DatabaseObjects == null) { throw new PersistenceException("Constructor of Type '" + collectionType + "' did not initialise property DatabaseObjects"); } var allObjectsString = _persistStringHelper.MatchCollectionInString(persistString); collectionInstance.DatabaseObjects.AddRange(_persistStringHelper.GetObjectCollectionFromPersistString(allObjectsString, repositoryLocator)); var extraText = _persistStringHelper.GetExtraText(persistString); collectionInstance.LoadExtraText(extraText); return(new DeserializeInstruction(uiType, collectionInstance)); }
public T Activate <T>(IPersistableObjectCollection collection) where T : Control, IObjectCollectionControl, new() { throw new NotImplementedException(); }
public PersistableObjectCollectionDockContent(IActivateItems activator, IObjectCollectionControl control, IPersistableObjectCollection collection) : base(activator.RefreshBus) { _control = control; Control = (Control)control; //tell the control what it's collection is control.SetCollection(activator, collection); //ask the control what it wants its name to be TabText = _control.GetTabName(); }
public PersistableObjectCollectionDockContent Create(IActivateItems activator, IObjectCollectionControl control, IPersistableObjectCollection objectCollection, Bitmap image) { //create a new persistable docking tab var content = new PersistableObjectCollectionDockContent(activator,control,objectCollection); //add the control to the tab AddControlToDockContent(activator,(Control)control, content,content.TabText, image); //add to the window tracker _windowManager.AddWindow(content); //return the tab return content; }
public PersistableObjectCollectionDockContent GetActiveWindowIfAnyFor(Type windowType, IPersistableObjectCollection collection) { return(_trackedWindows.OfType <PersistableObjectCollectionDockContent>().SingleOrDefault(t => t.GetControl().GetType() == windowType && t.Collection.Equals(collection))); }
public PersistableObjectCollectionDockContent Activate(IObjectCollectionControl collectionControl, IPersistableObjectCollection objectCollection) { var floatable = WindowFactory.Create(this, collectionControl, objectCollection, null); floatable.Show(_mainDockPanel, DockState.Document); return(floatable); }
public DeserializeInstruction(Type uiControlType, IPersistableObjectCollection objectCollection) { UIControlType = uiControlType; ObjectCollection = objectCollection; }
public void SetCollection(IActivateItems activator, IPersistableObjectCollection collection) { _collection = (IViewSQLAndResultsCollection)collection; CommonFunctionality.ClearToolStrip(); btnExecuteSql.Image = activator.CoreIconProvider.GetImage(RDMPConcept.SQL, OverlayKind.Execute); var overlayer = new IconOverlayProvider(); btnResetSql.Image = overlayer.GetOverlay(FamFamFamIcons.text_align_left, OverlayKind.Problem); if (_scintilla == null) { // figure out what DBMS we are targetting var syntax = _collection.GetQuerySyntaxHelper(); // Create the SQL editor for that language ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory(); _scintilla = factory.Create(null, SyntaxLanguage.SQL, syntax); splitContainer1.Panel1.Controls.Add(_scintilla); _scintilla.TextChanged += _scintilla_TextChanged; _scintilla.KeyUp += ScintillaOnKeyUp; // Setup autocomplete menu for the DBMS language _autoComplete = new AutoCompleteProviderWin(syntax); _collection.AdjustAutocomplete(_autoComplete); _autoComplete.RegisterForEvents(_scintilla); } SetItemActivator(activator); CommonFunctionality.Add(btnExecuteSql); CommonFunctionality.Add(btnResetSql); foreach (var c in _timeoutControls.GetControls()) { CommonFunctionality.Add(c); } foreach (DatabaseEntity d in _collection.GetToolStripObjects()) { CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, d, 0, true)); } CommonFunctionality.Add(new ToolStripSeparator()); CommonFunctionality.Add(_serverHeader); try { var dap = _collection.GetDataAccessPoint(); _serverHeader.Text = $"Server: {dap.Server} Database: {dap.Database}"; _serverHeader.Image = _databaseTypeIconProvider.GetImage(dap.DatabaseType); } catch (Exception) { _serverHeader.Text = "Server:Unknown"; } RefreshUIFromDatabase(); }