- Splitting enums into single files for more structure

- remove old Enum file
This commit is contained in:
FlorianDahn 2019-09-26 17:14:12 +02:00
parent a6d22cdd82
commit 69e5a6717b
6 changed files with 77 additions and 61 deletions

View File

@ -13,7 +13,7 @@ namespace TelegramBaseTest.Tests
public SimpleForm()
{
this.DeleteSide = TelegramBotBase.Enums.eSide.Both;
this.DeleteSide = TelegramBotBase.Enums.eDeleteSide.Both;
this.DeleteMode = TelegramBotBase.Enums.eDeleteMode.OnLeavingForm;
this.Opened += SimpleForm_Opened;

View File

@ -1,56 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Enums
{
public enum eDeleteMode
{
/// <summary>
/// Don't delete any message.
/// </summary>
None = 0,
/// <summary>
/// Delete messages on every callback/action.
/// </summary>
OnEveryCall = 1,
/// <summary>
/// Delete on leaving this form.
/// </summary>
OnLeavingForm = 2
}
public enum eSide
{
/// <summary>
/// Delete only messages from this bot.
/// </summary>
BotOnly = 0,
/// <summary>
/// Delete only user messages.
/// </summary>
UserOnly = 1,
/// <summary>
/// Delete all messages in this context.
/// </summary>
Both = 2
}
public enum eMonthPickerMode
{
/// <summary>
/// Shows the calendar with day picker mode
/// </summary>
day = 0,
/// <summary>
/// Shows the calendar with month overview
/// </summary>
month = 1,
/// <summary>
/// Shows the calendar with year overview
/// </summary>
year = 2
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Enums
{
public enum eDeleteMode
{
/// <summary>
/// Don't delete any message.
/// </summary>
None = 0,
/// <summary>
/// Delete messages on every callback/action.
/// </summary>
OnEveryCall = 1,
/// <summary>
/// Delete on leaving this form.
/// </summary>
OnLeavingForm = 2
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Enums
{
public enum eDeleteSide
{
/// <summary>
/// Delete only messages from this bot.
/// </summary>
BotOnly = 0,
/// <summary>
/// Delete only user messages.
/// </summary>
UserOnly = 1,
/// <summary>
/// Delete all messages in this context.
/// </summary>
Both = 2
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Enums
{
public enum eMonthPickerMode
{
/// <summary>
/// Shows the calendar with day picker mode
/// </summary>
day = 0,
/// <summary>
/// Shows the calendar with month overview
/// </summary>
month = 1,
/// <summary>
/// Shows the calendar with year overview
/// </summary>
year = 2
}
}

View File

@ -18,7 +18,7 @@ namespace TelegramBotBase.Form
public eDeleteMode DeleteMode { get; set; }
public eSide DeleteSide { get; set; }
public eDeleteSide DeleteSide { get; set; }
@ -26,7 +26,7 @@ namespace TelegramBotBase.Form
{
this.OldMessages = new List<Message>();
this.DeleteMode = eDeleteMode.OnEveryCall;
this.DeleteSide = eSide.BotOnly;
this.DeleteSide = eDeleteSide.BotOnly;
this.Init += AutoCleanForm_Init;
@ -48,7 +48,7 @@ namespace TelegramBotBase.Form
private void Device_MessageReceived(object sender, MessageReceivedEventArgs e)
{
if (this.DeleteSide == eSide.BotOnly)
if (this.DeleteSide == eDeleteSide.BotOnly)
return;
this.OldMessages.Add(e.Message);
@ -56,7 +56,7 @@ namespace TelegramBotBase.Form
private void Device_MessageSent(object sender, MessageSentEventArgs e)
{
if (this.DeleteSide == eSide.UserOnly)
if (this.DeleteSide == eDeleteSide.UserOnly)
return;
this.OldMessages.Add(e.Message);