Skip to content

Commit

Permalink
chore: 细节调整
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetSmellFox committed Jan 23, 2025
1 parent 45e79b6 commit 6987896
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 5 additions & 4 deletions Custom/CustomPasswordBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,25 @@ public class CustomPasswordBox : PasswordBox
private const string ElementPasswordBox = "PART_PasswordBox";

private const string ElementTextBox = "PART_TextBox";


private TextBox _textBox;

public CustomPasswordBox()
{
Style = FindResource("PasswordBoxPlusBaseStyle") as Style;
}

public override void OnApplyTemplate()
{
Type type = typeof(PasswordBox);


var textBoxField = type.GetField("_textBox", BindingFlags.NonPublic | BindingFlags.Instance);
if (textBoxField != null)
{
_textBox = (TextBox)textBoxField.GetValue(this);
if (textBoxField.GetValue(this) is TextBox textBox)
_textBox = textBox;
}
if (ActualPasswordBox != null)
ActualPasswordBox.PasswordChanged -= PasswordBox_PasswordChanged;
Expand Down
2 changes: 1 addition & 1 deletion MFAWPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<!-- Ignore Warings -->
<PropertyGroup>
<NoWarn>NU1602;NU1701;CS0169;CS0612;CS0618;CS1998;CS4014;CS8618;CS8601;CS8602;CS8603;CS8604</NoWarn>
<NoWarn>NU1602;NU1701;CS0169;CS0612;CS0618;CS1998;CS4014;CS8618;CS8601;CS8602;CS8603;CS8604;SYSLIB0014</NoWarn>
</PropertyGroup>

<!-- Version -->
Expand Down
10 changes: 5 additions & 5 deletions Utils/VersionChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ public async void UpdateResourceWithMirrorApi(bool closeDialog = false, bool noD
SetText("GettingLatestResources", dialog, noDialog);


string resId = GetResourceID();
string currentVersion = GetResourceVersion();
string cdk = DataSet.GetData("DownloadCDK", string.Empty);
string spId = GetDeviceId().ToString();
var resId = GetResourceID();
var currentVersion = GetResourceVersion();
var cdk = DataSet.GetData("DownloadCDK", string.Empty);
var spId = GetDeviceId().ToString();
dialog?.UpdateProgress(10);
if (string.IsNullOrWhiteSpace(currentVersion) || string.IsNullOrWhiteSpace(resId))
{
Expand Down Expand Up @@ -375,7 +375,7 @@ public void CheckResourceVersionWithMirrorApi()
if ((int)responseData["code"] == 0)
{
var data = responseData["data"];
string versionName = data["version_name"]?.ToString();
var versionName = data["version_name"]?.ToString();

if (!string.IsNullOrEmpty(versionName))
{
Expand Down

0 comments on commit 6987896

Please sign in to comment.