Fixing some compiler warnings
This commit is contained in:
@@ -13,7 +13,7 @@ namespace InlineAndReplyCombination.Forms
|
||||
{
|
||||
public class StartForm : AutoCleanForm
|
||||
{
|
||||
ButtonGrid buttonGrid;
|
||||
ButtonGrid? buttonGrid;
|
||||
|
||||
public StartForm()
|
||||
{
|
||||
@@ -21,7 +21,7 @@ namespace InlineAndReplyCombination.Forms
|
||||
|
||||
}
|
||||
|
||||
private async Task StartForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
private Task StartForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
{
|
||||
var bf = new ButtonForm();
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace InlineAndReplyCombination.Forms
|
||||
|
||||
AddControl(buttonGrid);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task ButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
public class MainForm : MultipleChoiceForm
|
||||
{
|
||||
|
||||
ButtonGrid InlineButtonGrid;
|
||||
ButtonGrid? InlineButtonGrid;
|
||||
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs = null;
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs;
|
||||
|
||||
static MainForm()
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
CurrentStep = 1;
|
||||
}
|
||||
|
||||
private async Task MainForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
private Task MainForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
{
|
||||
|
||||
//Inline Keyboard
|
||||
@@ -61,6 +61,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
AddControl(InlineButtonGrid);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
|
||||
@@ -72,7 +73,12 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
return;
|
||||
}
|
||||
|
||||
this.UserDetails.AgeRange = e.Button?.Value ?? "unknown";
|
||||
if (UserDetails == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UserDetails.AgeRange = e.Button?.Value ?? "unknown";
|
||||
|
||||
var sf = new SecondForm();
|
||||
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
public class SecondForm : MultipleChoiceForm
|
||||
{
|
||||
|
||||
ButtonGrid InlineButtonGrid;
|
||||
ButtonGrid? InlineButtonGrid;
|
||||
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs = null;
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs;
|
||||
|
||||
static SecondForm()
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
}
|
||||
|
||||
private async Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
private Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
{
|
||||
|
||||
//Inline Keyboard
|
||||
@@ -60,6 +60,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
AddControl(InlineButtonGrid);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
|
||||
@@ -71,7 +72,12 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
return;
|
||||
}
|
||||
|
||||
this.UserDetails.FavouriteColor = e.Button?.Value ?? "unknown";
|
||||
if (UserDetails == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UserDetails.FavouriteColor = e.Button?.Value ?? "unknown";
|
||||
|
||||
var tf = new ThirdForm();
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
public class Summary : AutoCleanForm
|
||||
{
|
||||
[SaveState]
|
||||
public UserDetails UserDetails { get; set; }
|
||||
public UserDetails? UserDetails { get; set; }
|
||||
|
||||
ButtonGrid ReplyButtonGrid { get; set; }
|
||||
ButtonGrid? ReplyButtonGrid { get; set; }
|
||||
|
||||
public Summary()
|
||||
{
|
||||
@@ -24,7 +24,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
}
|
||||
|
||||
private async Task Summary_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
private Task Summary_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
{
|
||||
var bf = new ButtonForm();
|
||||
|
||||
@@ -39,6 +39,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
AddControl(ReplyButtonGrid);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override async Task Load(MessageResult message)
|
||||
|
||||
@@ -15,9 +15,9 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
public class ThirdForm : MultipleChoiceForm
|
||||
{
|
||||
|
||||
ButtonGrid InlineButtonGrid;
|
||||
ButtonGrid? InlineButtonGrid;
|
||||
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs = null;
|
||||
public static List<Tuple<String, String>> AllowedInlineInputs;
|
||||
|
||||
static ThirdForm()
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
}
|
||||
|
||||
private async Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
private Task SecondForm_Init(object sender, TelegramBotBase.Args.InitEventArgs e)
|
||||
{
|
||||
|
||||
//Inline Keyboard
|
||||
@@ -59,6 +59,7 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
|
||||
AddControl(InlineButtonGrid);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
private async Task InlineButtonGrid_ButtonClicked(object sender, TelegramBotBase.Args.ButtonClickedEventArgs e)
|
||||
@@ -70,7 +71,12 @@ namespace InlineAndReplyCombination.Forms.Steps
|
||||
return;
|
||||
}
|
||||
|
||||
this.UserDetails.FavouriteCity = e.Button?.Value ?? "unknown";
|
||||
if (UserDetails == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
UserDetails.FavouriteCity = e.Button?.Value ?? "unknown";
|
||||
|
||||
var sum = new Summary();
|
||||
sum.UserDetails = this.UserDetails;
|
||||
|
||||
Reference in New Issue
Block a user