Ejemplo n.º 1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                NMF.Models.Tests.Architecture.IAttribute dataDependencyCasted = item.As <NMF.Models.Tests.Architecture.IAttribute>();
                if ((dataDependencyCasted != null))
                {
                    this._parent.DataDependency.Add(dataDependencyCasted);
                }
                IMethod functionalDependencyCasted = item.As <IMethod>();

                if ((functionalDependencyCasted != null))
                {
                    this._parent.FunctionalDependency.Add(functionalDependencyCasted);
                }
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Removes the given item from the collection
            /// </summary>
            /// <returns>True, if the item was removed, otherwise False</returns>
            /// <param name="item">The item that should be removed</param>
            public override bool Remove(IModelElement item)
            {
                NMF.Models.Tests.Architecture.IAttribute attributeItem = item.As <NMF.Models.Tests.Architecture.IAttribute>();
                if (((attributeItem != null) &&
                     this._parent.DataDependency.Remove(attributeItem)))
                {
                    return(true);
                }
                IMethod methodItem = item.As <IMethod>();

                if (((methodItem != null) &&
                     this._parent.FunctionalDependency.Remove(methodItem)))
                {
                    return(true);
                }
                return(false);
            }