Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@
secureString.MakeReadOnly();
return secureString;
}
#endregion

#region Remote IIS Management Helper Methods
private bool IsLocalServer()
Expand Down Expand Up @@ -1486,8 +1487,8 @@
);

// 设置连接超时和操作超时
connectionInfo.OperationTimeout = TimeSpan.FromMinutes(2);

Check failure on line 1490 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1490 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1490 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1490 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'
connectionInfo.OpenTimeout = TimeSpan.FromSeconds(30);

Check failure on line 1491 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1491 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1491 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

Check failure on line 1491 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot implicitly convert type 'System.TimeSpan' to 'int'

using (var runspace = RunspaceFactory.CreateRunspace(connectionInfo))
{
Expand All @@ -1512,7 +1513,7 @@
}
}, cancellationToken);
}
catch (PSRemotingTransportException ex)

Check failure on line 1516 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'PSRemotingTransportException' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1516 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'PSRemotingTransportException' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1516 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'PSRemotingTransportException' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1516 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'PSRemotingTransportException' could not be found (are you missing a using directive or an assembly reference?)
{
lastException = ex;
Log($"远程PowerShell连接失败 (尝试 {attempt}/{maxRetries}) - 请检查WinRM服务是否启用: {ex.Message}");
Expand Down Expand Up @@ -1543,9 +1544,9 @@
#endregion

#region INotifyPropertyChanged 实现
public event PropertyChangedEventHandler PropertyChanged;

Check warning on line 1547 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler MainWindow.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 1547 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler MainWindow.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)

Check warning on line 1549 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 1549 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Expand All @@ -1555,7 +1556,7 @@
#region 数据模型
public class FileReplaceRule : INotifyPropertyChanged
{
private string _sourcePattern;

Check warning on line 1559 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field '_sourcePattern' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.

Check warning on line 1559 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field '_sourcePattern' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
private string _targetPath;

public string SourcePattern
Expand All @@ -1570,9 +1571,9 @@
set { _targetPath = value; OnPropertyChanged(); }
}

public event PropertyChangedEventHandler PropertyChanged;

Check warning on line 1574 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler FileReplaceRule.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 1574 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler FileReplaceRule.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)

Check warning on line 1576 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 1576 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Expand All @@ -1595,9 +1596,9 @@
set { _continueOnError = value; OnPropertyChanged(); }
}

public event PropertyChangedEventHandler PropertyChanged;

Check warning on line 1599 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler SqlScript.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 1599 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler SqlScript.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)

Check warning on line 1601 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 1601 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Expand Down Expand Up @@ -1641,9 +1642,9 @@
set { _updateService = value; OnPropertyChanged(); }
}

public event PropertyChangedEventHandler PropertyChanged;

Check warning on line 1645 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler WindowsService.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

Check warning on line 1645 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of 'event PropertyChangedEventHandler WindowsService.PropertyChanged' doesn't match implicitly implemented member 'event PropertyChangedEventHandler? INotifyPropertyChanged.PropertyChanged'.

protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)

Check warning on line 1647 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.

Check warning on line 1647 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Cannot convert null literal to non-nullable reference type.
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
Expand Down Expand Up @@ -1692,7 +1693,7 @@

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (bool)value ? Enum.Parse(targetType, parameter?.ToString()) : System.Windows.Data.Binding.DoNothing;

Check warning on line 1696 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'object Enum.Parse(Type enumType, string value)'.

Check warning on line 1696 in MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 'value' in 'object Enum.Parse(Type enumType, string value)'.
}
}
#endregion
Expand Down
Loading