Mercurial > repos > IBBoard
changeset 4:f9ec2be467fe
Fixes #3 - Migrate control translation out of IBBoard utils
* Delete control translation functions (now in IBBoard.Windows.Forms)
* Remove reference to System.Windows.Forms
* Make sure .csproj file contains all required files
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 27 Dec 2008 18:44:35 +0000 |
parents | 3dab3db95e4a |
children | 5ee4956dae76 |
files | IBBoard.csproj IBBoard.mdp Lang/Translation.cs |
diffstat | 3 files changed, 2 insertions(+), 81 deletions(-) [+] |
line wrap: on
line diff
--- a/IBBoard.csproj Tue Dec 23 14:21:03 2008 +0000 +++ b/IBBoard.csproj Sat Dec 27 18:44:35 2008 +0000 @@ -78,11 +78,6 @@ <SpecificVersion>False</SpecificVersion> <HintPath>libs\log4net.dll</HintPath> </Reference> - <Reference Include="nunit.framework"> - <Name>nunit.framework</Name> - <HintPath>..\..\..\..\..\Program Files\NUnit 2.4.3\bin\nunit.framework.dll</HintPath> - <AssemblyFolderKey>hkcu\dn\nunit 2.4.3</AssemblyFolderKey> - </Reference> <Reference Include="System"> <Name>System</Name> </Reference> @@ -103,6 +98,7 @@ <Compile Include="AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> + <Compile Include="Collections\SimpleSet.cs" /> <Compile Include="Commands\Command.cs"> <SubType>Code</SubType> </Compile> @@ -131,6 +127,7 @@ <SubType>Code</SubType> </Compile> <Compile Include="Logging\LogItem.cs" /> + <Compile Include="Logging\LogNotifier.cs" /> <Compile Include="Logging\SilentLogger.cs"> <SubType>Code</SubType> </Compile>
--- a/IBBoard.mdp Tue Dec 23 14:21:03 2008 +0000 +++ b/IBBoard.mdp Sat Dec 27 18:44:35 2008 +0000 @@ -49,7 +49,6 @@ <ProjectReference type="Gac" localcopy="True" refto="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <ProjectReference type="Gac" localcopy="True" refto="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> - <ProjectReference type="Gac" localcopy="True" refto="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </References> <MonoDevelop.ChangeLogAddIn.ChangeLogInfo policy="UseParentPolicy" /> </Project> \ No newline at end of file
--- a/Lang/Translation.cs Tue Dec 23 14:21:03 2008 +0000 +++ b/Lang/Translation.cs Sat Dec 27 18:44:35 2008 +0000 @@ -207,80 +207,5 @@ item.Text = GetTranslation(item.Name, replacements); } - - public static void TranslateControl(Control ctrl, params object[] replacements) - { - TranslateControl(ctrl, true, replacements); - } - - public static void TranslateControl(Control ctrl, bool cascadeTranslate, params object[] replacements) - { - if (ctrl is ITranslatable) - { - Translate((ITranslatable)ctrl, replacements); - } - - if (cascadeTranslate) - { - cascadeControlTranslation(ctrl, replacements); - } - } - - private static void cascadeControlTranslation(Control ctrl, params object[] replacements) - { - if (ctrl is ToolBar) - { - foreach(ToolBarButton bttn in ((ToolBar)ctrl).Buttons) - { - TranslateComponent(bttn, true, replacements); - } - } - else - { - foreach (Control subctr in ctrl.Controls) - { - TranslateControl(subctr, true, replacements); - } - } - } - - public static void TranslateComponent(Component comp, params object[] replacements) - { - TranslateComponent(comp, true, replacements); - } - - public static void TranslateComponent(Component comp, bool cascadeTranslate, params object[] replacements) - { - if (comp is ITranslatable) - { - Translate((ITranslatable)comp, replacements); - } - else if (comp is FileDialog) - { - //HACK: We can't override SWF dialogs in .Net 1.1, so put in a special condition check for them - FileDialog dialog = (FileDialog)comp; - - if (dialog.Title.StartsWith("Translatable:")) - { - dialog.Title = GetTranslation(dialog.Title.Substring(13), replacements); - } - } - - if (cascadeTranslate) - { - cascadeComponentTranslations(comp, cascadeTranslate, replacements); - } - } - - private static void cascadeComponentTranslations(Component comp, params object[] replacements) - { - if (comp is Menu) - { - foreach(MenuItem mi in ((Menu)comp).MenuItems) - { - TranslateComponent(mi, true, replacements); - } - } - } } }