initial oogynize check in _ this actually used to work!

This commit is contained in:
2016-02-14 21:16:31 -08:00
parent b183af5d55
commit 532ea133bc
337 changed files with 30692 additions and 0 deletions

29
Settings/AppConfig.xml Normal file
View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.ooganizer.com">
<ButtonHook>
<AllowedProcessNames>
<ProcessName Resolver="BrowserResolve" ResolverPrms="" Launcher="Web" Closer="IE" ShowHider="" Versions="6.*;7.*;8.*" CustomBHTop="0" CustomBHRight="0">IEXPLORE.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopOnly" Launcher="" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">WINWORD.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopNMDI" Launcher="Excel" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">EXCEL.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopNMDI" Launcher="" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">POWERPNT.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopNMDI" Launcher="" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">MSPUB.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopNMDI" Launcher="Visio" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">VISIO.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopNMDI" Launcher="" Closer="Office" ShowHider="Office" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">MSACCESS.EXE</ProcessName>
<ProcessName Resolver="FHWinResolve" ResolverPrms="TopOnly" Launcher="" Closer="" ShowHider="" Versions="11.*;12.*" CustomBHTop="0" CustomBHRight="0">ACROBAT.EXE</ProcessName>
<ProcessName Resolver="SimpleResolve" ResolverPrms="" Launcher="" Closer="" ShowHider="" Versions="*" CustomBHTop="0" CustomBHRight="0">NOTEPAD.EXE</ProcessName>
<ProcessName Resolver="SimpleResolve" ResolverPrms="" Launcher="" Closer="" ShowHider="" Versions="*" CustomBHTop="0" CustomBHRight="0">PAINT.EXE</ProcessName>
<ProcessName Resolver="SimpleResolve" ResolverPrms="" Launcher="" Closer="" ShowHider="" Versions="*" CustomBHTop="0" CustomBHRight="0">WORDPAD.EXE</ProcessName>
<ProcessName Resolver="SimpleResolve" ResolverPrms="" Launcher="" Closer="" ShowHider="" Versions="*" CustomBHTop="0" CustomBHRight="0">HH.EXE</ProcessName>
</AllowedProcessNames>
<AllowedWindowTitles>
<WindowTitle />
</AllowedWindowTitles>
<AllowedWindowClasses>
<WindowClass />
</AllowedWindowClasses>
<LogSettings>
<LoggingDetail>3</LoggingDetail>
<LogPath />
</LogSettings>
</ButtonHook>
</configuration>

View File

