Exemplo n.º 1
0
        public override void SetDatabaseObject(IActivateItems activator, CatalogueItem databaseObject)
        {
            _catalogueItem = databaseObject;

            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription      = f.Create(null, null, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font = System.Drawing.SystemFonts.DefaultFont;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);


            if (_catalogueItem.ExtractionInformation != null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandActivate(activator, _catalogueItem.ExtractionInformation), "Go To Extraction Information");
            }
            else
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandMakeCatalogueItemExtractable(activator, _catalogueItem), "Make Extractable");
            }

            if (_catalogueItem.ColumnInfo_ID != null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandShow(activator, _catalogueItem.ColumnInfo, 0, true));
            }
        }
Exemplo n.º 2
0
        public ExtractableCohortUI()
        {
            InitializeComponent();

            if (VisualStudioDesignMode) //dont add the QueryEditor if we are in design time (visual studio) because it breaks
            {
                return;
            }

            auditLogEditor = new ScintillaTextEditorFactory().Create(new RDMPCombineableFactory(), SyntaxLanguage.LogFile);
            pDescription.Controls.Add(auditLogEditor);
            auditLogEditor.TextChanged += AuditLogEditorOnTextChanged;

            QueryPreview          = new ScintillaTextEditorFactory().Create();
            QueryPreview.ReadOnly = true;

            AssociatedCollection = RDMPCollection.SavedCohorts;

            helpIcon1.SetHelpText("Override Release Identifier", "Not Recommended.  Setting this lets you change which release identifier column is extracted (for this cohort only).");

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvCohortUsage, olvUsedIn, new Guid("0c402777-2c70-486a-adb3-32b6f2fbfe80"));

            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvPreviousVersions, olvOtherVersions, new Guid("4e753b4a-9989-4bf0-b2d4-7462e68b2fa3"));
            RDMPCollectionCommonFunctionality.SetupColumnTracking(tlvPreviousVersions, olvVersion, new Guid("a5b4573f-5aad-456d-a431-d63d69e46e47"));
        }
Exemplo n.º 3
0
        private void LoadFile()
        {
            _bLoading = true;
            try
            {
                if (_scintilla == null)
                {
                    ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory();
                    _scintilla = factory.Create(new RDMPCombineableFactory());
                    groupBox1.Controls.Add(_scintilla);
                    _scintilla.SavePointLeft      += ScintillaOnSavePointLeft;
                    ObjectSaverButton1.BeforeSave += objectSaverButton1_BeforeSave;
                }

                SetupAutocomplete();

                try
                {
                    _scintilla.Text = File.ReadAllText(_processTask.Path);
                    _scintilla.SetSavePoint();
                }
                catch (Exception e)
                {
                    CommonFunctionality.Fatal("Could not open file " + _processTask.Path, e);
                }
            }
            finally
            {
                _bLoading = false;
            }
        }
Exemplo n.º 4
0
        public override void SetDatabaseObject(IActivateItems activator, Lookup databaseObject)
        {
            base.SetDatabaseObject(activator, databaseObject);

            _keyColumn         = databaseObject.PrimaryKey;
            _descriptionColumn = databaseObject.Description;
            _tableInfo         = _keyColumn.TableInfo;

            lblCode.Text        = _keyColumn.GetRuntimeName();
            lblDescription.Text = _descriptionColumn.GetRuntimeName();

            ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory();

            _scintilla = factory.Create();

            gbScintilla.Controls.Add(_scintilla);

            try
            {
                SendQuery();
            }
            catch (System.Exception ex)
            {
                CommonFunctionality.Fatal("Could not connect to database", ex);
            }
        }
        public GenerateClassCodeFromTableUI()
        {
            InitializeComponent();

            var factory = new ScintillaTextEditorFactory();

            _codeEditor          = factory.Create(null, SyntaxLanguage.CSharp);
            _codeEditor.ReadOnly = false;
            panel1.Controls.Add(_codeEditor);
        }
        public ViewCohortIdentificationConfigurationUI()
        {
            InitializeComponent();

            var factory = new ScintillaTextEditorFactory();

            QueryEditor = factory.Create(new RDMPCommandFactory());
            this.Controls.Add(QueryEditor);

            AssociatedCollection = RDMPCollection.Cohort;
        }
