mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-18 13:31:41 +02:00
.github
.idea
bld
lib
linux
resources
windows
TweetDuck
TweetDuck.Browser
TweetDuck.Video
TweetImpl.CefSharp
Adapters
CefAdapter.cs
CefBrowserAdapter.cs
CefDragDataAdapter.cs
CefErrorCodeAdapter.cs
CefFileDialogCallbackAdapter.cs
CefFrameAdapter.cs
CefJsDialogCallbackAdapter.cs
CefMenuModelAdapter.cs
CefRequestAdapter.cs
CefResponseAdapter.cs
Component
Dialogs
Handlers
Properties
TweetImpl.CefSharp.csproj
TweetLib.WinForms.Legacy
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
32 lines
872 B
C#
32 lines
872 B
C#
using CefSharp;
|
|
using TweetLib.Browser.CEF.Interfaces;
|
|
|
|
namespace TweetImpl.CefSharp.Adapters {
|
|
sealed class CefResponseAdapter : IResponseAdapter<IResponse> {
|
|
public static CefResponseAdapter Instance { get; } = new ();
|
|
|
|
private CefResponseAdapter() {}
|
|
|
|
public void SetCharset(IResponse response, string charset) {
|
|
response.Charset = charset;
|
|
}
|
|
|
|
public void SetMimeType(IResponse response, string mimeType) {
|
|
response.MimeType = mimeType;
|
|
}
|
|
|
|
public void SetStatus(IResponse response, int statusCode, string statusText) {
|
|
response.StatusCode = statusCode;
|
|
response.StatusText = statusText;
|
|
}
|
|
|
|
public void SetHeader(IResponse response, string header, string value) {
|
|
response.SetHeaderByName(header, value, overwrite: true);
|
|
}
|
|
|
|
public string? GetHeader(IResponse response, string header) {
|
|
return response.Headers[header];
|
|
}
|
|
}
|
|
}
|