Skip to content

Commit bee2739

Browse files
committed
[*]Improved memory usage
[*]Improved general performance [*]Improved code
1 parent 217f4cd commit bee2739

File tree

5 files changed

+85
-170
lines changed

5 files changed

+85
-170
lines changed

DeadLock/Classes/ListViewLocker.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace DeadLock.Classes
2020
/// <summary>
2121
/// Represents the collection of a path, the ProcessLockers of that path and a CancellationTokenSource to cancel a task.
2222
/// </summary>
23-
internal class ListViewLocker
23+
internal class ListViewLocker : ListViewItem
2424
{
2525
#region Variables
2626
private readonly string _path;
@@ -38,8 +38,13 @@ internal class ListViewLocker
3838
/// </summary>
3939
/// <param name="path">The path to a file.</param>
4040
/// <param name="language">The current Language.</param>
41-
internal ListViewLocker(string path, Language language)
41+
/// <param name="imageIndex">ListViewLocker image index.</param>
42+
internal ListViewLocker(string path, Language language, int imageIndex)
4243
{
44+
Text = path;
45+
UseItemStyleForSubItems = false;
46+
ImageIndex = imageIndex;
47+
4348
_path = path;
4449
_lockers = new List<ProcessLocker>();
4550
_cts = new CancellationTokenSource();
@@ -396,7 +401,7 @@ await Task.Run(() =>
396401
/// A task to remove the file or folder that is associated with the ListViewLocker.
397402
/// </summary>
398403
/// <returns>A boolean to represent whether the operation was successful or not.</returns>
399-
internal async Task<bool> Remove()
404+
internal async Task<bool> RemoveItem()
400405
{
401406
await Unlock();
402407
try

DeadLock/Classes/ListViewLockerManager.cs

Lines changed: 0 additions & 74 deletions
This file was deleted.

DeadLock/DeadLock.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
<Compile Include="Classes\Language.cs" />
6262
<Compile Include="Classes\LanguageManager.cs" />
6363
<Compile Include="Classes\ListViewLocker.cs" />
64-
<Compile Include="Classes\ListViewLockerManager.cs" />
6564
<Compile Include="Classes\NativeMethods.cs" />
6665
<Compile Include="Classes\ProcessLocker.cs" />
6766
<Compile Include="Classes\Update.cs" />

DeadLock/Forms/FrmMain.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)