mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
7ac40cee02
users now manipulate a RequestResponse object rather than setting ref arguments
34 lines
747 B
C++
34 lines
747 B
C++
#include "stdafx.h"
|
|
#include "RequestResponse.h"
|
|
|
|
namespace CefSharp
|
|
{
|
|
void RequestResponse::Cancel()
|
|
{
|
|
_action = ResponseAction::Cancel;
|
|
}
|
|
|
|
void RequestResponse::Redirect(String^ url)
|
|
{
|
|
_redirectUrl = url;
|
|
_action = ResponseAction::Redirect;
|
|
}
|
|
|
|
void RequestResponse::RespondWith(Stream^ stream, String^ mimeType)
|
|
{
|
|
if(String::IsNullOrEmpty(mimeType))
|
|
{
|
|
throw gcnew ArgumentException("must provide a mime type", "mimeType");
|
|
}
|
|
|
|
if(stream == nullptr)
|
|
{
|
|
throw gcnew ArgumentNullException("stream");
|
|
}
|
|
|
|
_responseStream = stream;
|
|
_mimeType = mimeType;
|
|
_action = ResponseAction::Respond;
|
|
}
|
|
|
|
} |