/// <summary> /// Accept a visitor over the collection contents. /// </summary> /// <param name="visitor">Visitor class which should be called back</param> /// <param name="organizationMode"> /// The organization mode which you want to iterate over. /// Note that this must have been included in an AddOrganizationMode /// call before any renderables were added. /// </param> public void AcceptVisitor(IQueuedRenderableVisitor visitor, OrganizationMode organizationMode) { if ((int)(organizationMode & this._organizationMode) == 0) { throw new ArgumentException( "Organization mode requested in AcceptVistor was not notified " + "to this class ahead of time, therefore may not be supported.", "organizationMode"); } switch (organizationMode) { case OrganizationMode.GroupByPass: acceptVisitorGrouped(visitor); break; case OrganizationMode.Descending: acceptVisitorDescending(visitor); break; case OrganizationMode.Ascending: acceptVisitorAscending(visitor); break; } }
/// <summary> /// Add a required sorting / grouping mode to this collection when next used. /// </summary> /// <remarks> /// You can only do this when the collection is empty. /// </remarks> /// <see cref="OrganizationMode"/> /// <param name="om"></param> public void AddOrganizationMode(OrganizationMode om) { this._organizationMode |= om; }
/// <summary> /// Reset the organisation modes required for this collection. /// </summary> /// <remarks> /// You can only do this when the collection is empty. /// </remarks> /// <see cref="OrganizationMode"/> public void ResetOrganizationModes() { this._organizationMode = 0; }