C# Class MsOfficeTracker.Helpers.Office365Api

Exibir arquivo Open project: sealuzh/PersonalAnalytics Class Usage Examples

Public Methods

Method Description
Authenticate ( ) : Task

try logging in, or show sign-in page and ask for rights

GetInstance ( ) : Office365Api

Singleton

GetNumberOfEmailsSent ( DateTimeOffset date ) : Task

Returns a list of emails which were sent on a given date

GetNumberOfUnreadEmailsInInbox ( ) : Task

Returns the number of unread emails currently in the inbox

GetNumberOfUnreadEmailsReceived ( DateTimeOffset date ) : Task

Returns a list of emails which were received on a given date AND are unread (and not in junk or delete folder)

GetPhotoForUser ( string email ) : Task
GetTotalNumberOfEmailsInInbox ( ) : Task

Returns the total number of emails currently in the inbox (read and unread)

GetTotalNumberOfEmailsReceived ( DateTimeOffset date ) : Task

Returns a list of emails which were received on a given date (and not in junk or delete folder)

IsAuthenticated ( ) : bool

Returns true if the user is already authenticated with Office 365

LoadMeetings ( DateTimeOffset date ) : Task>
SignOut ( ) : void

clear the ADAL token cache It's also necessary to clear the cookies from the browser' control so the next user has a chance to sign in.

Private Methods

Method Description
ClearCookies ( ) : void

This function clears cookies from the browser control used by ADAL.

GetDeleteAndJunkFolderIds ( ) : Task>

Loads a list of folders to find the Ids of the junk and deleted items folders to filter them

InternetGetConnectedState ( int &description, int reservedValue ) : bool
IsInternetAvailable ( ) : bool
Office365Api ( ) : System
SignIn ( ) : Task

force ADAL to prompt the user for credentials by specifying PromptBehavior.Always. ADAL will get a token and cache it

TrySilentAuthentication ( ) : Task

This method is called from a method if the user is not properly signed in yet and to check if the user can be authenticated (also checks for an active internet connection)

Method Details

Authenticate() public method

try logging in, or show sign-in page and ask for rights
public Authenticate ( ) : Task
return Task

GetInstance() public static method

Singleton
public static GetInstance ( ) : Office365Api
return Office365Api

GetNumberOfEmailsSent() public method

Returns a list of emails which were sent on a given date
public GetNumberOfEmailsSent ( DateTimeOffset date ) : Task
date DateTimeOffset
return Task

GetNumberOfUnreadEmailsInInbox() public method

Returns the number of unread emails currently in the inbox
public GetNumberOfUnreadEmailsInInbox ( ) : Task
return Task

GetNumberOfUnreadEmailsReceived() public method

Returns a list of emails which were received on a given date AND are unread (and not in junk or delete folder)
public GetNumberOfUnreadEmailsReceived ( DateTimeOffset date ) : Task
date DateTimeOffset
return Task

GetPhotoForUser() public method

public GetPhotoForUser ( string email ) : Task
email string
return Task

GetTotalNumberOfEmailsInInbox() public method

Returns the total number of emails currently in the inbox (read and unread)
public GetTotalNumberOfEmailsInInbox ( ) : Task
return Task

GetTotalNumberOfEmailsReceived() public method

Returns a list of emails which were received on a given date (and not in junk or delete folder)
public GetTotalNumberOfEmailsReceived ( DateTimeOffset date ) : Task
date DateTimeOffset
return Task

IsAuthenticated() public method

Returns true if the user is already authenticated with Office 365
public IsAuthenticated ( ) : bool
return bool

LoadMeetings() public method

public LoadMeetings ( DateTimeOffset date ) : Task>
date DateTimeOffset
return Task>

SignOut() public method

clear the ADAL token cache It's also necessary to clear the cookies from the browser' control so the next user has a chance to sign in.
public SignOut ( ) : void
return void