public void Mehrere_Termine_in_einen_Kalender() { var calendar = new Calendar(); calendar.AddEntry( "Erster Eintrag", new DateTime(2015, 5, 18, 18, 0, 0), new DateTime(2015, 5, 18, 22, 0, 0)); calendar.AddEntry( "Zweiter Eintrag", new DateTime(2015, 5, 18)); calendar.SaveToFile("demo.ics"); }
/* MouseClick Handler */ private void MouseClicked(int x, int y) { Rectangle mouseClickRect = new Rectangle(x, y, 10, 10); switch (GState) { case CalendarState.ConfirmActivity: if (mouseClickRect.Intersects(ConfirmButton.Rect)) { // Later on there will be more complicated effects, keeping basic if (!MainCharacter.Stats.ContainsKey(ActivitiesList.SelectedOption)) { MainCharacter.Stats[ActivitiesList.SelectedOption] = 1; } else { MainCharacter.Stats[ActivitiesList.SelectedOption]++; } if (!MainCharacter.Relationships.ContainsKey(PeopleList.SelectedOption)) { MainCharacter.Relationships[PeopleList.SelectedOption] = 1; } else { MainCharacter.Relationships[PeopleList.SelectedOption]++; } Calendar.AddEntry(ActivitiesList.SelectedLabel + " with " + PeopleList.SelectedLabel); GState = CalendarState.NextDay; Calendar.MoveDay(); } if (mouseClickRect.Intersects(Notebook.Rect)) { GState = CalendarState.ToNotebook; } break; case CalendarState.ActivityChoice: if (mouseClickRect.Intersects(Notebook.Rect)) { GState = CalendarState.ToNotebook; } break; default: break; } }