Ejemplo n.º 1
0
            /// <summary>
            ///     Indicates whether the explanation part is related to the variable
            /// </summary>
            /// <param name="explanationPart"></param>
            /// <returns></returns>
            public bool Match(ExplanationPart explanationPart)
            {
                bool retVal = false;

                Change change = explanationPart.Change;

                if (change != null)
                {
                    if (Variable != null)
                    {
                        // ReSharper disable once ConditionIsAlwaysTrueOrFalse
                        retVal = retVal || change.ImpactVariable(Variable);
                    }
                    if (VariablePartName != null)
                    {
                        retVal = retVal || (change.Variable != null && MatchName(change.Variable.FullName));
                    }
                }

                Expression expression = explanationPart.LeftPart as Expression;

                if (expression != null)
                {
                    if (VariablePartName != null)
                    {
                        retVal = retVal || MatchName(expression.FullName);
                    }
                }

                ModelElement element = explanationPart.Element;

                if (element != null)
                {
                    if (VariablePartName != null)
                    {
                        retVal = retVal || MatchName(element.FullName);
                    }
                }

                return(retVal);
            }
Ejemplo n.º 2
0
        /// <summary>
        ///     Selects the model element which corresponds to the explain tree node
        ///     If the current node does not refer to a model element, selects the one from its parent node
        /// </summary>
        /// <param name="node"></param>
        /// <param name="mouseEventArgs"></param>
        private void SelectModelElement(ExplainTreeNode node, MouseEventArgs mouseEventArgs)
        {
            while (node != null)
            {
                ModelElement model = node.Explanation.LeftPart as ModelElement;
                if (model == null)
                {
                    model = node.Explanation.Element;
                }

                if (model != null)
                {
                    Context.SelectionCriteria criteria = GuiUtils.SelectionCriteriaBasedOnMouseEvent(mouseEventArgs);
                    EfsSystem.Instance.Context.SelectElement(model, this, criteria);
                    node = null;
                }
                else
                {
                    node = node.Parent as ExplainTreeNode;
                }
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 ///     Accepts a drop event from a model element
 /// </summary>
 /// <param name="element"></param>
 public virtual void AcceptDrop(ModelElement element)
 {
 }