/// <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; } } IErpPerson erpPersonsCasted = item.As <IErpPerson>(); if ((erpPersonsCasted != null)) { this._parent.ErpPersons.Add(erpPersonsCasted); } IAppointment appointmentsCasted = item.As <IAppointment>(); if ((appointmentsCasted != null)) { this._parent.Appointments.Add(appointmentsCasted); } ITroubleTicket troubleTicketsCasted = item.As <ITroubleTicket>(); if ((troubleTicketsCasted != null)) { this._parent.TroubleTickets.Add(troubleTicketsCasted); } }
/// <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.Status == item)) { this._parent.Status = null; return(true); } IErpPerson erpPersonItem = item.As <IErpPerson>(); if (((erpPersonItem != null) && this._parent.ErpPersons.Remove(erpPersonItem))) { return(true); } IAppointment appointmentItem = item.As <IAppointment>(); if (((appointmentItem != null) && this._parent.Appointments.Remove(appointmentItem))) { return(true); } ITroubleTicket troubleTicketItem = item.As <ITroubleTicket>(); if (((troubleTicketItem != null) && this._parent.TroubleTickets.Remove(troubleTicketItem))) { return(true); } return(false); }
/// <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) { IIncidentCode incidentCodeItem = item.As <IIncidentCode>(); if (((incidentCodeItem != null) && this._parent.IncidentCodes.Remove(incidentCodeItem))) { return(true); } ITroubleTicket troubleTicketItem = item.As <ITroubleTicket>(); if (((troubleTicketItem != null) && this._parent.TroubleTickets.Remove(troubleTicketItem))) { return(true); } if ((this._parent.Period == item)) { this._parent.Period = null; return(true); } return(false); }
/// <summary> /// Adds the given element to the collection /// </summary> /// <param name="item">The item to add</param> public override void Add(IModelElement item) { IIncidentCode incidentCodesCasted = item.As <IIncidentCode>(); if ((incidentCodesCasted != null)) { this._parent.IncidentCodes.Add(incidentCodesCasted); } ITroubleTicket troubleTicketsCasted = item.As <ITroubleTicket>(); if ((troubleTicketsCasted != null)) { this._parent.TroubleTickets.Add(troubleTicketsCasted); } if ((this._parent.Period == null)) { IDateTimeInterval periodCasted = item.As <IDateTimeInterval>(); if ((periodCasted != null)) { this._parent.Period = periodCasted; return; } } }