Example #1
0
 /// <summary>
 /// Allows you to clone ApiInfo
 /// </summary>
 /// <returns>A clone of <seealso cref="ApiInfo"/></returns>
 public ApiInfo Clone()
 {
     return(new ApiInfo(Links.Clone(),
                        OauthScopes.Clone(),
                        AcceptedOauthScopes.Clone(),
                        Etag != null ? new string(Etag.ToCharArray()) : null));
 }
Example #2
0
 /// <summary>
 /// Allows you to clone ApiInfo
 /// </summary>
 /// <returns>A clone of <seealso cref="ApiInfo"/></returns>
 public ApiInfo Clone()
 {
     return(new ApiInfo(Links.Clone(),
                        OauthScopes.Clone(),
                        AcceptedOauthScopes.Clone(),
                        Etag != null ? new string(Etag.ToCharArray()) : null,
                        RateLimit != null ? RateLimit.Clone() : null,
                        ServerTimeDifference));
 }
Example #3
0
        /// <summary>
        /// Allows you to clone ApiInfo
        /// </summary>
        /// <returns>A clone of <seealso cref="ApiInfo"/></returns>
        public ApiInfo Clone()
        {
            // Seem to have to do this to pass a whole bunch of tests (for example Octokit.Tests.Clients.EventsClientTests.DeserializesCommitCommentEventCorrectly)
            // I believe this has something to do with the Mocking framework.
            if (Links == null || OauthScopes == null || RateLimit == null || Etag == null)
            {
                return(null);
            }

            return(new ApiInfo(Links.Clone(),
                               OauthScopes.Clone(),
                               AcceptedOauthScopes.Clone(),
                               new string(Etag.ToCharArray()),
                               RateLimit.Clone()));
        }
Example #4
0
 public string ConvertOAuthUrl(string redirectUri, OauthScopes scope, string state)
 {
     return(string.Format(WeChatSettings.WECHATURL_OAUTH_FORMAT, _appid, HttpUtility.UrlEncode(redirectUri, Encoding.GetEncoding("GB2312")), scope.ToString().ToLower(), state));
 }