using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Base
{
///
/// Base class for controls
///
public class ControlBase
{
public Sessions.DeviceSession Device { get; set; }
public int ID { get; set; }
public String ControlID
{
get
{
return "#c" + this.ID.ToString();
}
}
///
/// Defines if the control should be rendered and invoked with actions
///
public bool Enabled { get; set; } = true;
///
/// Get invoked when control will be added to a form and invoked.
///
///
public virtual void Init()
{
}
public virtual async Task Load(MessageResult result)
{
}
public virtual async Task Action(MessageResult result, String value = null)
{
}
public virtual async Task Render(MessageResult result)
{
}
public virtual async Task Hidden(bool FormClose)
{
}
///
/// Will be called on a cleanup.
///
///
public virtual async Task Cleanup()
{
}
}
}