Initial commit.
This commit is contained in:
21
Wino.Core.Domain/Models/Menus/MailOperationMenuItem.cs
Normal file
21
Wino.Core.Domain/Models/Menus/MailOperationMenuItem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Wino.Core.Domain.Enums;
|
||||
using Wino.Core.Domain.Interfaces;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Menus
|
||||
{
|
||||
public class MailOperationMenuItem : MenuOperationItemBase<MailOperation>, IMenuOperation
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets whether this menu item should be placed in SecondaryCommands if used in CommandBar.
|
||||
/// </summary>
|
||||
public bool IsSecondaryMenuPreferred { get; set; }
|
||||
|
||||
protected MailOperationMenuItem(MailOperation operation, bool isEnabled, bool isSecondaryMenuItem = false) : base(operation, isEnabled)
|
||||
{
|
||||
IsSecondaryMenuPreferred = isSecondaryMenuItem;
|
||||
}
|
||||
|
||||
public static MailOperationMenuItem Create(MailOperation operation, bool isEnabled = true, bool isSecondaryMenuItem = false)
|
||||
=> new MailOperationMenuItem(operation, isEnabled, isSecondaryMenuItem);
|
||||
}
|
||||
}
|
||||
18
Wino.Core.Domain/Models/Menus/MenuOperationItemBase.cs
Normal file
18
Wino.Core.Domain/Models/Menus/MenuOperationItemBase.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace Wino.Core.Domain.Models.Menus
|
||||
{
|
||||
public class MenuOperationItemBase<TOperation> where TOperation : Enum
|
||||
{
|
||||
public MenuOperationItemBase(TOperation operation, bool isEnabled)
|
||||
{
|
||||
Operation = operation;
|
||||
IsEnabled = isEnabled;
|
||||
Identifier = operation.ToString();
|
||||
}
|
||||
|
||||
public TOperation Operation { get; set; }
|
||||
public string Identifier { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user