ALMRestClient.ALMClient.FindCookie C# (CSharp) 메소드

FindCookie() 개인적인 정적인 메소드

Enumerates the client's cookie container looking for the cookie requested and calls the action when the cookie is found
private static FindCookie ( RestSharp client, string cookieName, Action foundCookie ) : bool
client RestSharp The client to be processed against
cookieName string The name of the cookie to locate
foundCookie Action The action to occur if the cookie is found
리턴 bool
        private static bool FindCookie(RestSharp.IRestClient client, string cookieName, Action<Cookie> foundCookie)
        {
            bool result = false;

            if (client != null && client.CookieContainer != null || client.CookieContainer.GetCookies(client.BaseUrl).Count >= 0)
            {
                foreach (Cookie cookie in client.CookieContainer.GetCookies(client.BaseUrl))
                {
                    if (string.Equals(cookie.Name, cookieName) == true)
                    {
                        if (foundCookie != null)
                        {
                            foundCookie(cookie);
                        }

                        result = true;
                        break;
                    }
                }
            }

            return result;
        }