aboutsummaryrefslogtreecommitdiff
path: root/TestPlugin
diff options
context:
space:
mode:
Diffstat (limited to 'TestPlugin')
-rw-r--r--TestPlugin/Entities/MyPluginFolder.cs26
-rw-r--r--TestPlugin/MyStrings.cs24
-rw-r--r--TestPlugin/Plugin.cs27
-rw-r--r--TestPlugin/Properties/AssemblyInfo.cs36
-rw-r--r--TestPlugin/TestPlugin.csproj68
-rw-r--r--TestPlugin/TestPlugin.sln20
6 files changed, 201 insertions, 0 deletions
diff --git a/TestPlugin/Entities/MyPluginFolder.cs b/TestPlugin/Entities/MyPluginFolder.cs
new file mode 100644
index 000000000..12845bdba
--- /dev/null
+++ b/TestPlugin/Entities/MyPluginFolder.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel.Composition;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Common.Extensions;
+
+namespace TestPlugin.Entities
+{
+ [Export(typeof(BasePluginFolder))]
+ public class MyPluginFolder : BasePluginFolder
+ {
+ public MyPluginFolder()
+ {
+ Name = "Test Plug-in Folder";
+ Id = (GetType().FullName + Name.ToLower()).GetMD5();
+ }
+
+ public override bool IsVisible(User user)
+ {
+ return base.IsVisible(user) && user.Name.Equals("Abobader", StringComparison.OrdinalIgnoreCase);
+ }
+ }
+}
diff --git a/TestPlugin/MyStrings.cs b/TestPlugin/MyStrings.cs
new file mode 100644
index 000000000..385793b0b
--- /dev/null
+++ b/TestPlugin/MyStrings.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel.Composition;
+using MediaBrowser.Common.Localization;
+
+namespace TestPlugin
+{
+ [Export(typeof(LocalizedStringData))]
+ public class MyStrings : LocalizedStringData
+ {
+ public MyStrings() : base()
+ {
+ ThisVersion = "1.0001";
+ Prefix = "TestPlugin-";
+ }
+
+ public string TestPluginString1 = "This is string 1";
+ public string TestPluginString2 = "This is string 2";
+ public string TestPluginString3 = "This is string 3";
+ }
+}
diff --git a/TestPlugin/Plugin.cs b/TestPlugin/Plugin.cs
new file mode 100644
index 000000000..2c878604b
--- /dev/null
+++ b/TestPlugin/Plugin.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel.Composition;
+using MediaBrowser.Common.Plugins;
+using MediaBrowser.Common.Logging;
+using MediaBrowser.Controller.Entities;
+
+namespace TestPlugin
+{
+ [Export(typeof(BasePlugin))]
+ public class Plugin : BasePlugin
+ {
+ public override string Name
+ {
+ get { return "Test MB3 Plug-in"; }
+ }
+
+ protected override void InitializeOnServer(bool isFirstRun)
+ {
+ base.InitializeOnServer(isFirstRun);
+ Logger.LogDebugInfo("Test Plug-in Loaded.");
+ }
+ }
+}
diff --git a/TestPlugin/Properties/AssemblyInfo.cs b/TestPlugin/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..94b42ea7a
--- /dev/null
+++ b/TestPlugin/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("TestPlugin")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("TestPlugin")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("fdd4eff1-87df-4b6c-adef-81d13ddde551")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 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.*")]
+[assembly: AssemblyFileVersion("1.0.0.*")]
diff --git a/TestPlugin/TestPlugin.csproj b/TestPlugin/TestPlugin.csproj
new file mode 100644
index 000000000..bab005073
--- /dev/null
+++ b/TestPlugin/TestPlugin.csproj
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{C454798C-D4AE-4E6E-A0B6-274EF13BCE65}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>TestPlugin</RootNamespace>
+ <AssemblyName>TestPlugin</AssemblyName>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="MediaBrowser.Common">
+ <HintPath>..\MediaBrowser.Common\bin\Debug\MediaBrowser.Common.dll</HintPath>
+ </Reference>
+ <Reference Include="MediaBrowser.Controller">
+ <HintPath>..\MediaBrowser.Controller\bin\Debug\MediaBrowser.Controller.dll</HintPath>
+ </Reference>
+ <Reference Include="MediaBrowser.Model">
+ <HintPath>..\MediaBrowser.Model\bin\Debug\MediaBrowser.Model.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.ComponentModel.Composition" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Entities\MyPluginFolder.cs" />
+ <Compile Include="MyStrings.cs" />
+ <Compile Include="Plugin.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PostBuildEvent>xcopy "$(TargetPath)" "$(SolutionDir)\..\ProgramData-Server\Plugins\" /y</PostBuildEvent>
+ </PropertyGroup>
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/TestPlugin/TestPlugin.sln b/TestPlugin/TestPlugin.sln
new file mode 100644
index 000000000..6e3fa8af0
--- /dev/null
+++ b/TestPlugin/TestPlugin.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestPlugin", "TestPlugin.csproj", "{C454798C-D4AE-4E6E-A0B6-274EF13BCE65}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C454798C-D4AE-4E6E-A0B6-274EF13BCE65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C454798C-D4AE-4E6E-A0B6-274EF13BCE65}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C454798C-D4AE-4E6E-A0B6-274EF13BCE65}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C454798C-D4AE-4E6E-A0B6-274EF13BCE65}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal