public TimeSpan(Scorm1_2.TimeSpan t) { if (t != null) { timespan = t.timespan; } else { timespan = new System.TimeSpan(); } }
//Serialize a simple value private void SerializeIntegral(object inobject) { //parse the enum into a string if (inobject.GetType().IsEnum) { string enumname = Enum.GetNames(inobject.GetType())[(int)inobject]; stack.Push(enumname); RecordStack(inobject.GetType()); stack.Pop(); } //integral types other than enums else { //Put strings in quotes if (inobject.GetType() == typeof(string)) { stack.Push(inobject.ToString()); RecordStack(typeof(string)); stack.Pop(); } else if (inobject.GetType() == typeof(Scorm1_2.DateTime)) { Scorm1_2.DateTime val = (Scorm1_2.DateTime)inobject; stack.Push(val.ToString()); RecordStack(typeof(Scorm1_2.DateTime)); stack.Pop(); } else if (inobject.GetType() == typeof(Scorm1_2.TimeSpan)) { Scorm1_2.TimeSpan val = (Scorm1_2.TimeSpan)inobject; stack.Push(val.ToString()); RecordStack(typeof(Scorm1_2.TimeSpan)); stack.Pop(); } else if (inobject.GetType() == typeof(Scorm2004.DateTime)) { Scorm2004.DateTime val = (Scorm2004.DateTime)inobject; stack.Push(val.ToString()); RecordStack(typeof(Scorm2004.DateTime)); stack.Pop(); } else if (inobject.GetType() == typeof(Scorm2004.TimeSpan)) { Scorm2004.TimeSpan val = (Scorm2004.TimeSpan)inobject; stack.Push(val.ToString()); RecordStack(typeof(Scorm2004.TimeSpan)); stack.Pop(); } else { stack.Push(inobject.ToString()); RecordStack(typeof(string)); stack.Pop(); } } //Create the set command for this level in the recursion }