public static vEvent ParseEvent(string data) { vEvent even = new vEvent(); foreach (string line in System.Text.RegularExpressions.Regex.Split(data, "\r\n")) { string fulltype = line.Split(':')[0]; string type = fulltype.Split(';')[0].ToUpper(); switch (type) { case "ATTACH": AddAttachment(even, line); break; case "ATTENDEE": AddAttendee(even, line); break; //case "LOCATION": case "DTSTART": even.Start = ParseDate(line.Split(':')[1]); break; case "DTEND": even.End = ParseDate(line.Split(':')[1]); break; case "LOCATION": even.Location = line.Split(':')[1]; break; //case "DTSTAMP": case "DESCRIPTION": even.Description = line.Split(':')[1]; break; case "SUMMARY": even.Summary = line.Split(':')[1]; break; case "PRIORITY": even.Priority = Convert.ToInt32(line.Split(':')[1]); break; //case "GEO": ActiveUp.Net.Groupware.vCalendar.Parser.SetGeo(even,line); // break; //case "TZ": ActiveUp.Net.Groupware.vCalendar.Parser.SetTimeZone(even,line); // break; //case "PRODID": ActiveUp.Net.Groupware.vCalendar.Parser.SetGeneratorId(even,line); // break; } } return(even); }
private void saveAsButton_Click(object sender, EventArgs e) { this.savevCalendarDialog.ShowDialog(); vCalendar calendar = new vCalendar(); vEvent newEvent = new vEvent(); newEvent.Summary = this.objectTextbox.Text; newEvent.Location = this.placeTextbox.Text; newEvent.Start = DateTime.Now; newEvent.End = DateTime.Now; calendar.Events.Add(newEvent); calendar.SaveToFile(this.savevCalendarDialog.FileName); }
public static vEvent ParseEvent(string data) { vEvent even = new vEvent(); foreach(string line in System.Text.RegularExpressions.Regex.Split(data,"\r\n")) { string fulltype = line.Split(':')[0]; string type = fulltype.Split(';')[0].ToUpper(); switch(type) { case "ATTACH": ActiveUp.Net.Groupware.vCalendar.Parser.AddAttachment(even,line); break; case "ATTENDEE": ActiveUp.Net.Groupware.vCalendar.Parser.AddAttendee(even,line); break; //case "LOCATION": case "DTSTART": even.Start = Parser.ParseDate(line.Split(':')[1]); break; case "DTEND": even.End = Parser.ParseDate(line.Split(':')[1]); break; case "LOCATION": even.Location = line.Split(':')[1]; break; //case "DTSTAMP": case "DESCRIPTION": even.Description = line.Split(':')[1]; break; case "SUMMARY": even.Summary = line.Split(':')[1]; break; case "PRIORITY": even.Priority = Convert.ToInt32(line.Split(':')[1]); break; //case "GEO": ActiveUp.Net.Groupware.vCalendar.Parser.SetGeo(even,line); // break; //case "TZ": ActiveUp.Net.Groupware.vCalendar.Parser.SetTimeZone(even,line); // break; //case "PRODID": ActiveUp.Net.Groupware.vCalendar.Parser.SetGeneratorId(even,line); // break; } } return even; }
public void Add(vEvent vevent) { InnerList.Add(vevent); }