Пример #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)
            {
                IRailwayElement railwayElementItem = item.As <IRailwayElement>();

                if (((railwayElementItem != null) &&
                     this._parent.Invalids.Remove(railwayElementItem)))
                {
                    return(true);
                }
                ISemaphore semaphoreItem = item.As <ISemaphore>();

                if (((semaphoreItem != null) &&
                     this._parent.Semaphores.Remove(semaphoreItem)))
                {
                    return(true);
                }
                IRoute routeItem = item.As <IRoute>();

                if (((routeItem != null) &&
                     this._parent.Routes.Remove(routeItem)))
                {
                    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)
            {
                IRailwayElement invalidsCasted = item.As <IRailwayElement>();

                if ((invalidsCasted != null))
                {
                    this._parent.Invalids.Add(invalidsCasted);
                }
                ISemaphore semaphoresCasted = item.As <ISemaphore>();

                if ((semaphoresCasted != null))
                {
                    this._parent.Semaphores.Add(semaphoresCasted);
                }
                IRoute routesCasted = item.As <IRoute>();

                if ((routesCasted != null))
                {
                    this._parent.Routes.Add(routesCasted);
                }
            }
Пример #3
0
 /// <summary>
 /// Creates a new observable property access proxy
 /// </summary>
 /// <param name="modelElement">The model instance element for which to create the property access proxy</param>
 public IdProxy(IRailwayElement modelElement) :
     base(modelElement)
 {
 }