Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit dd249ff

Browse files
committed
Remove plugins-related code
1 parent 3e0d0d0 commit dd249ff

8 files changed

+6
-140
lines changed

Toastify.sln

-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Installation", "Installatio
1212
EndProject
1313
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Toastify", "Toastify\Toastify.csproj", "{CCC4A761-56D2-4188-807F-F7A547DFB031}"
1414
EndProject
15-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExamplePlugin", "ExamplePlugin\ExamplePlugin.csproj", "{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}"
16-
EndProject
1715
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToastifyAPI", "ToastifyAPI\ToastifyAPI.csproj", "{5D68931F-528F-4D95-89BE-3EB26832AF8C}"
1816
EndProject
1917
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Files", "Solution Files", "{39A4F7F1-FC00-4249-832A-47B4AF287F80}"
@@ -67,14 +65,6 @@ Global
6765
{CCC4A761-56D2-4188-807F-F7A547DFB031}.zzz_ToastifyAPI (UWP)|Any CPU.Build.0 = Windows (Debug)|Any CPU
6866
{CCC4A761-56D2-4188-807F-F7A547DFB031}.zzz_ToastifyAPI (UWP)|x64.ActiveCfg = Windows (Debug)|x64
6967
{CCC4A761-56D2-4188-807F-F7A547DFB031}.zzz_ToastifyAPI (UWP)|x64.Build.0 = Windows (Debug)|x64
70-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Debug)|Any CPU.ActiveCfg = Debug|Any CPU
71-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Debug)|x64.ActiveCfg = Debug|x64
72-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Release)|Any CPU.ActiveCfg = Release|Any CPU
73-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Release)|x64.ActiveCfg = Release|x64
74-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Test Release)|Any CPU.ActiveCfg = Release|Any CPU
75-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.Win (Test Release)|x64.ActiveCfg = Release|x64
76-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.zzz_ToastifyAPI (UWP)|Any CPU.ActiveCfg = Debug|Any CPU
77-
{68F1A17D-4930-4EEC-AEEF-5DD9C9033B40}.zzz_ToastifyAPI (UWP)|x64.ActiveCfg = Debug|x64
7868
{5D68931F-528F-4D95-89BE-3EB26832AF8C}.Win (Debug)|Any CPU.ActiveCfg = Windows (Debug)|Any CPU
7969
{5D68931F-528F-4D95-89BE-3EB26832AF8C}.Win (Debug)|Any CPU.Build.0 = Windows (Debug)|Any CPU
8070
{5D68931F-528F-4D95-89BE-3EB26832AF8C}.Win (Debug)|x64.ActiveCfg = Windows (Debug)|x64

Toastify/post-build.cmd

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ IF EXIST _dependencies (
4747

4848
REM Build ToastifyWebAuthAPI's PreBuildTool
4949
ECHO [POST-BUILD] - PreBuildTool
50-
msbuild PreBuildTool\PreBuildTool.vcxproj /t:Clean,Build /p:Configuration=Release /p:Platform=x64 >"PreBuildTool\bin\x64\Release\build.log""
50+
MKDIR "PreBuildTool\bin\x64\Release"
51+
msbuild PreBuildTool\PreBuildTool.vcxproj /t:Clean,Build /p:Configuration=Release /p:Platform=x64 >"PreBuildTool\bin\x64\Release\build.log"
5152
IF NOT EXIST "PreBuildTool\bin\x64\Release\PreBuildTool.exe" (
5253
ECHO;
5354
ECHO ERROR: Build failed^^! See "!ToastifyWebAuthAPI_Path!\PreBuildTool\bin\x64\Release\build.log"
@@ -68,6 +69,7 @@ IF EXIST _dependencies (
6869

6970
REM Build ToastifyWebAuthAPI
7071
ECHO [POST-BUILD] - ToastifyWebAuthAPI
72+
MKDIR "ToastifyWebAuthAPI\bin\x64\%Configuration%"
7173
msbuild ToastifyWebAuthAPI\ToastifyWebAuthAPI.vcxproj /t:Clean,Build /p:Configuration=%Configuration% /p:Platform=x64 >"ToastifyWebAuthAPI\bin\x64\%Configuration%\build.log""
7274
IF NOT EXIST "ToastifyWebAuthAPI\bin\x64\%Configuration%\ToastifyWebAuthAPI.dll" (
7375
ECHO;

Toastify/src/Events/SpotifyTrackChangedEventArgs.cs

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using ToastifyAPI.Model.Interfaces;
33

44
namespace Toastify.Events
@@ -17,14 +17,5 @@ public SpotifyTrackChangedEventArgs(ISong previousSong, ISong newSong)
1717
this.PreviousSong = previousSong;
1818
this.NewSong = newSong;
1919
}
20-
21-
#region Static Members
22-
23-
public static implicit operator ToastifyAPI.Events.SpotifyTrackChangedEventArgs(SpotifyTrackChangedEventArgs e)
24-
{
25-
return new ToastifyAPI.Events.SpotifyTrackChangedEventArgs(e.NewSong.Album, e.NewSong.Artists, e.NewSong.Title);
26-
}
27-
28-
#endregion
2920
}
3021
}

Toastify/src/Model/Settings.cs

-15
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,6 @@ public SettingValue<DateTime> LastVersionCheck
10621062

10631063
public WindowPosition SettingsWindowLastLocation { get; set; }
10641064

1065-
public List<PluginDetails> Plugins { get; set; }
1066-
10671065
#endregion
10681066

10691067
#endregion
@@ -1085,7 +1083,6 @@ public void SetDefault(bool activateHotkeys)
10851083

10861084
// (hidden)
10871085
this.StartupWaitTimeout = DefaultValueOf(this.StartupWaitTimeout, nameof(this.StartupWaitTimeout));
1088-
this.Plugins = new List<PluginDetails>();
10891086

10901087
// There are a few settings that we don't really want to override when
10911088
// clearing settings (in fact these are more properties that we store
@@ -1200,16 +1197,4 @@ public void SetDefaultAdvanced()
12001197

12011198
#endregion
12021199
}
1203-
1204-
[Serializable]
1205-
public class PluginDetails
1206-
{
1207-
#region Public Properties
1208-
1209-
public string FileName { get; set; }
1210-
public string TypeName { get; set; }
1211-
public string Settings { get; set; }
1212-
1213-
#endregion
1214-
}
12151200
}

