I have a small problem with my Exchange Appointment. The idea is to sync a meeting from sharepoint calendar to the personal exchange calendar.
I have this StringList in my CalendarItem Class:
private StringList m_Category;
public StringList Category { get { return m_Category; } }
And there it should go:
Microsoft.Exchange.WebServices.Data.Appointment xApointment = new Appointment(m_Service)
xApointment.Categories = xItem.Category; //xItem = Instance of CalendarItem
In the Microsoft.Exchange.WebService.Data.Appointment
I have the predefinied StingList Categories
.
What happens now is that I'm parsing through an XML File which looks like:
<listitems xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema"
xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<rs:data ItemCount="1">
<z:row ows_ContentTypeId="0x010200C5A7325634A3154BB8249D1C36246E00"
ows_Title="Test GetAllViewFields"
ows_Location="Testhausen"
ows_EventDate="2014-12-15 08:00:00"
ows_EndDate="2014-12-15 09:00:00"
ows_Description="Ein Test meeting"
ows_fAllDayEvent="0"
ows_fRecurrence="0"
ows_EventType="0"
ows_RecurrenceID="2014-12-15 08:00:00"
ows_Duration="3600"
ows_ParticipantsPicker=""
***ows_Category="Geschäftlich"***
And than I'm parsing this whole XML Code as a String and check if the name is there:
private void initFromXmlAttribute(System.Xml.Linq.XAttribute x)
{
string AttributeName = x.Name.LocalName.Replace("ows_", "");
try
{
if
(AttributeName == "Category")
{
m_Category= x.Value; //Error implicite convert not possible StringList to String
return;
}
The Error is because m_Category = StringList
and x.Value = String
.
Does anyone has an idea how to solve this little issue?
I am not familiar with class StringList, but I guess it a Collection. You can simply initialize a new StringList with the string inside it :