コード例 #1
0
            /// <summary>
            /// Adds the given element to the collection
            /// </summary>
            /// <param name="item">The item to add</param>
            public override void Add(IModelElement item)
            {
                IWorkCostDetail workCostDetailsCasted = item.As <IWorkCostDetail>();

                if ((workCostDetailsCasted != null))
                {
                    this._parent.WorkCostDetails.Add(workCostDetailsCasted);
                }
                if ((this._parent.Status == null))
                {
                    IStatus statusCasted = item.As <IStatus>();
                    if ((statusCasted != null))
                    {
                        this._parent.Status = statusCasted;
                        return;
                    }
                }
                ICompatibleUnit compatibleUnitsCasted = item.As <ICompatibleUnit>();

                if ((compatibleUnitsCasted != null))
                {
                    this._parent.CompatibleUnits.Add(compatibleUnitsCasted);
                }
                ICUMaterialItem cUMaterialItemsCasted = item.As <ICUMaterialItem>();

                if ((cUMaterialItemsCasted != null))
                {
                    this._parent.CUMaterialItems.Add(cUMaterialItemsCasted);
                }
            }
コード例 #2
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)
            {
                IWorkCostDetail workCostDetailItem = item.As <IWorkCostDetail>();

                if (((workCostDetailItem != null) &&
                     this._parent.WorkCostDetails.Remove(workCostDetailItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                ICompatibleUnit compatibleUnitItem = item.As <ICompatibleUnit>();

                if (((compatibleUnitItem != null) &&
                     this._parent.CompatibleUnits.Remove(compatibleUnitItem)))
                {
                    return(true);
                }
                ICUMaterialItem cUMaterialItemItem = item.As <ICUMaterialItem>();

                if (((cUMaterialItemItem != null) &&
                     this._parent.CUMaterialItems.Remove(cUMaterialItemItem)))
                {
                    return(true);
                }
                return(false);
            }
コード例 #3
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)
            {
                IProject projectItem = item.As <IProject>();

                if (((projectItem != null) &&
                     this._parent.Projects.Remove(projectItem)))
                {
                    return(true);
                }
                IWorkCostDetail workCostDetailItem = item.As <IWorkCostDetail>();

                if (((workCostDetailItem != null) &&
                     this._parent.WorkCostDetails.Remove(workCostDetailItem)))
                {
                    return(true);
                }
                IErpTimeEntry erpTimeEntryItem = item.As <IErpTimeEntry>();

                if (((erpTimeEntryItem != null) &&
                     this._parent.ErpTimeEntries.Remove(erpTimeEntryItem)))
                {
                    return(true);
                }
                IWork workItem = item.As <IWork>();

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

                if ((projectsCasted != null))
                {
                    this._parent.Projects.Add(projectsCasted);
                }
                IWorkCostDetail workCostDetailsCasted = item.As <IWorkCostDetail>();

                if ((workCostDetailsCasted != null))
                {
                    this._parent.WorkCostDetails.Add(workCostDetailsCasted);
                }
                IErpTimeEntry erpTimeEntriesCasted = item.As <IErpTimeEntry>();

                if ((erpTimeEntriesCasted != null))
                {
                    this._parent.ErpTimeEntries.Add(erpTimeEntriesCasted);
                }
                IWork worksCasted = item.As <IWork>();

                if ((worksCasted != null))
                {
                    this._parent.Works.Add(worksCasted);
                }
            }
コード例 #5
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.Status == null))
     {
         IStatus statusCasted = item.As <IStatus>();
         if ((statusCasted != null))
         {
             this._parent.Status = statusCasted;
             return;
         }
     }
     if ((this._parent.WorkCostDetail == null))
     {
         IWorkCostDetail workCostDetailCasted = item.As <IWorkCostDetail>();
         if ((workCostDetailCasted != null))
         {
             this._parent.WorkCostDetail = workCostDetailCasted;
             return;
         }
     }
     if ((this._parent.WorkTask == null))
     {
         IWorkTask workTaskCasted = item.As <IWorkTask>();
         if ((workTaskCasted != null))
         {
             this._parent.WorkTask = workTaskCasted;
             return;
         }
     }
 }
コード例 #6
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.WorkCostDetail == null))
     {
         IWorkCostDetail workCostDetailCasted = item.As <IWorkCostDetail>();
         if ((workCostDetailCasted != null))
         {
             this._parent.WorkCostDetail = workCostDetailCasted;
             return;
         }
     }
 }
コード例 #7
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)
            {
                IWorkTask workTaskItem = item.As <IWorkTask>();

                if (((workTaskItem != null) &&
                     this._parent.WorkTasks.Remove(workTaskItem)))
                {
                    return(true);
                }
                if ((this._parent.Status == item))
                {
                    this._parent.Status = null;
                    return(true);
                }
                IWorkCostDetail workCostDetailItem = item.As <IWorkCostDetail>();

                if (((workCostDetailItem != null) &&
                     this._parent.WorkCostDetails.Remove(workCostDetailItem)))
                {
                    return(true);
                }
                return(false);
            }