mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +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
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using CefSharp;
|
|
using TweetLib.Browser.CEF.Interfaces;
|
|
|
|
namespace TweetImpl.CefSharp.Adapters {
|
|
sealed class CefMenuModelAdapter : IMenuModelAdapter<IMenuModel> {
|
|
public static CefMenuModelAdapter Instance { get; } = new ();
|
|
|
|
private CefMenuModelAdapter() {}
|
|
|
|
public int GetItemCount(IMenuModel model) {
|
|
return model.Count;
|
|
}
|
|
|
|
public void AddCommand(IMenuModel model, int command, string name) {
|
|
model.AddItem((CefMenuCommand) command, name);
|
|
}
|
|
|
|
public int GetCommandAt(IMenuModel model, int index) {
|
|
return (int) model.GetCommandIdAt(index);
|
|
}
|
|
|
|
public void AddCheckCommand(IMenuModel model, int command, string name) {
|
|
model.AddCheckItem((CefMenuCommand) command, name);
|
|
}
|
|
|
|
public void SetChecked(IMenuModel model, int command, bool isChecked) {
|
|
model.SetChecked((CefMenuCommand) command, isChecked);
|
|
}
|
|
|
|
public void AddSeparator(IMenuModel model) {
|
|
model.AddSeparator();
|
|
}
|
|
|
|
public bool IsSeparatorAt(IMenuModel model, int index) {
|
|
return model.GetTypeAt(index) == MenuItemType.Separator;
|
|
}
|
|
|
|
public void RemoveAt(IMenuModel model, int index) {
|
|
model.RemoveAt(index);
|
|
}
|
|
}
|
|
}
|