write shit
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Microsoft.VisualBasic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -15,7 +16,7 @@ namespace BallanceTASEditor.UI {
|
||||
if (!(bool)op.ShowDialog()) return "";
|
||||
return op.FileName;
|
||||
}
|
||||
|
||||
|
||||
public static string SaveFileDialog() {
|
||||
Microsoft.Win32.SaveFileDialog op = new Microsoft.Win32.SaveFileDialog();
|
||||
op.RestoreDirectory = true;
|
||||
@ -29,5 +30,17 @@ namespace BallanceTASEditor.UI {
|
||||
return (result == MessageBoxResult.Yes);
|
||||
}
|
||||
|
||||
public static bool InputNumber(string title, int min, int max, ref int result) {
|
||||
while (true) {
|
||||
var dialog = Interaction.InputBox(title, "Input number", "");
|
||||
if (dialog == "") return false;
|
||||
if (int.TryParse(dialog, out result)) {
|
||||
if (result <= max && result >= min) break;
|
||||
}
|
||||
MessageBox.Show("Invalid number. Please input again", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user