Skip to content

added additional AddPeriod method with extra parameters #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/uk/sdo/Learning/Period.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ public Period( int? periodIndex, string shortName, string longName, PeriodType t
this.SetType( type );
}

/// <summary>
/// Constructor that accepts values for all mandatory fields
/// </summary>
///<param name="periodIndex">Ordinal position of period within the day (1,2,3,etc)</param>
///<param name="shortName">A ShortName</param>
///<param name="longName">A LongName</param>
///<param name="startTime">A StartTime</param>
///<param name="endTime">A EndTime</param>
///<param name="type">What this period represents. Note that currently some programs represent registration, breaks and lunches as a "period" and some don't. This Type could differ from the lesson Type (see section C4) if this teacher is doing something in this period which differs from the majority of the school.</param>
///
public Period(int? periodIndex, string shortName, string longName, DateTime? startTime, DateTime? endTime, PeriodType type)
: base(LearningDTD.PERIOD)
{
this.PeriodIndex = periodIndex;
this.ShortName = shortName;
this.LongName = longName;
this.StartTime = startTime;
this.EndTime = endTime;
this.SetType(type);
}

/// <summary>
/// Constructor used by the .Net Serialization formatter
/// </summary>
Expand Down
21 changes: 21 additions & 0 deletions src/uk/sdo/Learning/PeriodList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,25 @@ public void AddPeriod( int? PeriodIndex, string ShortName, string LongName, Peri
AddChild( LearningDTD.PERIODLIST_PERIOD, new Period( PeriodIndex, ShortName, LongName, Type ) );
}

///<summary>Adds the value of the <c>&lt;Period&gt;</c> element.</summary>
/// <param name="PeriodIndex">Ordinal position of period within the day (1,2,3,etc)</param>
/// <param name="ShortName">A ShortName</param>
/// <param name="LongName">A LongName</param>
/// <param name="StartTime">A StartTime</param>
/// <param name="EndTime">A EndTime</param>
/// <param name="Type">What this period represents. Note that currently some programs represent registration, breaks and lunches as a "period" and some don't. This Type could differ from the lesson Type (see section C4) if this teacher is doing something in this period which differs from the majority of the school.</param>
///<remarks>
/// <para>This form of <c>setPeriod</c> is provided as a convenience method
/// that is functionally equivalent to the method <c>AddPeriod</c></para>
/// <para>Version: 2.5</para>
/// <para>Since: 2.3</para>
/// </remarks>

public void AddPeriod(int? PeriodIndex, string ShortName, string LongName, DateTime? StartTime, DateTime? EndTime, PeriodType Type)
{
AddChild(LearningDTD.PERIODLIST_PERIOD, new Period(PeriodIndex, ShortName, LongName, StartTime, EndTime, Type));
}



}}
18 changes: 18 additions & 0 deletions src/uk/sdo/Learning/StandardPeriodList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,22 @@ public void AddPeriod( int? PeriodIndex, string ShortName, string LongName, Peri
AddChild( LearningDTD.STANDARDPERIODLIST_PERIOD, new Period( PeriodIndex, ShortName, LongName, Type ) );
}

///<summary>Adds the value of the <c>&lt;Period&gt;</c> element.</summary>
/// <param name="PeriodIndex">Ordinal position of period within the day (1,2,3,etc)</param>
/// <param name="ShortName">A ShortName</param>
/// <param name="LongName">A LongName</param>
/// <param name="StartTime">Start Time</param>
/// <param name="EndTime">End Time</param>
/// <param name="Type">What this period represents. Note that currently some programs represent registration, breaks and lunches as a "period" and some don't. This Type could differ from the lesson Type (see section C4) if this teacher is doing something in this period which differs from the majority of the school.</param>
///<remarks>
/// <para>This form of <c>setPeriod</c> is provided as a convenience method
/// that is functionally equivalent to the method <c>AddPeriod</c></para>
/// <para>Version: 2.5</para>
/// <para>Since: 2.3</para>
/// </remarks>
public void AddPeriod(int? PeriodIndex, string ShortName, string LongName, DateTime? startTime, DateTime? endTime, PeriodType Type)
{
AddChild(LearningDTD.STANDARDPERIODLIST_PERIOD, new Period(PeriodIndex, ShortName, LongName, startTime, endTime, Type));
}

}}