public virtual void SetDatabaseObject(IActivateItems activator, T databaseObject)
        {
            SetItemActivator(activator);
            Activator.RefreshBus.EstablishSelfDestructProtocol(this, activator, databaseObject);
            DatabaseObject = databaseObject;

            CommonFunctionality.ClearToolStrip();

            if (_colorIndicator == null && AssociatedCollection != RDMPCollection.None)
            {
                var colorProvider = new BackColorProvider();
                _colorIndicator           = new Control();
                _colorIndicator.Dock      = DockStyle.Top;
                _colorIndicator.Location  = new Point(0, 0);
                _colorIndicator.Size      = new Size(150, BackColorProvider.IndiciatorBarSuggestedHeight);
                _colorIndicator.TabIndex  = 0;
                _colorIndicator.BackColor = colorProvider.GetColor(AssociatedCollection);
                this.Controls.Add(this._colorIndicator);
            }

            if (_binder == null)
            {
                _binder = new BinderWithErrorProviderFactory(activator);
            }

            SetBindings(_binder, databaseObject);

            if (this is ISaveableUI)
            {
                ObjectSaverButton1.SetupFor(this, databaseObject, activator);
            }
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        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();
        }
Exemplo n.º 5
0
        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();
        }
Exemplo n.º 6
0
        private void SetupToolStrip()
        {
            CommonFunctionality.ClearToolStrip();
            CommonFunctionality.Add(new ExecuteCommandCreateNewDataExtractionProject(Activator),"Project",null,"New...");
            CommonFunctionality.Add(new ExecuteCommandCreateNewExtractionConfigurationForProject(Activator),"Extraction",null,"New...");
            CommonFunctionality.Add(new ExecuteCommandCreateNewExtractableDataSetPackage(Activator),"Package",null,"New...");
            var mi = new ToolStripMenuItem("Project Specific Catalogue",Activator.CoreIconProvider.GetImage(RDMPConcept.ProjectCatalogue,OverlayKind.Add));

            var factory = new AtomicCommandUIFactory(Activator);
            mi.DropDownItems.Add(factory.CreateMenuItem(new ExecuteCommandCreateNewCatalogueByImportingFileUI(Activator)
            {
                OverrideCommandName = "From File...",
                PromptForProject = true
            }));

            mi.DropDownItems.Add(factory.CreateMenuItem(new ExecuteCommandCreateNewCatalogueByImportingExistingDataTable(Activator)
            {
                OverrideCommandName = "From Database...",
                PromptForProject = true
            }));

            CommonFunctionality.Add(mi,"New...");
        }
Exemplo n.º 7
0
 private void SetupToolStrip()
 {
     CommonFunctionality.ClearToolStrip();
     CommonFunctionality.Add(new ExecuteCommandCreateNewCohortFromFile(Activator), GlobalStrings.FromFile, null, "New...");
     CommonFunctionality.Add(new ExecuteCommandCreateNewCohortByExecutingACohortIdentificationConfiguration(Activator), "From Query", null, "New...");
 }
Exemplo n.º 8
0
 public void BuildCommandList()
 {
     CommonFunctionality.ClearToolStrip();
     CommonFunctionality.Add(new ExecuteCommandCreateNewLoadMetadata(Activator), "New");
 }
Exemplo n.º 9
0
        public virtual void SetDatabaseObject(IActivateItems activator, T databaseObject)
        {
            SetItemActivator(activator);
            Activator.RefreshBus.EstablishSelfDestructProtocol(this, activator, databaseObject);
            DatabaseObject = databaseObject;

            CommonFunctionality.ClearToolStrip();

            if (_colorIndicator == null && AssociatedCollection != RDMPCollection.None)
            {
                var colorProvider = new BackColorProvider();
                _colorIndicator           = new Control();
                _colorIndicator.Dock      = DockStyle.Top;
                _colorIndicator.Location  = new Point(0, 0);
                _colorIndicator.Size      = new Size(150, BackColorProvider.IndiciatorBarSuggestedHeight);
                _colorIndicator.TabIndex  = 0;
                _colorIndicator.BackColor = colorProvider.GetColor(AssociatedCollection);
                this.Controls.Add(this._colorIndicator);
            }

            if (_readonlyIndicator == null)
            {
                _readonlyIndicator           = new Label();
                _readonlyIndicator.Dock      = DockStyle.Top;
                _readonlyIndicator.Location  = new Point(0, 0);
                _readonlyIndicator.Size      = new Size(150, 20);
                _readonlyIndicator.TabIndex  = 0;
                _readonlyIndicator.TextAlign = ContentAlignment.MiddleLeft;
                _readonlyIndicator.BackColor = System.Drawing.SystemColors.HotTrack;
                _readonlyIndicator.Font      = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                _readonlyIndicator.ForeColor = System.Drawing.Color.Moccasin;
            }

            if (databaseObject is IMightBeReadOnly ro)
            {
                if (ro.ShouldBeReadOnly(out string reason))
                {
                    _readonlyIndicator.Text = reason;
                    this.Controls.Add(this._readonlyIndicator);
                    ReadOnly = true;
                }
                else
                {
                    //removing it allows us to handle refreshes (where something becomes unfrozen for example)
                    this.Controls.Remove(this._readonlyIndicator);
                    ReadOnly = false;
                }
            }


            if (_binder == null)
            {
                _binder = new BinderWithErrorProviderFactory(activator);
            }

            SetBindings(_binder, databaseObject);

            if (this is ISaveableUI)
            {
                ObjectSaverButton1.SetupFor(this, databaseObject, activator);
            }
        }
        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();
        }