As soon as I try to convert a project calendar having more than 1 exception to the corresponding XML using the supplied method "ToExceptionsXml" I get a runtime exception about misformed XML.
Stacktrace:
bei System.Xml.XmlWellFormedWriter.ThrowInvalidStateTransition(Token token, State currentState) bei System.Xml.XmlWellFormedWriter.AdvanceState(Token token) bei System.Xml.XmlWellFormedWriter.WriteStartElement(String prefix, String localName, String ns) bei Infragistics.ObjectSerializer.Parser.SaveHelper(Object value, PropertySerializationInfo propInfo, Boolean writeTypeNameElem) bei Infragistics.ObjectSerializer.Parser.SaveCollectionValueHelper(Object value, PropertySerializationInfo propInfo, String encloseInElement) bei Infragistics.ObjectSerializer.Parser.SaveHelper(Object value, PropertySerializationInfo propInfo, Boolean writeTypeNameElem) bei Infragistics.ObjectSerializer.Save(XmlWriter writer, Object value) bei Infragistics.ObjectSerializer.SaveAsXmlFragment(Object value, String& xmlFragment) bei Infragistics.Controls.Schedules.XmlDeserializerConverter.ConvertBack(Object value, Type targetType, Object parameter, CultureInfo culture) bei Infragistics.Controls.Schedules.ProjectUtilities.PropValToXml[T](StoragePropsInfo info, Int32 prop, T item)
Example code used to create the 2 exceptions:
_Calendar.Exceptions.Add(new ProjectCalendarException() { DisplayName = "Exception 1", DaySettings = new DaySettings() { IsWorkday = false }, DateRange = new Infragistics.DateRange(new DateTime(DateTime.Today.Year, 12, 25), new DateTime(DateTime.Today.Year, 12, 25)), Recurrence = new DateRecurrence() { Frequency = DateRecurrenceFrequency.Yearly, Interval = 1 } });
_Calendar.Exceptions.Add(new ProjectCalendarException() { DisplayName = "Exception 2", DaySettings = new DaySettings() { IsWorkday = false }, DateRange = new Infragistics.DateRange(new DateTime(DateTime.Today.Year, 12, 26), new DateTime(DateTime.Today.Year, 12, 26)), Recurrence = new DateRecurrence() { Frequency = DateRecurrenceFrequency.Yearly, Interval = 1 } });
If I add only 1 exception to the calendars list, the ToExceptionsXml method works as expected.
Hello Stefan,
I have been investigating into this behavior you are reporting, and I was able to reproduce the exception you are seeing. As a workaround to this, I would recommend saving each ProjectCalendarException separately in its own collection. In doing so, you can concatenate an XML string to represent the ProjectCalendar that owns the exceptions that you are trying to save to XML.
This exception is unexpected behavior, and as such, I have asked our development staff to examine it further. To ensure it receives attention, I have logged this behavior in our internal tracking systems with a development ID of 240843, and have created you a private support case that will be linked to this issue so you can be notified when a fix or other resolution becomes available. This private support case has an ID of CAS-186233-Y9M2V9, and you can access it here: https://ko.infragistics.com/my-account/support-activity.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer