初始化上传

This commit is contained in:
2025-08-26 08:37:44 +08:00
commit 31d81b91b6
448 changed files with 80981 additions and 0 deletions

View File

@@ -0,0 +1,70 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using System;
using Ursa.Controls;
namespace ;
public partial class : UserControl
{
public ()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
string strAngle = txtAngle.Text;
double angle;
bool flag = double.TryParse(strAngle, out angle);
if (!flag)
{
MessageBox.ShowAsync("请输入0~360之间的数字");
return;
}
if (angle < 0 || angle > 360)
{
MessageBox.ShowAsync("请输入0~360之间的数字");
return;
}
double rad = angle * (Math.PI / 180);
txtRad.Text = string.Format("{0:N6}", rad);
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
string strRad = txtRad.Text;
double rad;
bool flag = double.TryParse(strRad, out rad);
if (!flag)
{
MessageBox.ShowAsync("请输入0~2Π之间的数字");
return;
}
if (rad < 0 || rad > (2 * Math.PI))
{
MessageBox.ShowAsync("请输入0~2Π之间的数字");
return;
}
double angle = rad * 180 / Math.PI;
txtAngle.Text = string.Format("{0:N6}", angle);
}
private void txtAngle_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Button_Click(sender, null);
}
}
private void txtRad_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter)
{
Button_Click_1(sender, null);
}
}
}