Skip to content

Commit 6d1ecf3

Browse files
committed
We have DI for absolutely no reason
1 parent d096d84 commit 6d1ecf3

File tree

22 files changed

+704
-436
lines changed

22 files changed

+704
-436
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,26 @@
33

44
So, what is **WriterSharp**?
55

6-
Well, long time ago *(it was only 3 years)*, I created a Python program with a GUI called [**WriterClassic**](https://github.com/MF366-Coding/WriterClassic). It was a basic text editor that evolved into something special - at least for me.
6+
Well, long time ago *(it was only 3 years)*, I created a Python program with a GUI called [**WriterClassic
7+
**](https://github.com/MF366-Coding/WriterClassic). It was a basic text editor that evolved into something special - at
8+
least for me.
79

8-
It was my biggest project for quite a while and it was also... my first actual programming project. I mean, public at least.
10+
It was my biggest project for quite a while and it was also... my first actual programming project. I mean, public at
11+
least.
912

10-
I ended up releasing 11 major versions for it and almost released v12.0.0, but I couldn't. The codebase was old and unorganized and it was getting increasingly hard to maintain WriterClassic.
13+
I ended up releasing 11 major versions for it and almost released v12.0.0, but I couldn't. The codebase was old and
14+
unorganized and it was getting increasingly hard to maintain WriterClassic.
1115

12-
So, **WriterSharp** was born. WriterSharp (please don't write **Writer#** - it's cursed) is WriterClassic but in C#, with a more modern look and better cross-platform compatibility.
16+
So, **WriterSharp** was born. WriterSharp (please don't write **Writer#** - it's cursed) is WriterClassic but in C#,
17+
with a more modern look and better cross-platform compatibility.
1318

14-
I also made the decision of not dropping the WriterClassic logo for a new one, because **A) It was made by a friend** and **B) It's *classic* :)**.
19+
I also made the decision of not dropping the WriterClassic logo for a new one, because **A) It was made by a friend**
20+
and **B) It's *classic* :)**.
1521

1622
## New Site
17-
WriterSharp now has a new site, on which you can find devlogs and other _cool_ WriterSharp-related content. Check it out at [https://mf366-coding.github.io/WriterSharp/](https://mf366-coding.github.io/WriterSharp/index.html)!
23+
WriterSharp now has a new site, on which you can find devlogs and other _cool_ WriterSharp-related content. Check it out
24+
at [https://mf366-coding.github.io/WriterSharp/](https://mf366-coding.github.io/WriterSharp/index.html)!
1825

1926
> **Made by MF366 with :heart:**
20-
>
27+
>
2128
> Copyright (c) 2025 MF366

WriterSharp.Core/Class1.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
namespace WriterSharp.Core
22
{
33

4-
public class Class1
5-
{
6-
7-
8-
9-
}
4+
public class Class1 { }
105

116
}

WriterSharp.Exceptions/IO/WriterSharpIOException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class WriterSharpIOException : WriterSharpException
1313
/// <summary>
1414
/// Initializes a new instance of the <see cref="WriterSharpIOException" /> class.
1515
/// </summary>
16-
public WriterSharpIOException() : base() { }
16+
public WriterSharpIOException() { }
1717

1818
/// <summary>
1919
/// Initializes a new instance of the <see cref="WriterSharpIOException" />

WriterSharp.Exceptions/Security/SecurityException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class SecurityException : WriterSharpException
1313
/// <summary>
1414
/// Initializes a new instance of the <see cref="SecurityException" /> class.
1515
/// </summary>
16-
public SecurityException() : base() { }
16+
public SecurityException() { }
1717

1818
/// <summary>
1919
/// Initializes a new instance of the <see cref="SecurityException" />

WriterSharp.Exceptions/WriterSharpException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class WriterSharpException : Exception
1313
/// <summary>
1414
/// Initializes a new instance of the <see cref="WriterSharpException" /> class.
1515
/// </summary>
16-
public WriterSharpException() : base() { }
16+
public WriterSharpException() { }
1717

1818
/// <summary>
1919
/// Initializes a new instance of the <see cref="WriterSharpException" />
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using System;
2+
using System.Reflection;
3+
using System.Threading;
4+
using System.Threading.Tasks;
5+
6+
7+
namespace WriterSharp.PluginApi.DependencyInjection
8+
{
9+
10+
/// <summary>
11+
/// Dependency injector for WriterSharp plugins.
12+
/// </summary>
13+
public interface IDependencyInjector
14+
{
15+
16+
/// <summary>
17+
/// Injects a plugin into WriterSharp.
18+
/// </summary>
19+
/// <param name="assembly">The assembly in which the plugin is located</param>
20+
/// <returns><c>true</c> if successful</returns>
21+
Task<bool> InjectPluginAsync(Assembly assembly);
22+
23+
/// <summary>
24+
/// Injects a plugin into WriterSharp.
25+
/// </summary>
26+
/// <param name="assembly">The assembly in which the plugin is located</param>
27+
/// <param name="cancellationToken">The cancellation token to use</param>
28+
/// <returns><c>true</c> if successful</returns>
29+
Task<bool> InjectPluginAsync(Assembly assembly, CancellationToken cancellationToken);
30+
31+
/// <summary>
32+
/// Injects a plugin into WriterSharp.
33+
/// </summary>
34+
/// <param name="type">The class of the plugin</param>
35+
/// <returns><c>true</c> if successful</returns>
36+
Task<bool> InjectPluginAsync(Type type);
37+
38+
/// <summary>
39+
/// Injects a plugin into WriterSharp.
40+
/// </summary>
41+
/// <param name="type">The class of the plugin</param>
42+
/// <param name="cancellationToken">The cancellation token to use</param>
43+
/// <returns><c>true</c> if successful</returns>
44+
Task<bool> InjectPluginAsync(Type type, CancellationToken cancellationToken);
45+
46+
}
47+
48+
}

WriterSharp.PluginApi/FileSystem/IFile.cs

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

0 commit comments

Comments
 (0)