Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit fd61785

Browse files
committed
June 24th Update.
Now using RimeCommon and providing the module needed to properly make plugins for Rime.
1 parent 49e4eac commit fd61785

File tree

3 files changed

+24
-89
lines changed

3 files changed

+24
-89
lines changed

Diff for: Properties/AssemblyInfo.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
65
// set of attributes. Change these attribute values to modify the information
76
// associated with an assembly.
8-
[assembly: AssemblyTitle("Rime Plugin Example")]
9-
[assembly: AssemblyDescription("Example Plugin")]
7+
[assembly: AssemblyTitle("RimePluginExample")]
8+
[assembly: AssemblyDescription("")]
109
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("kiwidoggie productions")]
10+
[assembly: AssemblyCompany("")]
1211
[assembly: AssemblyProduct("RimePluginExample")]
13-
[assembly: AssemblyCopyright("Copyright © kiwidoggie productions 2005-2015")]
12+
[assembly: AssemblyCopyright("Copyright © 2014")]
1413
[assembly: AssemblyTrademark("")]
1514
[assembly: AssemblyCulture("")]
1615

Diff for: RimeExamplePlugin.cs

+16-76
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,27 @@
1-
/*
2-
The MIT License (MIT)
3-
4-
Copyright (c) 2005-2015 kiwidoggie productions
5-
6-
Permission is hereby granted, free of charge, to any person obtaining a copy
7-
of this software and associated documentation files (the "Software"), to deal
8-
in the Software without restriction, including without limitation the rights
9-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
copies of the Software, and to permit persons to whom the Software is
11-
furnished to do so, subject to the following conditions:
12-
13-
The above copyright notice and this permission notice shall be included in all
14-
copies or substantial portions of the Software.
15-
16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
SOFTWARE.
23-
24-
*/
25-
26-
using System;
27-
using System.Collections.Generic;
28-
using System.Linq;
29-
using System.Text;
30-
using System.Threading.Tasks;
31-
32-
// WPF User Control
33-
using System.Windows.Controls;
34-
35-
// Plugin System
36-
using Rime.Core.Plugins;
1+
using System.Windows.Controls;
2+
using RimeCommon.Logging;
3+
using RimeCommon.Plugins;
374

385
namespace RimePluginExample
396
{
40-
public class RimeExamplePlugin : IPlugin
7+
public class RimeExamplePlugin : RimePlugin
418
{
42-
public string Name { get { return "RimeExamplePlugin"; } }
43-
public string Author { get { return "kiwidog"; } }
44-
public string Version { get { return "v0.1"; } }
45-
public string Description { get { return "Description"; } }
46-
public string Extension { get { return "example"; } }
47-
public bool UIEnabled { get { return MainControl != null; } }
48-
public UserControl MainControl { get; private set; }
49-
50-
/// <summary>
51-
/// Initialization with no parameters
52-
/// </summary>
53-
/// <returns>True for success, False for failure</returns>
54-
public bool Init()
55-
{
56-
return true;
57-
}
58-
59-
/// <summary>
60-
/// Initalization with one parameter, plugin will have to do all type and cast checking itself.
61-
/// </summary>
62-
/// <param name="p_Object">Object passed as argument</param>
63-
/// <returns>True for success, False for failure</returns>
64-
public bool Init(object p_Object)
9+
public override string Name { get { return "Rime Example Plugin"; } }
10+
public override string Author { get { return "Example Author"; } }
11+
public override string Version { get { return "1.0"; } }
12+
public override string Description { get { return "An description for the example plugin, hmmm.... what should it be?"; } }
13+
public override string Extension { get { return "_rime-plugin-example"; } }
14+
public override UserControl MainControl { get { return null; } }
15+
public override MountPoint Mount { get { return MountPoint.Center; } }
16+
17+
public RimeExamplePlugin()
6518
{
66-
return false;
19+
WriteLog(LogsLevel.All, "RimeExamplePlugin ctor called.");
6720
}
6821

69-
/// <summary>
70-
/// Initialization with multiple parameters, plugin will have to do all type and cast checking itself.
71-
/// </summary>
72-
/// <param name="p_Objects">Array of objects passed as arguments</param>
73-
/// <returns>True for success, False for failure</returns>
74-
public bool Init(object[] p_Objects)
22+
public override void Init()
7523
{
76-
return false;
77-
}
78-
79-
/// <summary>
80-
/// Close is called when the plugin is being destroyed, free all memory, ui, resources here.
81-
/// </summary>
82-
public void Close()
83-
{
84-
24+
8525
}
8626
}
8727
}

Diff for: RimePluginExample.csproj

+4-8
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,17 @@
3131
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
3232
</PropertyGroup>
3333
<ItemGroup>
34+
<Reference Include="Microsoft.CSharp" />
3435
<Reference Include="PresentationCore" />
3536
<Reference Include="PresentationFramework" />
37+
<Reference Include="RimeCommon">
38+
<HintPath>.\RimeCommon.dll</HintPath>
39+
</Reference>
3640
<Reference Include="System" />
37-
<Reference Include="System.Core" />
38-
<Reference Include="System.Windows" />
3941
<Reference Include="System.Xaml" />
40-
<Reference Include="System.Xml.Linq" />
41-
<Reference Include="System.Data.DataSetExtensions" />
42-
<Reference Include="Microsoft.CSharp" />
43-
<Reference Include="System.Data" />
44-
<Reference Include="System.Xml" />
4542
<Reference Include="WindowsBase" />
4643
</ItemGroup>
4744
<ItemGroup>
48-
<Compile Include="IPlugin.cs" />
4945
<Compile Include="RimeExamplePlugin.cs" />
5046
<Compile Include="Properties\AssemblyInfo.cs" />
5147
</ItemGroup>

0 commit comments

Comments
 (0)