Exemplo n.º 7
0
        public TypeTextOrCancelDialog(DialogArgs args, int maxCharacters, string startingTextForInputBox = null, bool allowBlankText = false, bool multiLine = false)
        {
            _allowBlankText = allowBlankText;
            _multiline      = multiLine;

            InitializeComponent();

            var header = args.WindowTitle;


            if (header != null && header.Length > WideMessageBox.MAX_LENGTH_TITLE)
            {
                header = header.Substring(0, WideMessageBox.MAX_LENGTH_TITLE);
            }

            taskDescriptionLabel1.SetupFor(args);

            this.Text = header;
            this.textBox1.MaxLength = maxCharacters;

            if (_multiline)
            {
                var editor = new ScintillaTextEditorFactory();
                _scintilla              = editor.Create(null, SyntaxLanguage.None, null, true, false);
                _scintilla.Dock         = DockStyle.Fill;
                _scintilla.TextChanged += _scintilla_TextChanged;
                _scintilla.KeyDown     += _scintilla_KeyDown;
                _scintilla.Text         = startingTextForInputBox;
                _scintilla.WrapMode     = WrapMode.Word;

                pTextEditor.Controls.Remove(textBox1);
                pTextEditor.Controls.Add(_scintilla);

                //Move cursor to the end of the textbox
                this.ActiveControl        = _scintilla;
                _scintilla.SelectionStart = _scintilla.TextLength;

                this.textBox1.Anchor     = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
                this.textBox1.ScrollBars = ScrollBars.Vertical;
                this.Width = 740;

                //Update the tooltip for the OK button
                toolTip.SetToolTip(btnOk, "Press to Save (SHIFT + ENTER)");
            }
            else
            {
                textBox1.Text = startingTextForInputBox;
                Width         = Math.Max(540, Math.Min(740, taskDescriptionLabel1.PreferredWidth));

                this.ActiveControl = textBox1;
            }

            SetEnabledness();
        }
Exemplo n.º 8
0
        public TagElevationXmlUI()
        {
            InitializeComponent();

            btnOk.Click     += Btn_Click;
            btnCancel.Click += Btn_Click;

            var factory = new ScintillaTextEditorFactory();

            queryEditor = factory.Create(null, "xml");
            pEditor.Controls.Add(queryEditor);


            var autoComplete = new AutocompleteMenu();

            autoComplete.ImageList = new ImageList();
            autoComplete.ImageList.Images.Add(CatalogueIcons.File);
            autoComplete.MaximumSize = new System.Drawing.Size(300, 500);

            autoComplete.AddItem(new SubstringAutocompleteItem("TagElevationRequest")
            {
                ImageIndex = 0
            });
            autoComplete.AddItem(new SubstringAutocompleteItem("ColumnName")
            {
                ImageIndex = 0
            });
            autoComplete.AddItem(new SubstringAutocompleteItem("ElevationPathway")
            {
                ImageIndex = 0
            });
            autoComplete.AddItem(new SubstringAutocompleteItem("Conditional")
            {
                ImageIndex = 0
            });
            autoComplete.AddItem(new SubstringAutocompleteItem("ConditionalPathway")
            {
                ImageIndex = 0
            });
            autoComplete.AddItem(new SubstringAutocompleteItem("ConditionalRegex")
            {
                ImageIndex = 0
            });

            foreach (string keyword in DicomDictionary.Default.Select(e => e.Keyword).Distinct())
            {
                autoComplete.AddItem(new SubstringAutocompleteItem(keyword));
            }

            autoComplete.TargetControlWrapper = new ScintillaWrapper(queryEditor);

            btnRunChecks.Click += (s, e) => RunChecks();
        }
Exemplo n.º 9
0
        public TagElevationXmlUI()
        {
            InitializeComponent();

            btnOk.Click     += Btn_Click;
            btnCancel.Click += Btn_Click;

            var factory = new ScintillaTextEditorFactory();

            queryEditor = factory.Create(null, "xml");
            pEditor.Controls.Add(queryEditor);

            btnRunChecks.Click += (s, e) => RunChecks();
        }
Exemplo n.º 10
0
        public ViewSQLAndResultsWithDataGridUI()
        {
            InitializeComponent();

            ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory();

            _scintilla = factory.Create();
            splitContainer1.Panel1.Controls.Add(_scintilla);
            _scintilla.TextChanged += _scintilla_TextChanged;
            _scintilla.KeyUp       += ScintillaOnKeyUp;
            DoTransparencyProperly.ThisHoversOver(ragSmiley1, dataGridView1);

            btnExecuteSql.Click += (s, e) => RunQuery();
            btnResetSql.Click   += btnResetSql_Click;

            dataGridView1.CellDoubleClick += dataGridView1_CellDoubleClick;
        }
Exemplo n.º 11
0
        public override void SetDatabaseObject(IActivateItems activator, Catalogue databaseObject)
        {
            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription          = f.Create(null, SyntaxLanguage.None, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font     = System.Drawing.SystemFonts.DefaultFont;
                _scintillaDescription.WrapMode = WrapMode.Word;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);

            _catalogue = databaseObject;

            RefreshUIFromDatabase();
        }
