Code Cleanup

This commit is contained in:
ema
2025-05-25 03:45:07 +08:00
parent 51a46155d7
commit eed0c53e9c
4 changed files with 8 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ namespace QuickLook.Plugin.CLSIDViewer;
public partial class RecycleBinPanel : UserControl, INotifyPropertyChanged
{
private ContextObject _context;
private readonly ContextObject _context;
private RecycleBinHelper.RecycleBinInfo _info;
private ICommand _emptyRecycleBinCommand;

View File

@@ -23,7 +23,7 @@ namespace QuickLook.Plugin.CLSIDViewer;
public partial class ThisPCPanel : UserControl
{
private ContextObject _context;
private readonly ContextObject _context;
public ThisPCPanel(ContextObject context)
{

View File

@@ -99,7 +99,7 @@ public class TextViewerPanel : TextEditor, IDisposable
e.TranslationBehavior = new InertiaTranslationBehavior
{
InitialVelocity = e.InitialVelocities.LinearVelocity,
DesiredDeceleration = 10.0 * 96.0 / (1000.0 * 1000.0)
DesiredDeceleration = 10d * 96d / (1000d * 1000d)
};
}
@@ -148,10 +148,10 @@ public class TextViewerPanel : TextEditor, IDisposable
private void LoadFileAsync(string path)
{
Task.Run(() =>
_ = Task.Run(() =>
{
const int maxLength = 5 * 1024 * 1024;
const int maxHighlightingLength = (int)(0.5 * 1024 * 1024);
const int maxHighlightingLength = (int)(0.5d * 1024 * 1024);
var buffer = new MemoryStream();
bool fileTooLong;
@@ -187,7 +187,7 @@ public class TextViewerPanel : TextEditor, IDisposable
if (_disposed)
return;
Dispatcher.BeginInvoke(new Action(() =>
Dispatcher.BeginInvoke(() =>
{
Encoding = encoding;
SyntaxHighlighting = bufferCopy.Length > maxHighlightingLength
@@ -196,7 +196,7 @@ public class TextViewerPanel : TextEditor, IDisposable
Document = doc;
_context.IsBusy = false;
}), DispatcherPriority.Render);
}, DispatcherPriority.Render);
});
}
}

View File

@@ -34,8 +34,8 @@ namespace QuickLook.Plugin.VideoViewer.AudioTrack;
internal class MidiPlayer : IDisposable, INotifyPropertyChanged
{
private ViewerPanel _vp;
private ContextObject _context;
private ViewerPanel _vp;
private MidiFile _midiFile;
private OutputDevice _outputDevice;
private Playback _playback;