@@ -0,0 +1,166 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.InteropServices;
namespace Foo.Settings
{
/// <summary>
/// Use this to specificy the names of each themed button
/// </summary>
[ComVisible(false)]
public static class ButtonNames
{
public const string BUTTON_UP = "ButtonUp.ico";
public const string BUTTON_DOWN = "ButtonDown.ico";
public const string TOGGLE_UP = "ToggleUp.ico";
}
/// <summary>
/// Button Location Interface for COM
/// </summary>
[Guid("CFE7FDB8-E3F0-45aa-9935-C9A8502FF7DF")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IButtonIconLocation
{
string GetBUTTON_UP();
string GetBUTTON_DOWN();
string GetTOGGLE_UP();
}
/// <summary>
/// Button Theme Settings COM
/// </summary>
[Guid("F82358CD-8521-4d03-AFF9-352491E9A10E")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IButtonThemeSetting
{
int Top();
int Right();
int Height();
int Width();
}
/// <summary>
/// Parent Class for all the Button Shared Code - *MAIN class for everthing basically*
/// </summary>
[ComVisible(false)]
public class ButtonSharedCode : IButtonThemeSetting, IButtonIconLocation
{
private string m_RelativePath = "";
private string m_AssemblyPath = "";
private int m_nTop = 0;
private int m_nRight = 0;
private int m_nHeight = 0;
private int m_nWidth = 0;
/// <summary>
/// Constructor for SharedButtonCode
/// </summary>
/// <param name="strRelativeLoc">relative location (folder) inside running application directory</param>
/// <param name="nTop">Theme specific Top location for Button</param>
/// <param name="nRight">Theme specific Right location for Button</param>
/// <param name="nHeight">Theme specific Height of Button</param>
/// <param name="nWidth">Theme specific Width of Button</param>
public ButtonSharedCode(string strRelativeLoc, int nTop, int nRight, int nHeight, int nWidth)
{
// Theme settings are stored in the Platform Path
//m_AssemblyPath = Platform.InstallationSpec.PlatformPath;
m_AssemblyPath = Platform.InstallationSpec.InstallPath;
// Debug path
//m_AssemblyPath = @"C:\_ROOT_\Ooganizer\Ooganizer_1.0\Target\debug\Platform";
m_RelativePath = strRelativeLoc;
m_nTop = nTop;
m_nRight = nRight;
m_nHeight = nHeight;
m_nWidth = nWidth;
}
////
// IButtonThemeSetting
////
public int Top() { return m_nTop; }
public int Right() { return m_nRight; }
public int Height() { return m_nHeight; }
public int Width() { return m_nWidth; }
////
// IButtonLocation
////
public string GetBUTTON_UP() { return (m_AssemblyPath + "\\" + m_RelativePath + "\\" + ButtonNames.BUTTON_UP); }
public string GetBUTTON_DOWN() { return (m_AssemblyPath + "\\" + m_RelativePath + "\\" + ButtonNames.BUTTON_DOWN); }
public string GetTOGGLE_UP() { return (m_AssemblyPath + "\\" + m_RelativePath + "\\" + ButtonNames.TOGGLE_UP); }
}
/// <summary>
/// Classic Button Theme Setting
/// </summary>
[ComVisible(false)]
public class ButtonClassicTheme : ButtonSharedCode
{
public ButtonClassicTheme() : base("Resources\\Themes\\ClassicTheme", 0, 0, 0, 0) { }
}
/// <summary>
/// XP Button Theme Setting
/// </summary>
[ComVisible(false)]
public class ButtonXPTheme : ButtonSharedCode
{
public ButtonXPTheme() : base("Resources\\Themes\\XPTheme", 1, 126, 16, 26) { }
}
/// <summary>
/// Aero Button Theme Setting
/// </summary>
[ComVisible(false)]
public class ButtonAeroTheme : ButtonSharedCode
{
//public ButtonAeroTheme() : base("Resources\\AeroTheme", 0, 129, 18, 26) { }
public ButtonAeroTheme() : base("Resources\\Themes\\AeroTheme", 1, 126, 16, 26) { }
}
/// <summary>
/// Vista No Aero Theme Setting
/// </summary>
[ComVisible(false)]
public class ButtonVistaNoAeroTheme : ButtonSharedCode
{
public ButtonVistaNoAeroTheme() : base("Resources\\Themes\\VistaNoAeroTheme", 0, 0, 15, 28) { }
}
/// <summary>
/// This class abstracts away all the settings we need for
/// ButtonHook to deal with themes and Buttons. (we may consider in the future
/// to use this class to retrieve custom settings)
/// ~this class is accessible via COM for the W32Button to work
/// </summary>
[Guid("9EEC54A0-77F3-4dcf-8C74-B6720437C59E")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("Ooganizer.ButtonThemeNIconSettingsCCW")]
[ComVisible(true)]
public class ButtonThemeNIconSettingsCCW
{
private object m_oButtonThemeObject = null;
public ButtonThemeNIconSettingsCCW()
{
switch (Foo.Platform.Env.Theme)
{
case Foo.Platform.Env.Themes.Classic:
m_oButtonThemeObject = new ButtonClassicTheme();
break;
case Foo.Platform.Env.Themes.AeroTheme:
m_oButtonThemeObject = new ButtonAeroTheme();
break;
case Foo.Platform.Env.Themes.VistaNoAero:
m_oButtonThemeObject = new ButtonVistaNoAeroTheme();
break;
case Foo.Platform.Env.Themes.XPtheme:
m_oButtonThemeObject = new ButtonXPTheme();
break;
}
}
public IButtonThemeSetting GetIButtonThemeInterface() { return (IButtonThemeSetting)m_oButtonThemeObject; }
public IButtonIconLocation GetIButtonIconLocation() { return (IButtonIconLocation)m_oButtonThemeObject; }
}
}

BIN
Settings/MyKeyFile.SNK Normal file

Binary file not shown.

View File

@@ -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("Settings")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Ooganizer")]
[assembly: AssemblyProduct("Settings")]
[assembly: AssemblyCopyright("Copyright © Ooganizer 2009")]
[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("a28ce1f1-2b84-42ee-abd8-8230ae6a186c")]
// 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.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,78 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Foo.Platform.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Foo.Platform.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
///&lt;configuration xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://www.ooganizer.com&quot;&gt;
/// &lt;ButtonHook&gt;
/// &lt;AllowedProcessNames&gt;
/// &lt;ProcessName strategy=&quot;BrowserResolve&quot; prms=&quot;&quot; wcinc=&quot;*&quot; wtxtinc=&quot;*&quot; versions=&quot;6.*;7.*;8.*&quot; bhloc=&quot;normal&quot;&gt;IEXPLORE.EXE&lt;/ProcessName&gt;
/// &lt;ProcessName strategy=&quot;FHWinResolve&quot; prms=&quot;TopOnly&quot; wcinc=&quot;*&quot; wtxtinc=&quot;*&quot; versions=&quot;11.*;12.*&quot; bhloc=&quot;normal&quot;&gt;WINWORD.EXE&lt;/ProcessName&gt;
/// &lt;P [rest of string was truncated]&quot;;.
/// </summary>
internal static string AppConfigXML {
get {
return ResourceManager.GetString("AppConfigXML", resourceCulture);
}
}
}
}

