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

                if (((gmlStrokeItem != null) &&
                     this._parent.GmlStrokes.Remove(gmlStrokeItem)))
                {
                    return(true);
                }
                IGmlFont gmlFontItem = item.As <IGmlFont>();

                if (((gmlFontItem != null) &&
                     this._parent.GmlFonts.Remove(gmlFontItem)))
                {
                    return(true);
                }
                IGmlFill gmlFillItem = item.As <IGmlFill>();

                if (((gmlFillItem != null) &&
                     this._parent.GmlFills.Remove(gmlFillItem)))
                {
                    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)
 {
     if ((this._parent.GmlDiagramObject == null))
     {
         IGmlDiagramObject gmlDiagramObjectCasted = item.As <IGmlDiagramObject>();
         if ((gmlDiagramObjectCasted != null))
         {
             this._parent.GmlDiagramObject = gmlDiagramObjectCasted;
             return;
         }
     }
     if ((this._parent.GmlStroke == null))
     {
         IGmlStroke gmlStrokeCasted = item.As <IGmlStroke>();
         if ((gmlStrokeCasted != null))
         {
             this._parent.GmlStroke = gmlStrokeCasted;
             return;
         }
     }
     if ((this._parent.GmlFill == null))
     {
         IGmlFill gmlFillCasted = item.As <IGmlFill>();
         if ((gmlFillCasted != null))
         {
             this._parent.GmlFill = gmlFillCasted;
             return;
         }
     }
 }
コード例 #3
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IGmlStroke gmlStrokesCasted = item.As <IGmlStroke>();

                if ((gmlStrokesCasted != null))
                {
                    this._parent.GmlStrokes.Add(gmlStrokesCasted);
                }
                IGmlFont gmlFontsCasted = item.As <IGmlFont>();

                if ((gmlFontsCasted != null))
                {
                    this._parent.GmlFonts.Add(gmlFontsCasted);
                }
                IGmlFill gmlFillsCasted = item.As <IGmlFill>();

                if ((gmlFillsCasted != null))
                {
                    this._parent.GmlFills.Add(gmlFillsCasted);
                }
            }