- making Events property of FormBase public, for use in sub classes

- making ResultBase derive from Eventargs
- adding messagetype to messageresult
This commit is contained in:
FlorianDahn 2019-11-21 21:38:20 +01:00
parent 1f9539a23d
commit 0eab45bdbb
3 changed files with 11 additions and 2 deletions

View File

@ -28,7 +28,7 @@ namespace TelegramBotBase.Form
public List<ControlBase> Controls { get; set; } public List<ControlBase> Controls { get; set; }
private EventHandlerList Events = new EventHandlerList(); public EventHandlerList Events = new EventHandlerList();
private static object __evInit = new object(); private static object __evInit = new object();
@ -118,6 +118,7 @@ namespace TelegramBotBase.Form
} }
} }
/// <summary> /// <summary>
/// Form has been closed (left) /// Form has been closed (left)
/// </summary> /// </summary>

View File

@ -54,6 +54,14 @@ namespace TelegramBotBase.Base
} }
} }
public Telegram.Bot.Types.Enums.MessageType MessageType
{
get
{
return this.RawMessageData?.Message?.Type ?? Telegram.Bot.Types.Enums.MessageType.Unknown;
}
}
/// <summary> /// <summary>
/// Is this an action ? (i.e. button click) /// Is this an action ? (i.e. button click)
/// </summary> /// </summary>

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace TelegramBotBase.Base namespace TelegramBotBase.Base
{ {
public class ResultBase public class ResultBase : EventArgs
{ {
public MessageClient Client { get; set; } public MessageClient Client { get; set; }