Toastify/src/View/ToastView.xaml.cs

+1-40
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using JetBrains.Annotations;
1+
using JetBrains.Annotations;
22
using log4net;
33
using System;
44
using System.Collections.Generic;
@@ -37,7 +37,6 @@
3737
using ToastifyAPI.Native;
3838
using ToastifyAPI.Native.Enums;
3939
using ToastifyAPI.Native.Structs;
40-
using ToastifyAPI.Plugins;
4140
using Application = System.Windows.Application;
4241
using Color = System.Windows.Media.Color;
4342
using ContextMenu = System.Windows.Forms.ContextMenu;
@@ -122,8 +121,6 @@ private set
122121

123122
public bool ShownOrFading { get; private set; }
124123

125-
internal List<IPluginBase> Plugins { get; set; }
126-
127124
[PropertyDependency]
128125
public IToastifyActionRegistry ActionRegistry { get; set; }
129126

@@ -185,7 +182,6 @@ private void FinalizeInit()
185182
this.Deactivated -= this.Toast_Deactivated;
186183
this.Deactivated += this.Toast_Deactivated;
187184

188-
this.LoadPlugins();
189185
this.Started?.Invoke(this, EventArgs.Empty);
190186

191187
// Subscribe to AutoUpdater's events
@@ -337,40 +333,6 @@ private void StartSpotify()
337333
Spotify.Instance.StartSpotify();
338334
}
339335

340-
private void LoadPlugins()
341-
{
342-
this.Plugins = new List<IPluginBase>();
343-
Assembly assembly = Assembly.GetExecutingAssembly();
344-
string applicationPath = new FileInfo(assembly.Location).DirectoryName;
345-
346-
foreach (var p in this.Settings.Plugins)
347-
{
348-
try
349-
{
350-
// ReSharper disable once AssignNullToNotNullAttribute
351-
string pluginFilePath = Path.Combine(applicationPath, p.FileName);
352-
if (Activator.CreateInstanceFrom(pluginFilePath, p.TypeName).Unwrap() is IPluginBase plugin)
353-
{
354-
plugin.Init(p.Settings);
355-
this.Plugins.Add(plugin);
356-
357-
this.Started += plugin.Started;
358-
this.ToastClosing += plugin.Closing;
359-
Spotify.Instance.SongChanged += (sender, e) => plugin.TrackChanged(sender, e);
360-
}
361-
else
362-
Debug.WriteLine("'plugin' is not of type IPluginBase (?)");
363-
}
364-
catch (Exception e)
365-
{
366-
// TODO: Handle plugins' errors.
367-
logger.Error("Error while loading plugins.", e);
368-
Analytics.TrackException(e);
369-
}
370-
Console.WriteLine(@"Loaded " + p.TypeName);
371-
}
372-
}
373-
374336
#endregion Initialization
375337

376338
#region Toast update
@@ -1070,7 +1032,6 @@ protected override void OnClosing(CancelEventArgs e)
10701032
}
10711033

10721034
this.ToastClosing?.Invoke(this, EventArgs.Empty);
1073-
this.Plugins?.Clear();
10741035

10751036
base.OnClosing(e);
10761037
}

ToastifyAPI/Events/SpotifyTrackChangedEventArgs.cs

-28
This file was deleted.

ToastifyAPI/Plugins/IPluginBase.cs

-33
This file was deleted.

ToastifyAPI/ToastifyAPI.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
44
<PropertyGroup>
@@ -298,9 +298,7 @@
298298
<Compile Include="Native\RawInputAPI\Enums\RawMouseFlags.cs" />
299299
<Compile Include="Native\User32.cs" />
300300
<Compile Include="Native\Windows.cs" />
301-
<Compile Include="Plugins\IPluginBase.cs" />
302301
<Compile Include="Properties\AssemblyInfo.cs" />
303-
<Compile Include="Events\SpotifyTrackChangedEventArgs.cs" />
304302
<Compile Include="Spotify.uwp.cs" />
305303
<Compile Include="Spotify.win32.cs" />
306304
<Compile Include="Spotify.cs" />

0 commit comments

Comments
 (0)