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

                if (((gmlTextSymbolItem != null) &&
                     this._parent.GmlTextSymbols.Remove(gmlTextSymbolItem)))
                {
                    return(true);
                }
                if ((this._parent.GmlColour == item))
                {
                    this._parent.GmlColour = null;
                    return(true);
                }
                IGmlSvgParameter gmlSvgParameterItem = item.As <IGmlSvgParameter>();

                if (((gmlSvgParameterItem != null) &&
                     this._parent.GmlSvgParameters.Remove(gmlSvgParameterItem)))
                {
                    return(true);
                }
                return(false);
            }
コード例 #2
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IGmlPolygonSymbol gmlPolygonSymbolsCasted = item.As <IGmlPolygonSymbol>();

                if ((gmlPolygonSymbolsCasted != null))
                {
                    this._parent.GmlPolygonSymbols.Add(gmlPolygonSymbolsCasted);
                }
                IGmlSvgParameter gmlSvgParametersCasted = item.As <IGmlSvgParameter>();

                if ((gmlSvgParametersCasted != null))
                {
                    this._parent.GmlSvgParameters.Add(gmlSvgParametersCasted);
                }
                IGmlTextSymbol gmlTextSymbolsCasted = item.As <IGmlTextSymbol>();

                if ((gmlTextSymbolsCasted != null))
                {
                    this._parent.GmlTextSymbols.Add(gmlTextSymbolsCasted);
                }
                IGmlMark gmlMarksCasted = item.As <IGmlMark>();

                if ((gmlMarksCasted != null))
                {
                    this._parent.GmlMarks.Add(gmlMarksCasted);
                }
                if ((this._parent.GmlColour == null))
                {
                    IGmlColour gmlColourCasted = item.As <IGmlColour>();
                    if ((gmlColourCasted != null))
                    {
                        this._parent.GmlColour = gmlColourCasted;
                        return;
                    }
                }
            }