mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-25 23:35:16 +02:00
.github
.idea
bld
lib
linux
.idea
TweetDuck
TweetImpl.CefGlue
Adapters
CefAdapter.cs
CefBrowserAdapter.cs
CefDragDataAdapter.cs
CefErrorCodeAdapter.cs
CefFileDialogCallbackAdapter.cs
CefFrameAdapter.cs
CefJsDialogCallbackAdapter.cs
CefMenuModelAdapter.cs
CefRequestAdapter.cs
CefResourceHandlerFactory.cs
CefResponseAdapter.cs
Component
Dialogs
Handlers
Resources
Utils
Lib.cs
TweetImpl.CefGlue.csproj
.gitignore
Directory.Build.props
TweetDuck.Linux.sln
global.json
publish.sh
resources
windows
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
32 lines
907 B
C#
32 lines
907 B
C#
using TweetLib.Browser.CEF.Interfaces;
|
|
using Xilium.CefGlue;
|
|
|
|
namespace TweetImpl.CefGlue.Adapters {
|
|
sealed class CefResponseAdapter : IResponseAdapter<CefResponse> {
|
|
public static CefResponseAdapter Instance { get; } = new ();
|
|
|
|
private CefResponseAdapter() {}
|
|
|
|
public void SetCharset(CefResponse response, string charset) {
|
|
response.Charset = charset;
|
|
}
|
|
|
|
public void SetMimeType(CefResponse response, string mimeType) {
|
|
response.MimeType = mimeType;
|
|
}
|
|
|
|
public void SetStatus(CefResponse response, int statusCode, string statusText) {
|
|
response.Status = statusCode;
|
|
response.StatusText = statusText;
|
|
}
|
|
|
|
public void SetHeader(CefResponse response, string header, string value) {
|
|
response.SetHeaderByName(header, value, overwrite: true);
|
|
}
|
|
|
|
public string GetHeader(CefResponse response, string header) {
|
|
return response.GetHeaderMap()[header] ?? string.Empty;
|
|
}
|
|
}
|
|
}
|