public AuthenticateViewModel(CredentialCore prevCore = null) { this.Success = false; this._credentialCore = new CredentialCore { Generation = CredentialCore.CurrentKeyGeneration }; if (prevCore != null) { this._credentialCore.OverridedConsumerKey = prevCore.OverridedConsumerKey; this._credentialCore.OverridedConsumerSecret = prevCore.OverridedConsumerSecret; } }
public AuthenticateViewModel(CredentialCore prevCore = null) { this.Success = false; this._credentialCore = new CredentialCore(); if (prevCore != null) { this._credentialCore.OverridedConsumerKey = prevCore.OverridedConsumerKey; this._credentialCore.OverridedConsumerSecret = prevCore.OverridedConsumerSecret; } }
/// <summary> /// このアカウント情報のクレデンシャルを書き換えます。 /// </summary> /// <param name="overwrite">このアカウント情報に上書きするクレデンシャル</param> public void RewriteCredential(CredentialCore overwrite) { this.Generation = overwrite.Generation; this.OverridedConsumerKey = overwrite.OverridedConsumerKey; this.OverridedConsumerSecret = overwrite.OverridedConsumerSecret; this.ScreenName = overwrite.ScreenName; this.NumericId = overwrite.NumericId; this.Secret = overwrite.Secret; this.Token = overwrite.Token; }
/// <summary> /// クレデンシャル情報からアカウント情報を生成します。 /// </summary> /// <param name="original">オリジナル クレデンシャル</param> /// <returns>アカウント情報</returns> public static AccountInfo FromCredential(CredentialCore original) { return new AccountInfo() { Generation = original.Generation, OverridedConsumerKey = original.OverridedConsumerKey, OverridedConsumerSecret = original.OverridedConsumerSecret, ScreenName = original.ScreenName, NumericId = original.NumericId, Secret = original.Secret, Token = original.Token, }; }
/// <summary> /// このアカウント情報のクレデンシャルを書き換えます。 /// </summary> /// <param name="overwrite">このアカウント情報に上書きするクレデンシャル</param> public void RewriteCredential(CredentialCore overwrite) { this.OverridedConsumerKey = overwrite.OverridedConsumerKey; this.OverridedConsumerSecret = overwrite.OverridedConsumerSecret; this.RateLimitMax = overwrite.RateLimitMax; this.RateLimitRemaining = overwrite.RateLimitRemaining; this.RateLimitReset = overwrite.RateLimitReset; this.ScreenName = overwrite.ScreenName; this.NumericId = overwrite.NumericId; this.Secret = overwrite.Secret; this.Token = overwrite.Token; }
/// <summary> /// クレデンシャル情報からアカウント情報を生成します。 /// </summary> /// <param name="original">オリジナル クレデンシャル</param> /// <returns>アカウント情報</returns> public static AccountInfo FromCredential(CredentialCore original) { return new AccountInfo() { OverridedConsumerKey = original.OverridedConsumerKey, OverridedConsumerSecret = original.OverridedConsumerSecret, RateLimitMax = original.RateLimitMax, RateLimitRemaining = original.RateLimitRemaining, RateLimitReset = original.RateLimitReset, ScreenName = original.ScreenName, NumericId = original.NumericId, Secret = original.Secret, Token = original.Token, }; }