From: <an...@us...> - 2008-04-04 08:00:38
|
Revision: 1593 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1593&view=rev Author: and-81 Date: 2008-04-04 01:00:34 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Added Paths: ----------- trunk/plugins/SetMerit/ trunk/plugins/SetMerit/SetMerit/ trunk/plugins/SetMerit/SetMerit/Program.cs trunk/plugins/SetMerit/SetMerit/Properties/ trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs trunk/plugins/SetMerit/SetMerit/SetMerit.csproj trunk/plugins/SetMerit/SetMerit.sln Added: trunk/plugins/SetMerit/SetMerit/Program.cs =================================================================== --- trunk/plugins/SetMerit/SetMerit/Program.cs (rev 0) +++ trunk/plugins/SetMerit/SetMerit/Program.cs 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,65 @@ +using System; + +using Microsoft.Win32; + +namespace SetMerit +{ + + static class Program + { + + const string FiltersKey = @"CLSID\{083863F1-70DE-11d0-BD40-00A0C911CE86}\Instance\"; + const string MeritKey = "FilterData"; + + + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main(string[] args) + { + try + { + if (args.Length == 2) + { + if (args[1].Length != 8) + throw new InvalidOperationException(String.Format("Not a valid merit value \"{0}\"", args[1])); + + // Reverse the merit bytes ... + byte[] meritData = new byte[4]; + int meritByte = 3; + for (int index = 0; index < 8; index += 2) + { + string byteStr = args[1].Substring(index, 2); + + meritData[meritByte--] = byte.Parse(byteStr, System.Globalization.NumberStyles.HexNumber); + } + + string filter = FiltersKey + args[0]; + Console.WriteLine("Modifying HKCR\\{0} ...", filter); + + using (RegistryKey regKey = Registry.ClassesRoot.OpenSubKey(filter, true)) + { + byte[] data = (byte[])regKey.GetValue(MeritKey, null); + + Array.Copy(meritData, 0, data, 4, 4); + + regKey.SetValue(MeritKey, (object)data); + } + + Console.WriteLine("Success"); + } + else + { + Console.WriteLine("Usage: SetMerit [Filter GUID] [New Merit]"); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + } + + } + +} Added: trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs (rev 0) +++ trunk/plugins/SetMerit/SetMerit/Properties/AssemblyInfo.cs 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,33 @@ +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("SetMerit")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SetMerit")] +[assembly: AssemblyCopyright("Copyright © 2008")] +[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("26f3d460-b89c-495d-9272-810e7866a3cd")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] Added: trunk/plugins/SetMerit/SetMerit/SetMerit.csproj =================================================================== --- trunk/plugins/SetMerit/SetMerit/SetMerit.csproj (rev 0) +++ trunk/plugins/SetMerit/SetMerit/SetMerit.csproj 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,50 @@ +<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>{CCA6201F-72F7-4173-9D8A-C2A011767830}</ProjectGuid> + <OutputType>Exe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>SetMerit</RootNamespace> + <AssemblyName>SetMerit</AssemblyName> + <StartupObject>SetMerit.Program</StartupObject> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</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> + </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> + <UseVSHostingProcess>false</UseVSHostingProcess> + </PropertyGroup> + <ItemGroup> + <Reference Include="System" /> + </ItemGroup> + <ItemGroup> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + </ItemGroup> + <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> + --> +</Project> \ No newline at end of file Added: trunk/plugins/SetMerit/SetMerit.sln =================================================================== --- trunk/plugins/SetMerit/SetMerit.sln (rev 0) +++ trunk/plugins/SetMerit/SetMerit.sln 2008-04-04 08:00:34 UTC (rev 1593) @@ -0,0 +1,24 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SetMerit", "SetMerit\SetMerit.csproj", "{CCA6201F-72F7-4173-9D8A-C2A011767830}" + ProjectSection(WebsiteProperties) = preProject + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.Debug = "False" + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CCA6201F-72F7-4173-9D8A-C2A011767830}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |