From: <an...@us...> - 2008-05-09 01:38:58
|
Revision: 1771 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1771&view=rev Author: and-81 Date: 2008-05-08 18:38:54 -0700 (Thu, 08 May 2008) Log Message: ----------- New Plugin: Cancel AutoPlay Added Paths: ----------- trunk/plugins/CancelAutoPlay/ trunk/plugins/CancelAutoPlay/AssemblyInfo.cs trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs Property changes on: trunk/plugins/CancelAutoPlay ___________________________________________________________________ Name: svn:ignore + bin obj Added: trunk/plugins/CancelAutoPlay/AssemblyInfo.cs =================================================================== --- trunk/plugins/CancelAutoPlay/AssemblyInfo.cs (rev 0) +++ trunk/plugins/CancelAutoPlay/AssemblyInfo.cs 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,63 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +// +// 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("CancelAutoPlay Plugin")] +[assembly: AssemblyDescription("Prevents AutoPlay while MediaPortal is running")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("and-81")] +[assembly: AssemblyProduct("MediaPortal")] +[assembly: AssemblyCopyright("Aaron Dinnage")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// 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 Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.4.2.0")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\<setupForm>. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] +[assembly: ComVisibleAttribute(false)] +[assembly: AssemblyFileVersionAttribute("1.4.2.0")] Added: trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj =================================================================== --- trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj (rev 0) +++ trunk/plugins/CancelAutoPlay/CancelAutoPlay Plugin.csproj 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{88520E4C-5C49-478A-8AFA-959B45075922}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MediaPortal.Plugins</RootNamespace> + <AssemblyName>CancelAutoPlay</AssemblyName> + <StartupObject> + </StartupObject> + <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>false</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + <DocumentationFile> + </DocumentationFile> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>none</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants> + </DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + <TreatWarningsAsErrors>true</TreatWarningsAsErrors> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- 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> + --> + <ItemGroup> + <Compile Include="AssemblyInfo.cs" /> + <Compile Include="CancelAutoPlay.cs" /> + </ItemGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.3.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Core.dll</HintPath> + <Private>False</Private> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.2.4.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\MediaPortal\xbmc\bin\Release\Utils.dll</HintPath> + <Private>False</Private> + </Reference> + </ItemGroup> + <PropertyGroup> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs =================================================================== --- trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs (rev 0) +++ trunk/plugins/CancelAutoPlay/CancelAutoPlay.cs 2008-05-09 01:38:54 UTC (rev 1771) @@ -0,0 +1,131 @@ +using System; +using System.Runtime.InteropServices; +using System.Windows.Forms; + +using MediaPortal.GUI.Library; + +namespace MediaPortal.Plugins +{ + + /// <summary> + /// Prevents AutoPlay while MediaPortal is running. + /// </summary> + public class CancelAutoPlay : IPluginReceiver, ISetupForm + { + + #region Interop + + [DllImport("user32.dll")] + static extern uint RegisterWindowMessage(string message); + + #endregion Interop + + #region Variables + + uint _cancelAutoPlay; + + #endregion Variables + + #region IPluginReceiver Members + + public bool WndProc(ref Message msg) + { + if (msg.Msg == _cancelAutoPlay) + { + Log.Info("CancelAutoPlay: Preventing AutoPlay ..."); + + msg.Result = new IntPtr(1); + return true; + } + + return false; + } + + #endregion IPluginReceiver Members + + #region IPlugin Members + + public void Start() + { + _cancelAutoPlay = RegisterWindowMessage("QueryCancelAutoPlay"); + + Log.Info("CancelAutoPlay: Started"); + } + + public void Stop() + { + _cancelAutoPlay = 0; + + Log.Info("CancelAutoPlay: Stopped"); + } + + #endregion IPlugin Members + + #region ISetupForm methods + + /// <summary> + /// Determines whether this plugin can be enabled. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin can be enabled; otherwise, <c>false</c>. + /// </returns> + public bool CanEnable() { return true; } + /// <summary> + /// Determines whether this plugin has setup. + /// </summary> + /// <returns> + /// <c>true</c> if this plugin has setup; otherwise, <c>false</c>. + /// </returns> + public bool HasSetup() { return false; } + /// <summary> + /// Gets the plugin name. + /// </summary> + /// <returns>The plugin name.</returns> + public string PluginName() { return "Cancel AutoPlay"; } + /// <summary> + /// Defaults enabled. + /// </summary> + /// <returns>true if this plugin is enabled by default, otherwise false.</returns> + public bool DefaultEnabled() { return true; } + /// <summary> + /// Gets the window id. + /// </summary> + /// <returns>The window id.</returns> + public int GetWindowId() { return 0; } + /// <summary> + /// Gets the plugin author. + /// </summary> + /// <returns>The plugin author.</returns> + public string Author() { return "and-81"; } + /// <summary> + /// Gets the description of the plugin. + /// </summary> + /// <returns>The plugin description.</returns> + public string Description() { return "Prevents AutoPlay while MediaPortal is running"; } + + /// <summary> + /// Shows the plugin configuration. + /// </summary> + public void ShowPlugin() + { + } + + /// <summary> + /// Gets the home screen details for the plugin. + /// </summary> + /// <param name="strButtonText">The button text.</param> + /// <param name="strButtonImage">The button image.</param> + /// <param name="strButtonImageFocus">The button image focus.</param> + /// <param name="strPictureImage">The picture image.</param> + /// <returns>true if the plugin can be seen, otherwise false.</returns> + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; + return false; + } + + #endregion ISetupForm methods + + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |