public Animation(MainWindow _window)
{
window = _window;
//initialize animation
taRect.BeginTime = new TimeSpan(0);
taRect.EasingFunction = new CircleEase();
}
private void OpenOptions(object sender, RoutedEventArgs e)
{
RadioButton radioButton = sender as RadioButton;
radioButton.IsChecked = true;
//Disable all option buttons except one that active
window.MyGrid.Children.OfType<RadioButton>().Where(rb => rb != radioButton && rb.GroupName == radioButton.GroupName).ToList().ForEach(rb => rb.IsEnabled = false);
}
group.getToggles().stream().map((toggle) -> (ToggleButton) toggle).forEach((b) -> {
b.setDisable(false);
});
namespace Toolkits
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
HotKeys hk = new HotKeys(this);
}
}
}
using System;
using System.Windows;
using System.Windows.Input;
namespace Toolkits
{
public class HotKeys
{
private MainWindow window;
public HotKeys(MainWindow _window)
{
window = _window;
window.ResizeMode = ResizeMode.NoResize;
window.WindowStyle = WindowStyle.None;
window.WindowState = WindowState.Maximized;
window.PreviewKeyDown +=
(s, e) =>
{
if (((Keyboard.Modifiers & ModifierKeys.Alt) == ModifierKeys.Alt) && Keyboard.IsKeyDown(Key.Enter))
{
if (window.WindowStyle == WindowStyle.SingleBorderWindow)
{
window.ResizeMode = ResizeMode.NoResize;
window.WindowStyle = WindowStyle.None;
window.WindowState = WindowState.Maximized;
e.Handled = true;
}
else
{
window.ResizeMode = ResizeMode.CanResize;
window.WindowStyle = WindowStyle.SingleBorderWindow;
window.WindowState = WindowState.Normal;
e.Handled = true;
}
}
};
}
}
}
public class Database {
private static Connection connection;
public static Connection getConnection() throws SQLException {
try {
Properties prop = new Properties();
prop.load(new FileInputStream("db.properties"));
if (prop == null) {
System.out.println("File db.properties not found!");
}
final String DB_URL = prop.getProperty("url");
final String DB_USER = prop.getProperty("user");
final String DB_PASSWORD = prop.getProperty("password");
connection = DriverManager.getConnection(DB_URL, DB_USER, DB_PASSWORD);
} catch (IOException ex) {
ex.printStackTrace();
}
return connection;
}
}
int labelSize = label.getText().length();
int fontSize = 100;
if (labelSize > 300) {
lb_randomCard.setFont(new Font("HeronSansCond SemiBold", fontSize-50));
}
я делал правой кнопкой мыши на Toolkits.exe - снять задачу