Simplifications
This commit is contained in:
parent
3c93daed35
commit
952e0cb979
@ -22,7 +22,7 @@ namespace DemoBot.ActionManager.Actions
|
|||||||
public bool DoesFit(string raw_data) => raw_data.EndsWith(SearchForString);
|
public bool DoesFit(string raw_data) => raw_data.EndsWith(SearchForString);
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr) => await Action(raw_data, ur, mr);
|
public async Task DoAction(UpdateResult ur, MessageResult mr) => await Action(mr.RawData, ur, mr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ namespace DemoBot.ActionManager.Actions
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr) => await Action(_lastValue.Value, ur, mr);
|
public async Task DoAction(UpdateResult ur, MessageResult mr) => await Action(_lastValue.Value, ur, mr);
|
||||||
|
|
||||||
public static CallbackData GetCallback(string method, Guid guid) => new CallbackData(method, guid.ToString());
|
public static CallbackData GetCallback(string method, Guid guid) => new CallbackData(method, guid.ToString());
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ namespace DemoBot.ActionManager.Actions
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr) => await Action(_lastValue.Value, ur, mr);
|
public async Task DoAction(UpdateResult ur, MessageResult mr) => await Action(_lastValue.Value, ur, mr);
|
||||||
|
|
||||||
|
|
||||||
public static CallbackData GetCallback(string method, Guid guid) => new CallbackData(method, guid.ToString());
|
public static CallbackData GetCallback(string method, Guid guid) => new CallbackData(method, guid.ToString());
|
||||||
|
|||||||
@ -22,7 +22,7 @@ namespace DemoBot.ActionManager.Actions
|
|||||||
public bool DoesFit(string raw_data) => raw_data.StartsWith(SearchForString);
|
public bool DoesFit(string raw_data) => raw_data.StartsWith(SearchForString);
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr) => await Action(raw_data, ur, mr);
|
public async Task DoAction(UpdateResult ur, MessageResult mr) => await Action(mr.RawData, ur, mr);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@ namespace DemoBot.ActionManager
|
|||||||
{
|
{
|
||||||
bool DoesFit(string raw_data);
|
bool DoesFit(string raw_data);
|
||||||
|
|
||||||
Task DoAction(String raw_data, UpdateResult ur, MessageResult mr);
|
Task DoAction(UpdateResult ur, MessageResult mr);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,15 +23,15 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
public bool DoesFit(string raw_data) => raw_data.EndsWith(Value);
|
public bool DoesFit(string raw_data) => raw_data.EndsWith(Value);
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
var new_form = FormType.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as FormBase;
|
var new_form = FormType.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as FormBase;
|
||||||
|
|
||||||
if (raw_data != null)
|
if (mr.RawData != null)
|
||||||
{
|
{
|
||||||
SetProperty(new_form, raw_data);
|
SetProperty(new_form, mr.RawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ur.Device.ActiveForm.NavigateTo(new_form);
|
await ur.Device.ActiveForm.NavigateTo(new_form);
|
||||||
@ -55,7 +55,7 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
public bool DoesFit(string raw_data) => raw_data.EndsWith(Value);
|
public bool DoesFit(string raw_data) => raw_data.EndsWith(Value);
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
@ -63,9 +63,9 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
|
|
||||||
TForm new_form = type.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as TForm;
|
TForm new_form = type.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as TForm;
|
||||||
|
|
||||||
if (raw_data != null)
|
if (mr.RawData != null)
|
||||||
{
|
{
|
||||||
SetProperty(new_form, raw_data);
|
SetProperty(new_form, mr.RawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ur.Device.ActiveForm.NavigateTo(new_form);
|
await ur.Device.ActiveForm.NavigateTo(new_form);
|
||||||
|
|||||||
@ -40,7 +40,7 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
|
|||||||
@ -22,15 +22,15 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
|
|
||||||
public bool DoesFit(string raw_data) => raw_data.StartsWith(Value);
|
public bool DoesFit(string raw_data) => raw_data.StartsWith(Value);
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
var new_form = FormType.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as FormBase;
|
var new_form = FormType.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as FormBase;
|
||||||
|
|
||||||
if (raw_data != null)
|
if (mr.RawData != null)
|
||||||
{
|
{
|
||||||
SetProperty(new_form, raw_data);
|
SetProperty(new_form, mr.RawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ur.Device.ActiveForm.NavigateTo(new_form);
|
await ur.Device.ActiveForm.NavigateTo(new_form);
|
||||||
@ -54,7 +54,7 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
public bool DoesFit(string raw_data) => raw_data.StartsWith(Value);
|
public bool DoesFit(string raw_data) => raw_data.StartsWith(Value);
|
||||||
|
|
||||||
|
|
||||||
public async Task DoAction(String raw_data, UpdateResult ur, MessageResult mr)
|
public async Task DoAction(UpdateResult ur, MessageResult mr)
|
||||||
{
|
{
|
||||||
await mr.ConfirmAction();
|
await mr.ConfirmAction();
|
||||||
|
|
||||||
@ -62,9 +62,9 @@ namespace DemoBot.ActionManager.Navigation
|
|||||||
|
|
||||||
TForm new_form = type.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as TForm;
|
TForm new_form = type.GetConstructor(new Type[] { })?.Invoke(new object[] { }) as TForm;
|
||||||
|
|
||||||
if (raw_data != null)
|
if (mr.RawData != null)
|
||||||
{
|
{
|
||||||
SetProperty(new_form, raw_data);
|
SetProperty(new_form, mr.RawData);
|
||||||
}
|
}
|
||||||
|
|
||||||
await ur.Device.ActiveForm.NavigateTo(new_form);
|
await ur.Device.ActiveForm.NavigateTo(new_form);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user