コード例 #1
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)
            {
                IEStringToStringMapEntry eStringToStringMapEntryItem = item.As <IEStringToStringMapEntry>();

                if (((eStringToStringMapEntryItem != null) &&
                     this._parent.Details.Remove(eStringToStringMapEntryItem)))
                {
                    return(true);
                }
                IEObject eObjectItem = item.As <IEObject>();

                if (((eObjectItem != null) &&
                     this._parent.Contents.Remove(eObjectItem)))
                {
                    return(true);
                }
                return(false);
            }
コード例 #2
0
ファイル: EAnnotation.cs プロジェクト: lukeIam/NMF
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IEStringToStringMapEntry detailsCasted = item.As <IEStringToStringMapEntry>();

                if ((detailsCasted != null))
                {
                    this._parent.Details.Add(detailsCasted);
                }
                if ((this._parent.EModelElement == null))
                {
                    IEModelElement eModelElementCasted = item.As <IEModelElement>();
                    if ((eModelElementCasted != null))
                    {
                        this._parent.EModelElement = eModelElementCasted;
                        return;
                    }
                }
                this._parent.Contents.Add(item);
            }
コード例 #3
0
ファイル: EAnnotation.cs プロジェクト: lukeIam/NMF
            /// <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)
            {
                IEStringToStringMapEntry eStringToStringMapEntryItem = item.As <IEStringToStringMapEntry>();

                if (((eStringToStringMapEntryItem != null) &&
                     this._parent.Details.Remove(eStringToStringMapEntryItem)))
                {
                    return(true);
                }
                if ((this._parent.EModelElement == item))
                {
                    this._parent.EModelElement = null;
                    return(true);
                }
                if (this._parent.Contents.Remove(item))
                {
                    return(true);
                }
                if (this._parent.References.Remove(item))
                {
                    return(true);
                }
                return(false);
            }