コード例 #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)
            {
                if ((this._parent.ActivityInterval == item))
                {
                    this._parent.ActivityInterval = null;
                    return(true);
                }
                ITransactionSummary transactionSummaryItem = item.As <ITransactionSummary>();

                if (((transactionSummaryItem != null) &&
                     this._parent.TransactionSummaries.Remove(transactionSummaryItem)))
                {
                    return(true);
                }
                IReceiptSummary receiptSummaryItem = item.As <IReceiptSummary>();

                if (((receiptSummaryItem != null) &&
                     this._parent.ReceiptSummaries.Remove(receiptSummaryItem)))
                {
                    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.ActivityInterval == null))
                {
                    IDateTimeInterval activityIntervalCasted = item.As <IDateTimeInterval>();
                    if ((activityIntervalCasted != null))
                    {
                        this._parent.ActivityInterval = activityIntervalCasted;
                        return;
                    }
                }
                ITransactionSummary transactionSummariesCasted = item.As <ITransactionSummary>();

                if ((transactionSummariesCasted != null))
                {
                    this._parent.TransactionSummaries.Add(transactionSummariesCasted);
                }
                IReceiptSummary receiptSummariesCasted = item.As <IReceiptSummary>();

                if ((receiptSummariesCasted != null))
                {
                    this._parent.ReceiptSummaries.Add(receiptSummariesCasted);
                }
            }
コード例 #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 TransactionKindProxy(ITransactionSummary modelElement) :
     base(modelElement, "transactionKind")
 {
 }