/// <summary> /// Deep copies the current DojoClassDefinition to another instance of DojoClassDefinition. /// </summary> /// <param name="DojoClassDefinition">The DojoClassDefinition to copy to.</param> /// <param name="isolation">Placeholders are used to isolate the DojoClassDefinition from its children.</param> public void CopyTo(DojoClassDefinition dojoClassDefinition, bool isolation) { dojoClassDefinition.iD = iD; dojoClassDefinition.isPlaceHolder = isPlaceHolder; dojoClassDefinition.isSynced = isSynced; dojoClassDefinition.name = name; dojoClassDefinition.description = description; dojoClassDefinition.isDisabled = isDisabled; dojoClassDefinition.occupancyAvg = occupancyAvg; dojoClassDefinition.occupancyAvgDate = occupancyAvgDate; if (accessControlGroup != null) { if (isolation) { dojoClassDefinition.accessControlGroup = accessControlGroup.NewPlaceHolder(); } else { dojoClassDefinition.accessControlGroup = accessControlGroup.Copy(false); } } dojoClassDefinition.recurrenceCount = recurrenceCount; dojoClassDefinition.recurrenceEnd = recurrenceEnd; dojoClassDefinition.recurrenceSpan = recurrenceSpan; dojoClassDefinition.recurrenceType = recurrenceType; dojoClassDefinition.nextSigninStart = nextSigninStart; dojoClassDefinition.nextSigninEnd = nextSigninEnd; dojoClassDefinition.nextClassStart = nextClassStart; dojoClassDefinition.nextClassEnd = nextClassEnd; if (instructor != null) { if (isolation) { dojoClassDefinition.instructor = instructor.NewPlaceHolder(); } else { dojoClassDefinition.instructor = instructor.Copy(false); } } if (location != null) { if (isolation) { dojoClassDefinition.location = location.NewPlaceHolder(); } else { dojoClassDefinition.location = location.Copy(false); } } }
public int IndexOf(DojoClassDefinition value) { lock (this) { for (int x = 0; x < count; x++) { if (DojoClassDefinitionArray[x].Equals(value)) { return(x); } } return(-1); } }
public int Add(DojoClassDefinition value) { OnCollectionChanged(EventArgs.Empty); lock (this) { count++; // Resize the array if the count is greater than the length // of the array. if (count > DojoClassDefinitionArray.GetUpperBound(0) + 1) { DojoClassDefinition[] tempDojoClassDefinitionArray = new DojoClassDefinition[count * 2]; Array.Copy(DojoClassDefinitionArray, tempDojoClassDefinitionArray, count - 1); DojoClassDefinitionArray = tempDojoClassDefinitionArray; } DojoClassDefinitionArray[count - 1] = value; } return(count - 1); }
public void Insert(int index, DojoClassDefinition value) { OnCollectionChanged(EventArgs.Empty); lock (this) { count++; // Resize the array if the count is greater than the length // of the array. if (count > DojoClassDefinitionArray.GetUpperBound(0) + 1) { DojoClassDefinition[] tempDojoClassDefinitionArray = new DojoClassDefinition[count * 2]; Array.Copy(DojoClassDefinitionArray, tempDojoClassDefinitionArray, count - 1); DojoClassDefinitionArray = tempDojoClassDefinitionArray; } for (int x = index + 1; x == count - 2; x++) { DojoClassDefinitionArray[x] = DojoClassDefinitionArray[x - 1]; } DojoClassDefinitionArray[index] = value; } }
/// <summary> /// Clones DojoClassDefinition object and clones child objects with cloning or replication. /// as the parent object. /// </summary> /// <returns> A new DojoClassDefinition object reflecting the replicated DojoClassDefinition object.</returns> public DojoClassDefinition Clone() { DojoClassDefinition clonedDojoClassDefinition = new DojoClassDefinition(); clonedDojoClassDefinition.iD = iD; clonedDojoClassDefinition.isSynced = isSynced; clonedDojoClassDefinition.name = name; clonedDojoClassDefinition.description = description; clonedDojoClassDefinition.isDisabled = isDisabled; clonedDojoClassDefinition.occupancyAvg = occupancyAvg; clonedDojoClassDefinition.occupancyAvgDate = occupancyAvgDate; clonedDojoClassDefinition.recurrenceCount = recurrenceCount; clonedDojoClassDefinition.recurrenceEnd = recurrenceEnd; clonedDojoClassDefinition.recurrenceSpan = recurrenceSpan; clonedDojoClassDefinition.nextSigninStart = nextSigninStart; clonedDojoClassDefinition.nextSigninEnd = nextSigninEnd; clonedDojoClassDefinition.nextClassStart = nextClassStart; clonedDojoClassDefinition.nextClassEnd = nextClassEnd; clonedDojoClassDefinition.recurrenceType = recurrenceType; if (accessControlGroup != null) { clonedDojoClassDefinition.accessControlGroup = accessControlGroup; } if (instructor != null) { clonedDojoClassDefinition.instructor = instructor; } if (location != null) { clonedDojoClassDefinition.location = location; } return(clonedDojoClassDefinition); }
public bool Contains(DojoClassDefinition value) { return(IndexOf(value) != -1); }
/// <summary> /// Compares the object's ID to another object's ID. /// </summary> public int CompareTo(DojoClassDefinition dojoClassDefinition) { return(this.iD - dojoClassDefinition.iD); }
/// <summary> /// Compares the object's ID to another object's ID. /// </summary> int IComparable.CompareTo(object obj) { DojoClassDefinition dojoClassDefinition = (DojoClassDefinition)obj; return(this.iD - dojoClassDefinition.iD); }
/// <summary> /// Deep copies the current DojoClassDefinition to another instance of DojoClassDefinition. /// This method does not provide isolated copies; use overriden method for this feature. /// </summary> /// <param name="DojoClassDefinition">The DojoClassDefinition to copy to.</param> public void CopyTo(DojoClassDefinition dojoClassDefinition) { CopyTo(dojoClassDefinition, false); }