Exemplo n.º 1
0
                protected override void VisitDesignator(Designator designator)
                {
                    base.VisitDesignator(designator);

                    Utils.ModelElement current = designator.Ref as Utils.ModelElement;
                    while (current != null && !(current is NameSpace) && !(current is Parameter))
                    {
                        bool change;

                        Variable variable = current as Variable;
                        if (variable != null)
                        {
                            change           = variable.AddDependancy(DependantFunction);
                            DependancyChange = DependancyChange || change;
                        }
                        else
                        {
                            StructureElement structureElement = current as StructureElement;
                            if (structureElement != null)
                            {
                                change           = structureElement.AddDependancy(DependantFunction);
                                DependancyChange = DependancyChange || change;

                                change           = structureElement.Structure.AddDependancy(DependantFunction);
                                DependancyChange = DependancyChange || change;
                            }
                            else
                            {
                                Function function = current as Function;
                                if (function != null)
                                {
                                    change           = function.AddDependancy(DependantFunction);
                                    DependancyChange = DependancyChange || change;
                                }
                            }
                        }

                        current = current.Enclosing as Utils.ModelElement;
                    }
                }