MAJOR CHANGE: Refactoring namespace for controls
Chaning namespace for controls depending on their use area to: Controls.Hybrid Controls.Inline Controls.Reply Updating example project as well.
This commit is contained in:
parent
6b404545df
commit
376ba68e8e
@ -15,7 +15,7 @@ using TelegramBotBase.Exceptions;
|
|||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
using static TelegramBotBase.Base.Async;
|
using static TelegramBotBase.Base.Async;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Hybrid
|
||||||
{
|
{
|
||||||
public class ButtonGrid : Base.ControlBase
|
public class ButtonGrid : Base.ControlBase
|
||||||
{
|
{
|
||||||
@ -11,7 +11,7 @@ using TelegramBotBase.Form;
|
|||||||
using static TelegramBotBase.Tools.Arrays;
|
using static TelegramBotBase.Tools.Arrays;
|
||||||
using static TelegramBotBase.Tools.Time;
|
using static TelegramBotBase.Tools.Time;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
public class CalendarPicker : Base.ControlBase
|
public class CalendarPicker : Base.ControlBase
|
||||||
{
|
{
|
||||||
@ -8,7 +8,7 @@ using TelegramBotBase.Base;
|
|||||||
using TelegramBotBase.Enums;
|
using TelegramBotBase.Enums;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
public class MonthPicker : CalendarPicker
|
public class MonthPicker : CalendarPicker
|
||||||
{
|
{
|
||||||
@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TelegramBotBase.Base;
|
using TelegramBotBase.Base;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A simple control for show and managing progress.
|
/// A simple control for show and managing progress.
|
||||||
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
using TelegramBotBase.Base;
|
using TelegramBotBase.Base;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
public class ToggleButton : ControlBase
|
public class ToggleButton : ControlBase
|
||||||
{
|
{
|
||||||
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
using TelegramBotBase.Base;
|
using TelegramBotBase.Base;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
public class TreeView : ControlBase
|
public class TreeView : ControlBase
|
||||||
{
|
{
|
||||||
@ -4,7 +4,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace TelegramBotBase.Controls
|
namespace TelegramBotBase.Controls.Inline
|
||||||
{
|
{
|
||||||
public class TreeViewNode
|
public class TreeViewNode
|
||||||
{
|
{
|
||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
|
<TargetFrameworks>netcoreapp3.0;net472</TargetFrameworks>
|
||||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
|
using TelegramBotBase.Controls.Hybrid;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
|
using TelegramBotBase.Controls.Hybrid;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using TelegramBotBase.Base;
|
|||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
|
using TelegramBotBase.Controls.Inline;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using TelegramBotBase.Base;
|
|||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
|
using TelegramBotBase.Controls.Inline;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
|
using TelegramBotBase.Controls.Inline;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using TelegramBotBase.Form;
|
|||||||
using TelegramBotBase.Controls;
|
using TelegramBotBase.Controls;
|
||||||
using TelegramBotBase.Base;
|
using TelegramBotBase.Base;
|
||||||
using TelegramBotBase.Args;
|
using TelegramBotBase.Args;
|
||||||
|
using TelegramBotBase.Controls.Inline;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests.Controls
|
namespace TelegramBotBaseTest.Tests.Controls
|
||||||
{
|
{
|
||||||
|
|||||||
@ -5,6 +5,7 @@ using System.Text;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using TelegramBotBase.Base;
|
using TelegramBotBase.Base;
|
||||||
|
using TelegramBotBase.Controls.Inline;
|
||||||
using TelegramBotBase.Form;
|
using TelegramBotBase.Form;
|
||||||
|
|
||||||
namespace TelegramBotBaseTest.Tests
|
namespace TelegramBotBaseTest.Tests
|
||||||
@ -35,41 +36,41 @@ namespace TelegramBotBaseTest.Tests
|
|||||||
if (call == null)
|
if (call == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TelegramBotBase.Controls.ProgressBar Bar = null;
|
ProgressBar Bar = null;
|
||||||
|
|
||||||
switch (call.Value)
|
switch (call.Value)
|
||||||
{
|
{
|
||||||
case "standard":
|
case "standard":
|
||||||
|
|
||||||
Bar = new TelegramBotBase.Controls.ProgressBar(0, 100, TelegramBotBase.Controls.ProgressBar.eProgressStyle.standard);
|
Bar = new ProgressBar(0, 100, ProgressBar.eProgressStyle.standard);
|
||||||
Bar.Device = this.Device;
|
Bar.Device = this.Device;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "squares":
|
case "squares":
|
||||||
|
|
||||||
Bar = new TelegramBotBase.Controls.ProgressBar(0, 100, TelegramBotBase.Controls.ProgressBar.eProgressStyle.squares);
|
Bar = new ProgressBar(0, 100, ProgressBar.eProgressStyle.squares);
|
||||||
Bar.Device = this.Device;
|
Bar.Device = this.Device;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "circles":
|
case "circles":
|
||||||
|
|
||||||
Bar = new TelegramBotBase.Controls.ProgressBar(0, 100, TelegramBotBase.Controls.ProgressBar.eProgressStyle.circles);
|
Bar = new ProgressBar(0, 100, ProgressBar.eProgressStyle.circles);
|
||||||
Bar.Device = this.Device;
|
Bar.Device = this.Device;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "lines":
|
case "lines":
|
||||||
|
|
||||||
Bar = new TelegramBotBase.Controls.ProgressBar(0, 100, TelegramBotBase.Controls.ProgressBar.eProgressStyle.lines);
|
Bar = new ProgressBar(0, 100, ProgressBar.eProgressStyle.lines);
|
||||||
Bar.Device = this.Device;
|
Bar.Device = this.Device;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "squaredlines":
|
case "squaredlines":
|
||||||
|
|
||||||
Bar = new TelegramBotBase.Controls.ProgressBar(0, 100, TelegramBotBase.Controls.ProgressBar.eProgressStyle.squaredLines);
|
Bar = new ProgressBar(0, 100, ProgressBar.eProgressStyle.squaredLines);
|
||||||
Bar.Device = this.Device;
|
Bar.Device = this.Device;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -38,7 +38,6 @@ namespace TelegramBotBaseTest.Tests
|
|||||||
{
|
{
|
||||||
case "reply":
|
case "reply":
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ namespace TelegramBotBaseTest.Tests
|
|||||||
{
|
{
|
||||||
await this.Device.Send("Ciao from Form 2");
|
await this.Device.Send("Ciao from Form 2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ namespace TelegramBotBaseTest.Tests
|
|||||||
btn.AddButtonRow(new ButtonBase("Request Prompt", CallbackData.Create("navigate", "prompt")));
|
btn.AddButtonRow(new ButtonBase("Request Prompt", CallbackData.Create("navigate", "prompt")));
|
||||||
|
|
||||||
|
|
||||||
await this.Device.SendPhoto(bmp, "Test", btn);
|
await this.Device.SendPhoto(bmp, "Test", "", btn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user