Ejemplo n.º 1
0
        public PluginProcessTaskUI()
        {
            InitializeComponent();
            AssociatedCollection = RDMPCollection.DataLoad;

            _ragSmiley = new RAGSmileyToolStrip(this);
        }
        public RDMPControlCommonFunctionality(IRDMPControl hostControl)
        {
            _hostControl = hostControl;
            ToolStrip    = new ToolStrip();

            ToolStrip.Location = new Point(0, 0);
            ToolStrip.TabIndex = 1;

            //Add the three lines dropdown for seldom used options (See AddToMenu). This starts disabled.
            _menuDropDown         = new ToolStripMenuItem();
            _menuDropDown.Image   = CatalogueIcons.Menu;
            _menuDropDown.Enabled = false;
            ToolStrip.Items.Add(_menuDropDown);

            _ragSmileyToolStrip = new RAGSmileyToolStrip((Control)_hostControl);
            ToolStrip.Items.Add(_ragSmileyToolStrip);

            _runChecksToolStripButton.Click += (s, e) => StartChecking();
            ToolStrip.Items.Add(_runChecksToolStripButton);

            _ragSmileyToolStrip.Enabled       = false;
            _ragSmileyToolStrip.Visible       = false;
            _runChecksToolStripButton.Enabled = false;
            _runChecksToolStripButton.Visible = false;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds check buttons to the tool strip and sets up <see cref="StartChecking"/> to target <paramref name="checkable"/>.
        /// </summary>
        /// <param name="checkable"></param>
        public void AddChecks(ICheckable checkable)
        {
            if (_ragSmileyToolStrip == null)
            {
                _ragSmileyToolStrip = new RAGSmileyToolStrip((Control)_hostControl);
            }

            Add(_ragSmileyToolStrip);
            Add(_runChecksToolStripButton);
            _checkable = checkable;
        }
Ejemplo n.º 4
0
        public ExtractionInformationUI()//For use with SetDatabaseObject
        {
            InitializeComponent();

            if (VisualStudioDesignMode) //stop right here if in designer mode
            {
                return;
            }

            //note that we don't add the Any category
            ddExtractionCategory.DataSource = new object[] { ExtractionCategory.Core, ExtractionCategory.Supplemental, ExtractionCategory.SpecialApprovalRequired, ExtractionCategory.Internal, ExtractionCategory.Deprecated, ExtractionCategory.ProjectSpecific };

            ObjectSaverButton1.BeforeSave += BeforeSave;

            AssociatedCollection = RDMPCollection.Catalogue;

            ragSmiley1 = new RAGSmileyToolStrip(this);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Reports the supplied exception in the RAG checks smiley on the top toolbar.  This will result in rag checks becomming
        /// visible if it was not visible before.
        /// </summary>
        /// <param name="s"></param>
        /// <param name="exception"></param>
        public void Fatal(string s, Exception exception)
        {
            var args = new CheckEventArgs(s, CheckResult.Fail, exception);

            if (OnFatal != null)
            {
                OnFatal(this, args);
            }

            if (_ragSmileyToolStrip == null)
            {
                _ragSmileyToolStrip = new RAGSmileyToolStrip((Control)_hostControl);
            }

            if (_ragSmileyToolStrip.GetCurrentParent() == null)
            {
                Add(_ragSmileyToolStrip);
            }

            _ragSmileyToolStrip.OnCheckPerformed(args);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Adds check buttons to the tool strip and sets up <see cref="StartChecking"/> to target the return value of <paramref name="checkableFunc"/>.  If the method throws the
        /// Exception will be exposed in the checking system.
        ///
        /// <para>Only use this method if there is a reasonable chance the <paramref name="checkableFunc"/> will crash otherwise use the normal overload</para>
        /// </summary>
        /// <param name="checkableFunc"></param>
        public void AddChecks(Func <ICheckable> checkableFunc)
        {
            if (_ragSmileyToolStrip == null)
            {
                _ragSmileyToolStrip = new RAGSmileyToolStrip((Control)_hostControl);
            }

            Add(_ragSmileyToolStrip);
            Add(_runChecksToolStripButton);

            try
            {
                _checkable = checkableFunc();
            }
            catch (Exception e)
            {
                //covers the case where you have previously passed checks then fail but _checks points to the old passing one
                _checkable = null;
                _ragSmileyToolStrip.Fatal(e);
            }
        }
Ejemplo n.º 7
0
 public BeforeCheckingEventArgs(RAGSmileyToolStrip checkNotifier, ICheckable checkable)
 {
     Checkable     = checkable;
     CheckNotifier = checkNotifier;
 }