C# Class MsOfficeTracker.Helpers.Office365Api

Afficher le fichier Open project: sealuzh/PersonalAnalytics Class Usage Examples

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

GetInstance() public static méthode

Singleton
public static GetInstance ( ) : Office365Api
Résultat Office365Api

GetNumberOfEmailsSent() public méthode

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

GetNumberOfUnreadEmailsInInbox() public méthode

Returns the number of unread emails currently in the inbox
public GetNumberOfUnreadEmailsInInbox ( ) : Task
Résultat Task

GetNumberOfUnreadEmailsReceived() public méthode

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
Résultat Task

GetPhotoForUser() public méthode

public GetPhotoForUser ( string email ) : Task
email string
Résultat Task

GetTotalNumberOfEmailsInInbox() public méthode

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

GetTotalNumberOfEmailsReceived() public méthode

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
Résultat Task

IsAuthenticated() public méthode

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

LoadMeetings() public méthode

public LoadMeetings ( DateTimeOffset date ) : Task>
date DateTimeOffset
Résultat Task>

SignOut() public méthode

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
Résultat void