Skip to content

Commit

Permalink
Moved deprecated attribute to contracts so that Plugins can use them.…
Browse files Browse the repository at this point in the history
… Deprecated a few members on window plugin
  • Loading branch information
AndersMalmgren committed Mar 22, 2023
1 parent bed6ded commit 5f948af
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
15 changes: 15 additions & 0 deletions FreePIE.Core.Contracts/Deprecated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace FreePIE.Core.Contracts
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
public class Deprecated : Attribute
{
public string ReplacedWith { get; private set; }

public Deprecated(string replacedWith)
{
ReplacedWith = replacedWith;
}
}
}
1 change: 1 addition & 0 deletions FreePIE.Core.Contracts/FreePIE.Core.Contracts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Attributes.cs" />
<Compile Include="Deprecated.cs" />
<Compile Include="IGlobalNameProvider.cs" />
<Compile Include="IPlugin.cs" />
<Compile Include="IPluginProperty.cs" />
Expand Down
4 changes: 2 additions & 2 deletions FreePIE.Core.Contracts/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
10 changes: 8 additions & 2 deletions FreePIE.Core.Plugins/WindowPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,22 @@ public bool isActive(string processName)
return plugin.IsActive(processName);
}

[Deprecated("activate")]
public bool setActive(string processName)
{
return plugin.Activate(processName);
}

public string getActive
public bool activate(string processName)
{
get { return plugin.GetActiveWindowProcessName(); }
return plugin.Activate(processName);
}

[Deprecated("active")] public string getActive => active;

public string active => plugin.GetActiveWindowProcessName();


public int pollingInterval
{
set { plugin.PollingInterval = value; }
Expand Down
11 changes: 0 additions & 11 deletions FreePIE.Core/ScriptEngine/Globals/ScriptHelpers/IScriptHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,5 @@ namespace FreePIE.Core.ScriptEngine.Globals.ScriptHelpers
[AttributeUsage(AttributeTargets.Method)]
public class NeedIndexer : Attribute { }

[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property)]
public class Deprecated : Attribute
{
public string ReplacedWith { get; private set; }

public Deprecated(string replacedWith)
{
ReplacedWith = replacedWith;
}
}

public interface IScriptHelper { }
}

0 comments on commit 5f948af

Please sign in to comment.