Esempio n. 1
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                testBrowserTreeView.RefreshModel(modelElement);
                Refresh();
            }

            if (testDescriptionTimeLineControl.ShouldDisplayModelElement(modelElement))
            {
                testDescriptionTimeLineControl.Refresh();
            }
            if (testExecutionTimeLineControl.ShouldDisplayModelElement(modelElement))
            {
                testExecutionTimeLineControl.Refresh();
            }

            if (changeKind == Context.ChangeKind.EndOfCycle)
            {
                tabControl1.SelectedTab = testExecutionTabPage;
            }

            return(retVal);
        }
Esempio n. 2
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                if (Variable != null)
                {
                    Expression expression = new Parser().Expression(
                        EnclosingFinder <Dictionary> .find(Variable), Variable.FullName);
                    IVariable variable = expression.GetVariable(new InterpretationContext());
                    if (variable != Variable)
                    {
                        SetVariable(variable);
                    }
                    else
                    {
                        structureTreeListView.RefreshObject(Variable);
                        structureTreeListView.Refresh();
                    }
                }
            }

            return(retVal);
        }
Esempio n. 3
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                if (changeKind != Context.ChangeKind.EndOfCycle)
                {
                    modelDiagramPanel.RefreshControl();
                    if (stateDiagramPanel != null)
                    {
                        stateDiagramPanel.RefreshControl();
                    }

                    Dictionary enclosing = EnclosingFinder <Dictionary> .find(modelElement, true);

                    if (modelElement == null || enclosing == Dictionary)
                    {
                        dataDictTree.RefreshModel(modelElement);
                    }
                }
            }

            return(retVal);
        }
Esempio n. 4
0
 /// <summary>
 ///     The delegate used to handle the change of the value of a model element
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind">Indicates the reason why the change occured</param>
 protected virtual void Context_ValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     try
     {
         Invoke((MethodInvoker)(() => HandleValueChange(modelElement, changeKind)));
     }
     catch (Exception)
     {
     }
 }
Esempio n. 5
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                shortcutTreeView.RefreshModel(modelElement);
            }

            return(retVal);
        }
Esempio n. 6
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                Refresh();
            }

            return(retVal);
        }
Esempio n. 7
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                TreeView.RefreshModel(modelElement);
                staticTimeLineControl.Translation = Translation;
                staticTimeLineControl.Refresh();
            }

            return(retVal);
        }
Esempio n. 8
0
        /// <summary>
        ///     Indicates that a change event should be displayed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns></returns>
        protected virtual bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = true;

            // When end of cycle, only redisplay when the displayed element related to a variable
            if (changeKind == Context.ChangeKind.EndOfCycle)
            {
                IVariable variable = EnclosingFinder <IVariable> .find(DisplayedModel, true);

                retVal = (variable != null);
            }

            return(retVal);
        }
Esempio n. 9
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                usageTreeView.Root = DisplayedModel;
                if (usageTreeView.Nodes.Count > 0)
                {
                    usageTreeView.Nodes[0].EnsureVisible();
                }
            }

            return(retVal);
        }
Esempio n. 10
0
        /// <summary>
        ///     Indicates that a change event should be displayed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns></returns>
        protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = modelElement == null;

            if (!retVal)
            {
                if (changeKind != Context.ChangeKind.EndOfCycle)
                {
                    Dictionary enclosing = EnclosingFinder <Dictionary> .find(modelElement, true);

                    retVal = (enclosing == Dictionary);
                }
                else
                {
                    retVal = base.ShouldDisplayChange(modelElement, changeKind);
                }
            }

            return(retVal);
        }
Esempio n. 11
0
        /// <summary>
        ///     Allows to refresh the view, when the value of a model changed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns>True if the view should be refreshed</returns>
        public override bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = base.HandleValueChange(modelElement, changeKind);

            if (retVal)
            {
                if (modelElement == null)
                {
                    BoxArrowContainerPanel.RefreshControl();
                }
                else
                {
                    TEnclosing enclosing = EnclosingFinder <TEnclosing> .find(modelElement, true);

                    while (enclosing != null)
                    {
                        if (enclosing == Model)
                        {
                            BoxArrowContainerPanel.RefreshControl();
                            enclosing = null;
                        }
                        else
                        {
                            enclosing = EnclosingFinder <TEnclosing> .find(enclosing as IEnclosed, false);
                        }
                    }
                }
            }

            if (changeKind == Context.ChangeKind.EndOfCycle)
            {
                BoxArrowContainerPanel.Refresh();
            }

            return(retVal);
        }
Esempio n. 12
0
 /// <summary>
 ///     Indicates that a change event should be displayed
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind"></param>
 /// <returns></returns>
 protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     return(modelElement == null || EnclosingFinder <TranslationDictionary> .find(modelElement, true) == TranslationDictionary);
 }
Esempio n. 13
0
 /// <summary>
 ///     Allows to refresh the view, when the value of a model changed
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind"></param>
 /// <returns>True if the view should be refreshed</returns>
 public virtual bool HandleValueChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     return(ShouldDisplayChange(modelElement, changeKind));
 }
Esempio n. 14
0
        /// <summary>
        ///     Indicates that a change event should be displayed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns></returns>
        protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = modelElement == null || DisplayedModel == null || DisplayedModel.IsParent(modelElement);

            return(retVal);
        }
Esempio n. 15
0
 /// <summary>
 ///     Indicates that a change event should be displayed
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind"></param>
 /// <returns></returns>
 protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     // All changes in the model should be tracked
     return(changeKind != Context.ChangeKind.EndOfCycle && DisplayedModel == modelElement || modelElement == null);
 }
Esempio n. 16
0
 /// <summary>
 ///     Indicates that a change event should be displayed
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind"></param>
 /// <returns></returns>
 protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     return(changeKind == Context.ChangeKind.EndOfCycle);
 }
Esempio n. 17
0
 /// <summary>
 ///     Indicates that a change event should be displayed
 /// </summary>
 /// <param name="modelElement"></param>
 /// <param name="changeKind"></param>
 /// <returns></returns>
 protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
 {
     // There is no smart way to determine whether the change should be taken into account or not
     return(true);
 }
Esempio n. 18
0
        /// <summary>
        ///     Indicates that a change event should be displayed
        /// </summary>
        /// <param name="modelElement"></param>
        /// <param name="changeKind"></param>
        /// <returns></returns>
        protected override bool ShouldDisplayChange(IModelElement modelElement, Context.ChangeKind changeKind)
        {
            bool retVal = modelElement == null || changeKind != Context.ChangeKind.EndOfCycle;

            return(retVal);
        }