fix: reformat using C# rules
This commit is contained in:
@@ -2,42 +2,41 @@
|
||||
using TelegramBotBase.Form;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface IAPIKeySelectionStage
|
||||
{
|
||||
public interface IAPIKeySelectionStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the API Key which will be used by the telegram bot client.
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
IMessageLoopSelectionStage WithAPIKey(string apiKey);
|
||||
/// <summary>
|
||||
/// Sets the API Key which will be used by the telegram bot client.
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
IMessageLoopSelectionStage WithAPIKey(string apiKey);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="StartForm"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart(string apiKey, Type StartForm);
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="StartForm"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart(string apiKey, Type StartForm);
|
||||
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart<T>(string apiKey) where T : FormBase;
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart<T>(string apiKey) where T : FormBase;
|
||||
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="StartFormFactory"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart(string apiKey, IStartFormFactory StartFormFactory);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Quick and easy way to create a BotBase instance.
|
||||
/// Uses: DefaultMessageLoop, NoProxy, OnlyStart, NoSerialization, DefaultLanguage
|
||||
/// </summary>
|
||||
/// <param name="apiKey"></param>
|
||||
/// <param name="StartFormFactory"></param>
|
||||
/// <returns></returns>
|
||||
IBuildingStage QuickStart(string apiKey, IStartFormFactory StartFormFactory);
|
||||
}
|
||||
@@ -2,39 +2,35 @@
|
||||
using System.Collections.Generic;
|
||||
using Telegram.Bot.Types;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface IBotCommandsStage
|
||||
{
|
||||
public interface IBotCommandsStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Does not create any commands.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage NoCommands();
|
||||
/// <summary>
|
||||
/// Does not create any commands.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage NoCommands();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates default commands for start, help and settings.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage DefaultCommands();
|
||||
/// <summary>
|
||||
/// Creates default commands for start, help and settings.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage DefaultCommands();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Only adds the start command.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage OnlyStart();
|
||||
/// <summary>
|
||||
/// Only adds the start command.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage OnlyStart();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gives you the ability to add custom commands.
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
ISessionSerializationStage CustomCommands(Action<Dictionary<BotCommandScope, List<BotCommand>>> action);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Gives you the ability to add custom commands.
|
||||
/// </summary>
|
||||
/// <param name="action"></param>
|
||||
/// <returns></returns>
|
||||
ISessionSerializationStage CustomCommands(Action<Dictionary<BotCommandScope, List<BotCommand>>> action);
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface IBuildingStage
|
||||
{
|
||||
public interface IBuildingStage
|
||||
{
|
||||
BotBase Build();
|
||||
}
|
||||
}
|
||||
BotBase Build();
|
||||
}
|
||||
@@ -1,33 +1,30 @@
|
||||
using TelegramBotBase.Localizations;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface ILanguageSelectionStage
|
||||
{
|
||||
public interface ILanguageSelectionStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Selects the default language for control usage. (English)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage DefaultLanguage();
|
||||
|
||||
/// <summary>
|
||||
/// Selects the default language for control usage. (English)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage DefaultLanguage();
|
||||
/// <summary>
|
||||
/// Selects english as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage UseEnglish();
|
||||
|
||||
/// <summary>
|
||||
/// Selects english as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage UseEnglish();
|
||||
/// <summary>
|
||||
/// Selects german as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage UseGerman();
|
||||
|
||||
/// <summary>
|
||||
/// Selects german as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage UseGerman();
|
||||
|
||||
/// <summary>
|
||||
/// Selects a custom language as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage Custom(Localization language);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Selects a custom language as the default language for control labels.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBuildingStage Custom(Localization language);
|
||||
}
|
||||
@@ -1,40 +1,36 @@
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface IMessageLoopSelectionStage
|
||||
{
|
||||
public interface IMessageLoopSelectionStage
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a default message loop.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage DefaultMessageLoop();
|
||||
/// <summary>
|
||||
/// Chooses a default message loop.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage DefaultMessageLoop();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a minimalistic message loop, which catches all update types and only calls the Load function.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage MinimalMessageLoop();
|
||||
/// <summary>
|
||||
/// Chooses a minimalistic message loop, which catches all update types and only calls the Load function.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage MinimalMessageLoop();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a custom message loop.
|
||||
/// </summary>
|
||||
/// <param name="startFormClass"></param>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage CustomMessageLoop(IMessageLoopFactory startFormClass);
|
||||
/// <summary>
|
||||
/// Chooses a custom message loop.
|
||||
/// </summary>
|
||||
/// <param name="startFormClass"></param>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage CustomMessageLoop(IMessageLoopFactory startFormClass);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a custom message loop.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage CustomMessageLoop<T>() where T : class, new();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Chooses a custom message loop.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
IStartFormSelectionStage CustomMessageLoop<T>() where T : class, new();
|
||||
}
|
||||
@@ -1,48 +1,44 @@
|
||||
using System.Net.Http;
|
||||
using Telegram.Bot;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface INetworkingSelectionStage
|
||||
{
|
||||
public interface INetworkingSelectionStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Chooses a proxy as network configuration.
|
||||
/// </summary>
|
||||
/// <param name="proxyAddress"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithProxy(string proxyAddress);
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a proxy as network configuration.
|
||||
/// </summary>
|
||||
/// <param name="proxyAddress"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithProxy(string proxyAddress);
|
||||
|
||||
/// <summary>
|
||||
/// Do not choose a proxy as network configuration.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage NoProxy();
|
||||
/// <summary>
|
||||
/// Do not choose a proxy as network configuration.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage NoProxy();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a custom instance of TelegramBotClient.
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithBotClient(TelegramBotClient client);
|
||||
/// <summary>
|
||||
/// Chooses a custom instance of TelegramBotClient.
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithBotClient(TelegramBotClient client);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the custom proxy host and port.
|
||||
/// </summary>
|
||||
/// <param name="proxyHost"></param>
|
||||
/// <param name="Port"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithHostAndPort(string proxyHost, int Port);
|
||||
/// <summary>
|
||||
/// Sets the custom proxy host and port.
|
||||
/// </summary>
|
||||
/// <param name="proxyHost"></param>
|
||||
/// <param name="Port"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithHostAndPort(string proxyHost, int Port);
|
||||
|
||||
/// <summary>
|
||||
/// Uses a custom http client.
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithHttpClient(HttpClient client);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Uses a custom http client.
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
/// <returns></returns>
|
||||
IBotCommandsStage WithHttpClient(HttpClient client);
|
||||
}
|
||||
@@ -1,46 +1,44 @@
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface ISessionSerializationStage
|
||||
{
|
||||
public interface ISessionSerializationStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Do not uses serialization.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage NoSerialization();
|
||||
/// <summary>
|
||||
/// Do not uses serialization.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage NoSerialization();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sets the state machine for serialization.
|
||||
/// </summary>
|
||||
/// <param name="machine"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseSerialization(IStateMachine machine);
|
||||
/// <summary>
|
||||
/// Sets the state machine for serialization.
|
||||
/// </summary>
|
||||
/// <param name="machine"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseSerialization(IStateMachine machine);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Using the complex version of .Net JSON, which can serialize all objects.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseJSON(string path);
|
||||
/// <summary>
|
||||
/// Using the complex version of .Net JSON, which can serialize all objects.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseJSON(string path);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Use the easy version of .Net JSON, which can serialize basic types, but not generics and others.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseSimpleJSON(string path);
|
||||
/// <summary>
|
||||
/// Use the easy version of .Net JSON, which can serialize basic types, but not generics and others.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseSimpleJSON(string path);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Uses the XML serializer for session serialization.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseXML(string path);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Uses the XML serializer for session serialization.
|
||||
/// </summary>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
ILanguageSelectionStage UseXML(string path);
|
||||
}
|
||||
@@ -2,47 +2,44 @@
|
||||
using TelegramBotBase.Form;
|
||||
using TelegramBotBase.Interfaces;
|
||||
|
||||
namespace TelegramBotBase.Builder.Interfaces
|
||||
namespace TelegramBotBase.Builder.Interfaces;
|
||||
|
||||
public interface IStartFormSelectionStage
|
||||
{
|
||||
public interface IStartFormSelectionStage
|
||||
{
|
||||
/// <summary>
|
||||
/// Chooses a start form type which will be used for new sessions.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartForm(Type startFormClass);
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a start form type which will be used for new sessions.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartForm(Type startFormClass);
|
||||
/// <summary>
|
||||
/// Chooses a generic start form which will be used for new sessions.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartForm<T>() where T : FormBase, new();
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a generic start form which will be used for new sessions.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartForm<T>() where T : FormBase, new();
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="startFormClass"></param>
|
||||
/// <param name="serviceProvider"></param>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithServiceProvider(Type startFormClass, IServiceProvider serviceProvider);
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="startFormClass"></param>
|
||||
/// <param name="serviceProvider"></param>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithServiceProvider(Type startFormClass, IServiceProvider serviceProvider);
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="serviceProvider"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithServiceProvider<T>(IServiceProvider serviceProvider) where T : FormBase;
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="serviceProvider"></param>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithServiceProvider<T>(IServiceProvider serviceProvider) where T : FormBase;
|
||||
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="factory"></param>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartFormFactory(IStartFormFactory factory);
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Chooses a StartFormFactory which will be use for new sessions.
|
||||
/// </summary>
|
||||
/// <param name="factory"></param>
|
||||
/// <returns></returns>
|
||||
INetworkingSelectionStage WithStartFormFactory(IStartFormFactory factory);
|
||||
}
|
||||
Reference in New Issue
Block a user