C# Class GoogleCloudExtension.Accounts.CredentialsStore

This class manages the credentials store for the extension. Loading and saving the UserAccount to the %HOME%\AppData\Local directory. This class also manages the default credentials to use when a project doesn't specify credentials, or when Visual Studio is freshly opened. This default credentials is the last set of credentials used by the extension.
Afficher le fichier Open project: GoogleCloudPlatform/google-cloud-visualstudio

Méthodes publiques

Méthode Description
AddAccount ( UserAccount userAccount ) : void

Stores a new set of user credentials in the credentials store.

DeleteAccount ( UserAccount account ) : void

Deletes the account from the store. The account must exist in the store or it will throw.

GetAccount ( string accountName ) : UserAccount

Returns the account given the account name.

ResetCredentials ( string accountName, string projectId ) : void

Resets the credentials state to the account with the given accountName and the given projectId. The Reset event will be raised to notify listeners on this. If accountName cannot be found in the store then the credentials will be reset to empty.

UpdateCurrentProject ( Project project ) : void

Updates the current project data from the given project.

Private Methods

Méthode Description
AtomicFileRead ( string path ) : string
AtomicFileWrite ( string path, string contents ) : void
CredentialsStore ( ) : Google.Apis.Auth.OAuth2
EnsureCredentialsRootExist ( ) : void
GetCredentialsStoreRoot ( ) : string
GetFileName ( UserAccount userAccount ) : string
GetUserAccountPath ( string accountName ) : string
LoadAccounts ( ) : StoredUserAccount>.Dictionary
LoadDefaultCredentials ( ) : DefaultCredentials
LoadUserAccount ( string path ) : UserAccount
SaveUserAccount ( UserAccount userAccount ) : string
SaveUserAccount ( UserAccount userAccount, string path ) : void
UpdateDefaultCredentials ( ) : void

Method Details

AddAccount() public méthode

Stores a new set of user credentials in the credentials store.
public AddAccount ( UserAccount userAccount ) : void
userAccount UserAccount
Résultat void

DeleteAccount() public méthode

Deletes the account from the store. The account must exist in the store or it will throw.
public DeleteAccount ( UserAccount account ) : void
account UserAccount The accound to delete.
Résultat void

GetAccount() public méthode

Returns the account given the account name.
public GetAccount ( string accountName ) : UserAccount
accountName string The name to look.
Résultat UserAccount

ResetCredentials() public méthode

Resets the credentials state to the account with the given accountName and the given projectId. The Reset event will be raised to notify listeners on this. If accountName cannot be found in the store then the credentials will be reset to empty.
public ResetCredentials ( string accountName, string projectId ) : void
accountName string The name of the account to make current.
projectId string The projectId to make current.
Résultat void

UpdateCurrentProject() public méthode

Updates the current project data from the given project.
public UpdateCurrentProject ( Project project ) : void
project Project
Résultat void