View File

@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="AppConfigXML" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\AppConfig.xml;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
</root>

26
Settings/Properties/Settings.Designer.cs generated Normal file
View File

@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4200
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Foo.Platform.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}

View File

@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>

View File

@@ -0,0 +1,23 @@
@rem //-- Author: Daniel Romischer (daniel@romischer.com)
@echo off
goto :start
:Usage
echo Use this File to Register Ooganizer Paths in the registry
echo.
echo Syntax: RegPathsConfig "[main ooganizer path]"
echo.
echo Example: RegPathsConfig "C:\Program Files\Ooganizer"
echo.
goto :Exit
:start
if (%1)==() Goto :Usage
REG ADD HKLM\Software\Ooganizer /v InstallPath /d %1\ /f
REG ADD HKLM\Software\Ooganizer /v LogPath /d %1\Platform\Logs\ /f
REG ADD HKLM\Software\Ooganizer /v PlatformPath /d %1\Platform\ /f
REG ADD HKLM\Software\Ooganizer /v ServerPath /d %1\Server\ /f
:Exit

107
Settings/Settings.csproj Normal file
View File

@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{48D75C4F-2749-48BB-9386-721E0E94C144}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Foo.Platform</RootNamespace>
<AssemblyName>Settings</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MyKeyFile.SNK</AssemblyOriginatorKeyFile>
<TargetFrameworkSubset>
</TargetFrameworkSubset>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\Target\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\Target\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Components\log4net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ButtonThemeSetting.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="SettingsAcc.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AppConfig.xml" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="MyKeyFile.SNK" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<None Include="RegPathsConfig.bat" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Platform\Platform.csproj">
<Project>{F6929AFC-BF61-43A0-BABD-F807B65FFFA1}</Project>
<Name>Platform</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\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>
-->
<PropertyGroup>
<PostBuildEvent>$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /unregister
$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /tlb:$(TargetName).tlb /codebase</PostBuildEvent>
<PreBuildEvent>"$(ProjectDir)RegPathsConfig.bat" "$(SolutionDir)target\$(ConfigurationName)"</PreBuildEvent>
</PropertyGroup>
</Project>

459
Settings/SettingsAcc.cs Normal file
View File

