Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 1.05 KB

File metadata and controls

21 lines (12 loc) · 1.05 KB

In this section you will add the ability to create events on the user's calendar.

  1. Open ./graphtutorial/src/main/java/graphtutorial/Graph.java and add the following function to the Graph class.

    :::code language="java" source="../demo/graphtutorial/src/main/java/graphtutorial/Graph.java" id="CreateEventSnippet":::

  2. Open ./graphtutorial/src/main/java/graphtutorial/App.java and add the following function to the App class.

    :::code language="java" source="../demo/graphtutorial/src/main/java/graphtutorial/App.java" id="CreateEventSnippet":::

    This function prompts the user for subject, attendees, start, end, and body, then uses those values to call Graph.createEvent.

  3. Add the following just after the // Create a new event comment in the Main function.

    createEvent(user.mailboxSettings.timeZone, input);
  4. Save all of your changes and run the app. Choose the Add an event option. Respond to the prompts to create a new event on the user's calendar.