C# Класс 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.
Показать файл Открыть проект

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

AddAccount() публичный Метод

Stores a new set of user credentials in the credentials store.
public AddAccount ( UserAccount userAccount ) : void
userAccount UserAccount
Результат void

DeleteAccount() публичный Метод

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.
Результат void

GetAccount() публичный Метод

Returns the account given the account name.
public GetAccount ( string accountName ) : UserAccount
accountName string The name to look.
Результат UserAccount

ResetCredentials() публичный Метод

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.
Результат void

UpdateCurrentProject() публичный Метод

Updates the current project data from the given project.
public UpdateCurrentProject ( Project project ) : void
project Project
Результат void