fix: reformat using C# rules

This commit is contained in:
ZavaruKitsu
2022-10-08 19:26:34 +03:00
parent a731e2a8d0
commit 5ab15621a0
180 changed files with 13136 additions and 13081 deletions
+27 -31
View File
@@ -1,40 +1,36 @@
using System.Collections.Generic;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
public interface IDataSource<T>
{
public interface IDataSource<T>
{
/// <summary>
/// Returns the amount of items within this source.
/// </summary>
/// <returns></returns>
int Count { get; }
/// <summary>
/// Returns the amount of items within this source.
/// </summary>
/// <returns></returns>
int Count { get; }
/// <summary>
/// Returns the item at the specific index.
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
T ItemAt(int index);
/// <summary>
/// Returns the item at the specific index.
/// </summary>
/// <param name="index"></param>
/// <returns></returns>
T ItemAt(int index);
/// <summary>
/// Get all items from this source within this range.
/// </summary>
/// <param name="start"></param>
/// <param name="count"></param>
/// <returns></returns>
List<T> ItemRange(int start, int count);
/// <summary>
/// Get all items from this source within this range.
/// </summary>
/// <param name="start"></param>
/// <param name="count"></param>
/// <returns></returns>
List<T> ItemRange(int start, int count);
/// <summary>
/// Gets a list of all items of this datasource.
/// </summary>
/// <returns></returns>
List<T> AllItems();
}
}
/// <summary>
/// Gets a list of all items of this datasource.
/// </summary>
/// <returns></returns>
List<T> AllItems();
}
+28 -30
View File
@@ -1,40 +1,38 @@
using System;
using TelegramBotBase.Form;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
internal interface IDeviceSession
{
internal interface IDeviceSession
{
/// <summary>
/// Device or chat id
/// </summary>
long DeviceId { get; set; }
/// <summary>
/// Device or chat id
/// </summary>
long DeviceId { get; set; }
/// <summary>
/// Username of user or group
/// </summary>
string ChatTitle { get; set; }
/// <summary>
/// Username of user or group
/// </summary>
string ChatTitle { get; set; }
/// <summary>
/// When did any last action happend (message received or button clicked)
/// </summary>
DateTime LastAction { get; set; }
/// <summary>
/// When did any last action happend (message received or button clicked)
/// </summary>
DateTime LastAction { get; set; }
/// <summary>
/// Returns the form where the user/group is at the moment.
/// </summary>
FormBase ActiveForm { get; set; }
/// <summary>
/// Returns the form where the user/group is at the moment.
/// </summary>
FormBase ActiveForm { get; set; }
/// <summary>
/// Returns the previous shown form
/// </summary>
FormBase PreviousForm { get; set; }
/// <summary>
/// Returns the previous shown form
/// </summary>
FormBase PreviousForm { get; set; }
/// <summary>
/// contains if the form has been switched (navigated)
/// </summary>
bool FormSwitched { get; set; }
}
}
/// <summary>
/// contains if the form has been switched (navigated)
/// </summary>
bool FormSwitched { get; set; }
}
@@ -4,15 +4,11 @@ using TelegramBotBase.Args;
using TelegramBotBase.Base;
using TelegramBotBase.Sessions;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
public interface IMessageLoopFactory
{
public interface IMessageLoopFactory
{
Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult e);
Task MessageLoop(BotBase bot, DeviceSession session, UpdateResult ur, MessageResult e);
event EventHandler<UnhandledCallEventArgs> UnhandledCall;
}
}
event EventHandler<UnhandledCallEventArgs> UnhandledCall;
}
@@ -1,9 +1,8 @@
using TelegramBotBase.Form;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
public interface IStartFormFactory
{
public interface IStartFormFactory
{
FormBase CreateForm();
}
}
FormBase CreateForm();
}
+9 -12
View File
@@ -1,16 +1,13 @@
using TelegramBotBase.Args;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
/// <summary>
/// Is used to save specific fields into a session state to survive restarts or unhandled exceptions and crashes.
/// </summary>
public interface IStateForm
{
/// <summary>
/// Is used to save specific fields into a session state to survive restarts or unhandled exceptions and crashes.
/// </summary>
public interface IStateForm
{
void LoadState(LoadStateEventArgs e);
void LoadState(LoadStateEventArgs e);
void SaveState(SaveStateEventArgs e);
}
}
void SaveState(SaveStateEventArgs e);
}
+7 -8
View File
@@ -2,14 +2,13 @@
using TelegramBotBase.Args;
using TelegramBotBase.Base;
namespace TelegramBotBase.Interfaces
namespace TelegramBotBase.Interfaces;
public interface IStateMachine
{
public interface IStateMachine
{
Type FallbackStateForm { get; }
Type FallbackStateForm { get; }
void SaveFormStates(SaveStatesEventArgs e);
void SaveFormStates(SaveStatesEventArgs e);
StateContainer LoadFormStates();
}
}
StateContainer LoadFormStates();
}