remove all destructors

This commit is contained in:
Paddy Xu
2018-01-24 19:11:16 +02:00
parent 4b9b6c7233
commit 76dd2feb30
15 changed files with 4 additions and 70 deletions

View File

@@ -37,11 +37,6 @@ namespace QuickLook.Plugin.ArchiveViewer
IconManager.ClearCache(); IconManager.ClearCache();
} }
~ArchiveFileListView()
{
Dispose();
}
public void SetDataContext(object context) public void SetDataContext(object context)
{ {
treeGrid.DataContext = context; treeGrid.DataContext = context;

View File

@@ -74,11 +74,6 @@ namespace QuickLook.Plugin.ArchiveViewer
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
~ArchiveInfoPanel()
{
Dispose();
}
private void BeginLoadArchive(string path) private void BeginLoadArchive(string path)
{ {
new Task(() => new Task(() =>

View File

@@ -62,10 +62,5 @@ namespace QuickLook.Plugin.ArchiveViewer
_panel?.Dispose(); _panel?.Dispose();
_panel = null; _panel = null;
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -58,10 +58,5 @@ namespace QuickLook.Plugin.CsvViewer
_panel = null; _panel = null;
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -63,10 +63,5 @@ namespace QuickLook.Plugin.HtmlViewer
_panel?.Dispose(); _panel?.Dispose();
_panel = null; _panel = null;
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -75,10 +75,5 @@ namespace QuickLook.Plugin.IPreviewHandlers
_panel?.Dispose(); _panel?.Dispose();
_panel = null; _panel = null;
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -81,10 +81,5 @@ namespace QuickLook.Plugin.MailViewer
throw new Exception($"{path} is not a valid msg file."); throw new Exception($"{path} is not a valid msg file.");
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -63,11 +63,6 @@ namespace QuickLook.Plugin.MarkdownViewer
_panel = null; _panel = null;
} }
~Plugin()
{
Cleanup();
}
private string GenerateMarkdownHtml(string path) private string GenerateMarkdownHtml(string path)
{ {
var md = File.ReadAllText(path); var md = File.ReadAllText(path);

View File

@@ -94,11 +94,6 @@ namespace QuickLook.Plugin.PDFViewer
ReRenderCurrentPage(); ReRenderCurrentPage();
} }
~PdfViewerControl()
{
Dispose();
}
public event EventHandler CurrentPageChanged; public event EventHandler CurrentPageChanged;
private void NavigatePage(object sender, int delta) private void NavigatePage(object sender, int delta)

View File

@@ -103,10 +103,5 @@ namespace QuickLook.Plugin.PDFViewer
{ {
_context.Title = $"{Path.GetFileName(_path)} ({_pdfControl.CurrentPage + 1} / {_pdfControl.TotalPages})"; _context.Title = $"{Path.GetFileName(_path)} ({_pdfControl.CurrentPage + 1} / {_pdfControl.TotalPages})";
} }
~Plugin()
{
Cleanup();
}
} }
} }

View File

@@ -238,11 +238,6 @@ namespace QuickLook.Plugin.VideoViewer
mediaElement.Play(); mediaElement.Play();
} }
~ViewerPanel()
{
Dispose();
}
[NotifyPropertyChangedInvocator] [NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{ {

View File

@@ -130,11 +130,6 @@ namespace QuickLook.Controls.BusyDecorator
Math.Max(ret.Height, _busyHost.RenderSize.Height)); Math.Max(ret.Height, _busyHost.RenderSize.Height));
} }
~BusyDecorator()
{
Dispose();
}
#region IsBusyIndicatorShowing Property #region IsBusyIndicatorShowing Property
/// <summary> /// <summary>

View File

@@ -48,11 +48,6 @@ namespace QuickLook
internal event KeyEventHandler KeyDown; internal event KeyEventHandler KeyDown;
internal event KeyEventHandler KeyUp; internal event KeyEventHandler KeyUp;
~GlobalKeyboardHook()
{
Dispose();
}
internal static GlobalKeyboardHook GetInstance() internal static GlobalKeyboardHook GetInstance()
{ {
return _instance ?? (_instance = new GlobalKeyboardHook()); return _instance ?? (_instance = new GlobalKeyboardHook());

View File

@@ -85,10 +85,14 @@ namespace QuickLook.Helpers
var notes = string.Empty; var notes = string.Empty;
var count = 0;
foreach (var item in json) foreach (var item in json)
{ {
notes += $"# {item["name"]}\r\n\r\n"; notes += $"# {item["name"]}\r\n\r\n";
notes += item["body"] + "\r\n\r\n"; notes += item["body"] + "\r\n\r\n";
if (count++ > 10)
break;
} }
var changeLogPath = Path.GetTempFileName() + ".md"; var changeLogPath = Path.GetTempFileName() + ".md";

View File

@@ -152,11 +152,6 @@ namespace QuickLook
} }
} }
~PipeServerManager()
{
Dispose();
}
public static PipeServerManager GetInstance() public static PipeServerManager GetInstance()
{ {
return _instance ?? (_instance = new PipeServerManager()); return _instance ?? (_instance = new PipeServerManager());