Creating the Facebook event helper class

To present a Facebook event, you must create a wrapper.

To create the Facebook event wrapper class, perform the following procedure:

  1. In the context menu of folder Utilities, click Add » Class...

  2. In the Name input field, enter FacebookEvent.

  3. Open the file FacebookEvent.cs and add the following constructors:

    public FacebookEvent()
    {
        this.Id = String.Empty;
        this.Name = String.Empty;
        this.Location = String.Empty;
        this.StartTime = DateTime.Now;
        this.EndTime = DateTime.Now;
    }
     
    public FacebookEvent( string id, string name, string location, DateTime startTime, DateTime endTime )
        : this()
    {
        this.Id = id;
        this.Name = name;
        this.Location = location;
        this.StartTime = startTime;
        this.EndTime = endTime;
    }

  4. Define the Facebook event properties by pasting the following code:

    public string Id
    {
        get;
        set;
    }
     
    public string Name
    {
        get;
        set;
    }
     
    public string Location
    {
        get;
        set;
    }
     
    public DateTime StartTime
    {
        get;
        set;
    }
     
    public DateTime EndTime
    {
        get;
        set;
    }

You create the FacebookEvent class to present a Facebook event. Then, you define the IdNameLocationStartTime andEndTime properties that Facebook provides you when requesting the event.

Next steps

+1-888-365-2779
sales@sitefinity.com

Related topics:

Feedback

How useful is this article?

Tell us more

Submit
Your message was successfully sent.

We appreciate your feedback.

Your message could not be sent.

OK