Exemplo n.º 12
0
        public ViewSQLAndResultsWithDataGridUI()
        {
            InitializeComponent();

            ScintillaTextEditorFactory factory = new ScintillaTextEditorFactory();

            _scintilla = factory.Create();
            splitContainer1.Panel1.Controls.Add(_scintilla);
            _scintilla.TextChanged += _scintilla_TextChanged;
            _scintilla.KeyUp       += ScintillaOnKeyUp;

            btnExecuteSql.Click += (s, e) => RunQuery();
            btnResetSql.Click   += btnResetSql_Click;

            dataGridView1.CellDoubleClick += dataGridView1_CellDoubleClick;

            _serverHeader             = new ToolStripLabel("Server:");
            _databaseTypeIconProvider = new DatabaseTypeIconProvider();
        }
Exemplo n.º 13
0
        public AggregateGraphUI()
        {
            InitializeComponent();

            llCancel.Visible = false;

            #region Query Editor setup

            if (VisualStudioDesignMode)
            {
                return;
            }

            QueryEditor = new ScintillaTextEditorFactory().Create();

            QueryEditor.Text = "/*Graph load has not been attempted yet, wait till the system calls LoadGraphAsync() or LoadGraph()*/";

            QueryEditor.ReadOnly = true;

            tpCode.Controls.Add(QueryEditor);
            #endregion QueryEditor

            SetToolbarButtonsEnabled(true);


            Timeout = 300;

            miCopyToClipboard.DropDownItems.Add(miClipboardWord);
            miCopyToClipboard.DropDownItems.Add(miClipboardCsv);

            miClipboardWord.Click      += ClipboardClick;
            miClipboardWord.ToolTipText = "Copies data as HTML formatted (for pasting into Word / Excel etc)";
            miClipboardCsv.Click       += ClipboardClick;
            miClipboardCsv.ToolTipText  = "Copies data as CSV formatted";

            btnResendQuery.Click += btnResendQuery_Click;
            miSaveImages.Click   += MiSaveImagesClick;
            btnCache.Click       += btnCache_Click;


            btnCache.Enabled = false;
        }
Exemplo n.º 14
0
        public ExtractableCohortUI()
        {
            InitializeComponent();

            if (VisualStudioDesignMode) //dont add the QueryEditor if we are in design time (visual studio) because it breaks
            {
                return;
            }

            auditLogEditor = new ScintillaTextEditorFactory().Create(new RDMPCommandFactory());
            pDescription.Controls.Add(auditLogEditor);
            auditLogEditor.TextChanged += AuditLogEditorOnTextChanged;

            QueryPreview          = new ScintillaTextEditorFactory().Create();
            QueryPreview.ReadOnly = true;

            AssociatedCollection = RDMPCollection.SavedCohorts;

            helpIcon1.SetHelpText("Override Release Identifier", "Not Recommended.  Setting this lets you change which release identifier column is extracted (for this cohort only).");
        }
Exemplo n.º 15
0
        public override void SetDatabaseObject(IActivateItems activator, CatalogueItem databaseObject)
        {
            _catalogueItem = databaseObject;

            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription          = f.Create(null, SyntaxLanguage.None, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font     = System.Drawing.SystemFonts.DefaultFont;
                _scintillaDescription.WrapMode = WrapMode.Word;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);


            if (_catalogueItem.ExtractionInformation == null)
            {
                CommonFunctionality.AddToMenu(new ExecuteCommandMakeCatalogueItemExtractable(activator, _catalogueItem), "Make Extractable");
            }
        }
Exemplo n.º 16
0
        public override void SetDatabaseObject(IActivateItems activator, Catalogue databaseObject)
        {
            if (_scintillaDescription == null)
            {
                var f = new ScintillaTextEditorFactory();
                _scintillaDescription      = f.Create(null, null, null, true, false, activator.CurrentDirectory);
                _scintillaDescription.Font = System.Drawing.SystemFonts.DefaultFont;
                panel1.Controls.Add(_scintillaDescription);
            }

            base.SetDatabaseObject(activator, databaseObject);

            _catalogue = databaseObject;

            CommonFunctionality.AddHelp(tbFolder, "CatalogueFolder");

            CommonFunctionality.AddHelp(cbDeprecated, "IMightBeDeprecated.IsDeprecated");
            CommonFunctionality.AddHelp(cbColdStorage, "ICatalogue.IsColdStorageDataset");
            CommonFunctionality.AddHelp(cbInternal, "ICatalogue.IsInternalDataset");


            RefreshUIFromDatabase();
        }
        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();
        }