@@ -0,0 +1,459 @@
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using System.IO;
using System.Reflection;
using Foo.Platform;
using System.Diagnostics;
namespace Foo.Settings
{
[Guid("6FBB970D-0825-471e-9839-448FB2B6A842")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
[ComVisible(true)]
public interface IOoganizerSettings
{
// reading in configuration data
configuration ReadConfigXMLFile();
// write custom configuration data to default location
void WriteConfigXMLFileDefaultLoc(configuration config);
}
/// <summary>
/// Serializable Xml Object used to store all Configuration data - place any new class objects in here
/// </summary>
[Guid("EA2D77C2-AA17-4142-8FA7-7D6FA35316F4")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
[XmlRoot("configuration", Namespace = "http://www.ooganizer.com", IsNullable = false)]
public class configuration
{
// Member Tags <>
public ButtonHookSettings ButtonHook = null;
/// <summary>
/// configuration - Constructor
/// </summary>
public configuration()
{
ButtonHook = new ButtonHookSettings();
}
}
/// <summary>
/// Serializable Xml Object used to store ButtonHookSettings
/// </summary>
[Guid("2C055265-715A-4d10-B744-ADCE796BED1C")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
[XmlRoot("ButtonHookSettings", Namespace = "http://www.ooganizer.com", IsNullable = false)]
public class ButtonHookSettings
{
// Member Tags <>
public AllowedProcessNamesW AllowedProcessNames = null;
public AllowedWindowTitlesW AllowedWindowTitles = null;
public AllowedWindowClassesW AllowedWindowClasses = null;
public LoggingSettings LogSettings = null;
/// <summary>
/// AllowedProcessNames - (Wrapper) around ArrayList to work with COM and XML
/// </summary>
[Guid("06403D5A-E309-42d3-B639-1F9DB99880A4")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class AllowedProcessNamesW
{
private ArrayList m_ArrayList;
public AllowedProcessNamesW()
{
m_ArrayList = new ArrayList();
}
[XmlElement("ProcessName")]
public ProcessName[] ProcessNames
{
get
{
ProcessName[] processNames = new ProcessName[m_ArrayList.Count];
m_ArrayList.CopyTo(processNames);
return processNames;
}
set
{
if (value == null) return;
ProcessName[] processNames = (ProcessName[])value;
m_ArrayList.Clear();
foreach (ProcessName processName in processNames)
m_ArrayList.Add(processName);
}
}
public int AddProcessName(ProcessName processName)
{
return m_ArrayList.Add(processName);
}
}
[Guid("EC4E542F-2877-4bb4-8FEF-30F1A1C1B53B")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class ProcessName
{
public ProcessName()
{
this.CustomBHTop = 0;
this.CustomBHRight = 0;
}
public ProcessName(string ProcessExe, string Resolver, string ResolverPrms, string Launcher, string Closer, string ShowHider, string Versions, int CustomBHTop, int CustomBHRight)
{
this._ProcessExe = ProcessExe;
this.Resolver = Resolver;
this.ResolverPrms = ResolverPrms;
this.Launcher = Launcher;
this.Closer = Closer;
this.ShowHider = ShowHider;
this.Versions = Versions;
this.CustomBHTop = CustomBHTop;
this.CustomBHRight = CustomBHRight;
}
private string _ProcessExe;
[XmlText]
public string ProcessExe
{
get
{
if (!String.IsNullOrEmpty(_ProcessExe))
return _ProcessExe.ToUpper();
else
return String.Empty;
}
set
{
_ProcessExe = value;
}
}
[XmlAttribute("Resolver")]
public string Resolver;
[XmlAttribute("ResolverPrms")]
public string ResolverPrms;
[XmlAttribute("Launcher")]
public string Launcher;
[XmlAttribute("Closer")]
public string Closer;
[XmlAttribute("ShowHider")]
public string ShowHider;
[XmlAttribute("Versions")]
public string Versions;
[XmlAttribute("CustomBHTop")]
public int CustomBHTop;
[XmlAttribute("CustomBHRight")]
public int CustomBHRight;
}
/// <summary>
/// AllowedWindowTitles - (Wrapper) around ArrayList to work with COM and XML
/// </summary>
[Guid("5B9CC560-9E53-4ae2-8701-E60F99A9A80D")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class AllowedWindowTitlesW
{
private ArrayList m_ArrayList;
public AllowedWindowTitlesW()
{
m_ArrayList = new ArrayList();
m_ArrayList.Add("");
}
[XmlElement("WindowTitle")]
public string[] WindowTitle
{
get
{
string[] windowTitles = new string[m_ArrayList.Count];
m_ArrayList.CopyTo(windowTitles);
return windowTitles;
}
set
{
if (value == null) return;
string[] windowTitles = (string[])value;
m_ArrayList.Clear();
foreach (string windowTitle in windowTitles)
m_ArrayList.Add(windowTitle);
}
}
}
/// <summary>
/// AllowedWindowClasses - (Wrapper) around ArrayList to work with COM and XML
/// </summary>
[Guid("FE3ECBC4-9082-43b5-8274-7DC3A4FB4855")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class AllowedWindowClassesW
{
private ArrayList m_ArrayList;
public AllowedWindowClassesW()
{
m_ArrayList = new ArrayList();
m_ArrayList.Add("");
}
[XmlElement("WindowClass")]
public string[] WindowClass
{
get
{
string[] windowClasses = new string[m_ArrayList.Count];
m_ArrayList.CopyTo(windowClasses);
return windowClasses;
}
set
{
if (value == null) return;
string[] windowClasses = (string[])value;
m_ArrayList.Clear();
foreach (string windowClass in windowClasses)
m_ArrayList.Add(windowClass);
}
}
}
/// <summary>
/// LoggingSettings = Set Log Settings (Location & Detail) for ButtonHook
/// </summary>
[Guid("A5A6EBA5-DC51-4bba-B7DC-0202153F57DF")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class LoggingSettings
{
public uint LoggingDetail;
private string _LogPath;
public string LogPath
{
get
{
if (!String.IsNullOrEmpty(_LogPath))
return Platform.Env.GetLogDirectory();
else
return _LogPath;
}
set
{
try
{
if (Directory.Exists(value))
_LogPath = value;
}
catch(Exception){}
}
}
public LoggingSettings()
{
_LogPath = String.Empty;
LoggingDetail = (int)_LoggingDetail.LOGGING_NONE;
}
// same enum Definition in ButtonHook
public enum _LoggingDetail { LOGGING_NONE = 0, LOGGING_LOW = 1, LOGGING_MEDIUM = 2, LOGGING_HIGH = 3};
}
/// <summary>
/// ButtonHookSettings - Constructor
/// </summary>
public ButtonHookSettings()
{
AllowedProcessNames = new AllowedProcessNamesW();
AllowedWindowTitles = new AllowedWindowTitlesW();
AllowedWindowClasses = new AllowedWindowClassesW();
LogSettings = new LoggingSettings();
}
}
[Guid("80adff74-7124-42e6-ac2c-e19f51a47432")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("Ooganizer.SettingsAcc")]
[ComVisible(true)]
public class OoganizerSettingsAcc : IOoganizerSettings
{
private XmlSerializer m_ConfigSerializer = null;
public const string DEFAULT_CONFIG_XML_FILE_NAME = "AppConfig.xml";
private string m_AssemblyLocation = "";// location of running assembly
private configuration m_Configuration; // holds the latest configuration read in or written out,
// for easy access to the configuration
/// <summary>
/// Construcs the SettingsAccessor Object, Responsible for
/// interfacing with the App.Config file
/// </summary>
public OoganizerSettingsAcc()
{
m_ConfigSerializer = new XmlSerializer(typeof(configuration));
if (m_ConfigSerializer == null)
throw new OutOfMemoryException();
// The location of this assembly is in the Platform Directory
m_AssemblyLocation = Platform.InstallationSpec.InstallPath;
}
#region IOoganizerSettings
/// <summary>
/// Reads in the Config File from the Resource.
/// </summary>
/// <returns>the configuration object</returns>
public configuration ReadConfigXMLFile()
{
string strFileNameWithPath = m_AssemblyLocation + '\\' + DEFAULT_CONFIG_XML_FILE_NAME;
// If a physical xml file exists in the current directory (allow it to overwrite our settings)
if (File.Exists(strFileNameWithPath + '\\' + DEFAULT_CONFIG_XML_FILE_NAME))
{
return ReadConfigXMLFile(strFileNameWithPath, false);
}
else
{
// Else force reading of the Resource
return ReadConfigXMLFile(strFileNameWithPath, true);
}
}
/// <summary>
/// Writes the specified configruation to the default location and configuration file
/// </summary>
/// <param name="config">configuration object to write out</param>
public void WriteConfigXMLFileDefaultLoc(configuration config)
{
string strFileNameWithPath = m_AssemblyLocation + '\\' + DEFAULT_CONFIG_XML_FILE_NAME;
WriteConfigXMLFile(strFileNameWithPath, config);
}
#endregion
#region XML Writer Functions - useful for * Development and Debugging *
/// <summary>
/// Writes the specified configuration to the specified configuration file
/// </summary>
/// <param name="strFileNameWithPath">absolute path to file</param>
/// <param name="config">configuration object to write out</param>
public void WriteConfigXMLFile(string strFileNameWithPath, configuration config)
{
try
{
if (!Directory.Exists(Path.GetDirectoryName(strFileNameWithPath)))
{
Log.Error(string.Format("{0}() - Directory for {1} does not exist", MethodBase.GetCurrentMethod().Name, strFileNameWithPath));
return;
}
TextWriter writer = new StreamWriter(strFileNameWithPath);
m_ConfigSerializer.Serialize(writer, config);
m_Configuration = config;
}
catch (Exception e)
{
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
return;
}
}
/// <summary>
/// Use this to write a blank xml config file that you can then use
/// to store your configuration
/// </summary>
/// <param name="strFileNameWithPath">absolute path to file</param>
public void WriteBlankConfigXMLFile(string strFileNameWithPath)
{
try
{
if (!Directory.Exists(Path.GetDirectoryName(strFileNameWithPath)))
{
Log.Error(string.Format("{0}() - Directory for {1} does not exist", MethodBase.GetCurrentMethod().Name, strFileNameWithPath));
return;
}
TextWriter writer = new StreamWriter(strFileNameWithPath);
configuration settings = new configuration();
m_ConfigSerializer.Serialize(writer, settings);
}
catch (Exception e)
{
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
return;
}
}
#endregion
#region Main ReadConfig Function - Does most of the work
/// <summary>
/// Reads in the config file from the passed in location or from the Resource
/// </summary>
/// <param name="strFileNameWithPath">absolute path to file (not used when bReadFromResource is true)</param>
/// <param name="bReadFromResource">true to read Resource XML, false to read from passed in strFileNameWithPath</param>
/// <returns></returns>
private configuration ReadConfigXMLFile(string strFileNameWithPath, bool bReadFromResource)
{
const string SETTING_XML_RESOURCE_NAME = "Foo.Platform.AppConfig.xml";
try
{
if (bReadFromResource)
{
Assembly assembly = Assembly.GetExecutingAssembly();
// * Debugging Only * Make sure resource Name exists
#if DEBUG
string[] resourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
bool bFound = false;
foreach (string resourceName in resourceNames)
{
if (resourceName == SETTING_XML_RESOURCE_NAME)
bFound = true;
}
Debug.Assert(bFound);
#endif
TextReader reader = new StreamReader(assembly.GetManifestResourceStream(SETTING_XML_RESOURCE_NAME));
m_Configuration = (configuration)m_ConfigSerializer.Deserialize(reader);
return m_Configuration;
}
else
{
TextReader reader = new StreamReader(strFileNameWithPath);
m_Configuration = (configuration)m_ConfigSerializer.Deserialize(reader);
return m_Configuration;
}
}
catch (Exception e)
{
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
throw (new Exception(e.Message));
}
}
#endregion
// Declare the Log4net Variable
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
}
}

3
Settings/app.config Normal file
View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>