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:
FlorianDahn 2021-01-15 19:33:44 +01:00
parent 6b404545df
commit 376ba68e8e
17 changed files with 23 additions and 17 deletions

View File

@ -15,7 +15,7 @@ using TelegramBotBase.Exceptions;
using TelegramBotBase.Form;
using static TelegramBotBase.Base.Async;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Hybrid
{
public class ButtonGrid : Base.ControlBase
{

View File

@ -11,7 +11,7 @@ using TelegramBotBase.Form;
using static TelegramBotBase.Tools.Arrays;
using static TelegramBotBase.Tools.Time;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
public class CalendarPicker : Base.ControlBase
{

View File

@ -8,7 +8,7 @@ using TelegramBotBase.Base;
using TelegramBotBase.Enums;
using TelegramBotBase.Form;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
public class MonthPicker : CalendarPicker
{

View File

@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Base;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
/// <summary>
/// A simple control for show and managing progress.

View File

@ -7,7 +7,7 @@ using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Form;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
public class ToggleButton : ControlBase
{

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Form;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
public class TreeView : ControlBase
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TelegramBotBase.Controls
namespace TelegramBotBase.Controls.Inline
{
public class TreeViewNode
{

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp3.0;net472</TargetFrameworks>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Configurations>Debug;Release</Configurations>
</PropertyGroup>

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Args;
using TelegramBotBase.Controls;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace TelegramBotBaseTest.Tests.Controls

View File

@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Args;
using TelegramBotBase.Controls;
using TelegramBotBase.Controls.Hybrid;
using TelegramBotBase.Form;
namespace TelegramBotBaseTest.Tests.Controls

View File

@ -8,6 +8,7 @@ using TelegramBotBase.Base;
using TelegramBotBase.Form;
using TelegramBotBase.Controls;
using TelegramBotBase.Args;
using TelegramBotBase.Controls.Inline;
namespace TelegramBotBaseTest.Tests.Controls
{

View File

@ -8,6 +8,7 @@ using TelegramBotBase.Base;
using TelegramBotBase.Form;
using TelegramBotBase.Controls;
using TelegramBotBase.Args;
using TelegramBotBase.Controls.Inline;
namespace TelegramBotBaseTest.Tests.Controls
{

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using TelegramBotBase.Args;
using TelegramBotBase.Controls;
using TelegramBotBase.Controls.Inline;
using TelegramBotBase.Form;
namespace TelegramBotBaseTest.Tests.Controls

View File

@ -7,6 +7,7 @@ using TelegramBotBase.Form;
using TelegramBotBase.Controls;
using TelegramBotBase.Base;
using TelegramBotBase.Args;
using TelegramBotBase.Controls.Inline;
namespace TelegramBotBaseTest.Tests.Controls
{

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading;
using System.Threading.Tasks;
using TelegramBotBase.Base;
using TelegramBotBase.Controls.Inline;
using TelegramBotBase.Form;
namespace TelegramBotBaseTest.Tests
@ -35,41 +36,41 @@ namespace TelegramBotBaseTest.Tests
if (call == null)
return;
TelegramBotBase.Controls.ProgressBar Bar = null;
ProgressBar Bar = null;
switch (call.Value)
{
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;
break;
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;
break;
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;
break;
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;
break;
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;
break;

View File

@ -38,7 +38,6 @@ namespace TelegramBotBaseTest.Tests
{
case "reply":
break;

View File

@ -31,7 +31,7 @@ namespace TelegramBotBaseTest.Tests
{
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")));
await this.Device.SendPhoto(bmp, "Test", btn);
await this.Device.SendPhoto(bmp, "Test", "", btn);
}