Changeset 2247


Ignore:
Timestamp:
08/06/09 12:32:27 (12 years ago)
Author:
mkommend
Message:

adapted HeuristicLab.MainForm.Test to use HL.Common.Resources (ticket #716)

Location:
trunk/sources
Files:
3 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLab.MainForm.Test-3.2.csproj

    r2243 r2247  
    4949    <ErrorReport>prompt</ErrorReport>
    5050  </PropertyGroup>
     51  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     52    <DebugSymbols>true</DebugSymbols>
     53    <OutputPath>bin\x64\Debug\</OutputPath>
     54    <DefineConstants>DEBUG;TRACE</DefineConstants>
     55    <DebugType>full</DebugType>
     56    <PlatformTarget>x64</PlatformTarget>
     57    <ErrorReport>prompt</ErrorReport>
     58  </PropertyGroup>
     59  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
     60    <OutputPath>bin\x64\Release\</OutputPath>
     61    <DefineConstants>TRACE</DefineConstants>
     62    <Optimize>true</Optimize>
     63    <DebugType>pdbonly</DebugType>
     64    <PlatformTarget>x64</PlatformTarget>
     65    <ErrorReport>prompt</ErrorReport>
     66  </PropertyGroup>
    5167  <ItemGroup>
    5268    <Reference Include="System" />
     
    6783  <ItemGroup>
    6884    <Compile Include="OpenMenuItem.cs" />
    69     <Compile Include="Resource1.Designer.cs">
    70       <AutoGen>True</AutoGen>
    71       <DesignTime>True</DesignTime>
    72       <DependentUpon>Resource1.resx</DependentUpon>
    73     </Compile>
    7485    <Compile Include="SaveMenuItem.cs" />
    7586    <Compile Include="HeuristicLabMainFormTestApplication.cs" />
     
    8596  </ItemGroup>
    8697  <ItemGroup>
     98    <ProjectReference Include="..\..\HeuristicLab.Common.Resources\3.2\HeuristicLab.Common.Resources.csproj">
     99      <Project>{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}</Project>
     100      <Name>HeuristicLab.Common.Resources</Name>
     101    </ProjectReference>
    87102    <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm.csproj">
    88103      <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
     
    95110  </ItemGroup>
    96111  <ItemGroup>
    97     <EmbeddedResource Include="Resource1.resx">
    98       <Generator>ResXFileCodeGenerator</Generator>
    99       <LastGenOutput>Resource1.Designer.cs</LastGenOutput>
    100     </EmbeddedResource>
    101   </ItemGroup>
    102   <ItemGroup>
    103     <None Include="Resources\saveHS.png" />
    104   </ItemGroup>
    105   <ItemGroup>
    106112    <None Include="Properties\AssemblyInfo.frame" />
    107     <None Include="Resources\openHS.png" />
    108113  </ItemGroup>
    109114  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/HeuristicLabMainFormTestPlugin.cs

    r2243 r2247  
    2929  [PluginFile(Filename = "HeuristicLab.MainForm.Test-3.2.dll", Filetype = PluginFileType.Assembly)] 
    3030  [Dependency(Dependency = "HeuristicLab.MainForm-3.2")]
     31  [Dependency(Dependency = "HeuristicLab.Common.Resources-3.2")]
    3132  public class HeuristicLabMainFormTestPlugin : PluginBase {
    3233  }
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/OpenMenuItem.cs

    r2243 r2247  
    33using System.Linq;
    44using System.Text;
    5 
     5using System.Windows.Forms;
    66using HeuristicLab.MainForm;
    7 using System.Windows.Forms;
     7using HeuristicLab.Common.Resources;
    88
    99namespace HeuristicLab.MainForm.Test {
    10   public class OpenMenuItem : ToolStripMenuItemBase, IToolStripButtonItem, ITestUserInterfaceItemProvider {
     10  public class OpenMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {
     11    public override string Name {
     12      get { return "Open"; }
     13    }   
     14
    1115    public override string MenuStructure {
    1216      get { return "File"; }
    1317    }
    1418
    15     public override string Name {
    16       get { return "Open"; }
     19    public override int Position {
     20      get { return 1100; }
    1721    }
    1822
    1923    public override Keys ShortCutKeys {
    2024      get { return Keys.Control | Keys.O; }
     25    }
     26
     27    public override System.Drawing.Image Image {
     28      get { return Resources.OpenIcon; }
    2129    }
    2230
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/Properties/AssemblyInfo.cs

    r2243 r2247  
    1 using System.Reflection;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Reflection;
    223using System.Runtime.CompilerServices;
    324using System.Runtime.InteropServices;
     
    829// associated with an assembly.
    930[assembly: AssemblyTitle("HeuristicLab.MainForm.Test")]
    10 [assembly: AssemblyDescription("")]
     31[assembly: AssemblyDescription("HeuristicLab mainform  test application")]
    1132[assembly: AssemblyConfiguration("")]
    12 [assembly: AssemblyCompany("Microsoft")]
    13 [assembly: AssemblyProduct("HeuristicLab.MainForm.Test")]
    14 [assembly: AssemblyCopyright("Copyright © Microsoft 2009")]
     33[assembly: AssemblyCompany("")]
     34[assembly: AssemblyProduct("HeuristicLab")]
     35[assembly: AssemblyCopyright("(c) 2002-2008 HEAL")]
    1536[assembly: AssemblyTrademark("")]
    1637[assembly: AssemblyCulture("")]
     
    2243
    2344// The following GUID is for the ID of the typelib if this project is exposed to COM
    24 [assembly: Guid("a80799b9-1882-4c61-bc7e-bca44b61c067")]
     45[assembly: Guid("f9718239-4d37-4410-84d7-9c3468b01cbf")]
    2546
    2647// Version information for an assembly consists of the following four values:
     
    3152//      Revision
    3253//
    33 // You can specify all the values or you can default the Build and Revision Numbers
     54// You can specify all the values or you can default the Revision and Build Numbers
    3455// by using the '*' as shown below:
    35 // [assembly: AssemblyVersion("1.0.*")]
    36 [assembly: AssemblyVersion("1.0.0.0")]
    37 [assembly: AssemblyFileVersion("1.0.0.0")]
    38 [assembly: AssemblyBuildDate("2009/08/04 18:20:50")]
    39 
     56[assembly: AssemblyVersion("3.2.0.2243")]
     57[assembly: AssemblyFileVersion("3.2.0.2243")]
     58[assembly: AssemblyBuildDate("2009/08/06 12:20:28")]
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/SaveMenuItem.cs

    r2243 r2247  
    33using System.Linq;
    44using System.Text;
     5using System.Windows.Forms;
    56
    67using HeuristicLab.MainForm;
    7 using System.Windows.Forms;
     8using HeuristicLab.Common.Resources;
    89
    910namespace HeuristicLab.MainForm.Test {
    1011  public class SaveMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {
    11     public override string MenuStructure {
    12       get { return "TEST/Test/Test/Test"; }
     12    public override string Name {
     13      get { return "Save"; }
    1314    }
    1415
    15     public override string Name {
    16       get { return "Save"; }
     16    public override string MenuStructure {
     17      get { return "File"; }
     18    }
     19
     20    public override int Position {
     21      get { return 1200; }
     22    }
     23
     24    public override Keys ShortCutKeys {
     25      get { return Keys.Control | Keys.S; }
     26    }
     27
     28    public override System.Drawing.Image Image {
     29      get { return Resources.SaveIcon; }
    1730    }
    1831
  • trunk/sources/HeuristicLab.MainForm.Test/3.2/ViewsMenuItem.cs

    r2243 r2247  
    88
    99namespace HeuristicLab.MainForm.Test {
    10   public class ViewsMenuItem : ToolStripMenuItemBase, IToolStripButtonItem, ITestUserInterfaceItemProvider {
    11     public override string MenuStructure {
    12       get { return "File"; }
    13     }
    14 
     10  public class ViewsMenuItem : ToolStripMenuItemBase, ITestUserInterfaceItemProvider {
    1511    public override string Name {
    1612      get { return "Views"; }
    1713    }
    1814
     15    public override int Position {
     16      get { return 2000; }
     17    }
     18
    1919    public override Keys ShortCutKeys {
    2020      get { return Keys.Control | Keys.V; }
    21     }
    22 
    23     public override System.Drawing.Image Image {
    24       get { return Resource1.openHS; }
    2521    }
    2622
  • trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IToolStripItem.cs

    r2243 r2247  
    2929namespace HeuristicLab.MainForm {
    3030  public interface IToolStripItem : IUserInterfaceItem {
     31    int Position { get; }
    3132    Image Image { get; }
    3233    ToolStripItemDisplayStyle DisplayStyle { get; }
  • trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs

    r2243 r2247  
    7979      Type[] userInterfaceTypes = ds.GetTypes(userInterfaceItemType);
    8080
    81       foreach (Type t in userInterfaceTypes.Where(t=> typeof(IToolStripMenuItem).IsAssignableFrom(t))) {
    82         if (!t.IsAbstract && !t.IsInterface && !t.HasElementType) {
    83           IToolStripMenuItem item = (IToolStripMenuItem) Activator.CreateInstance(t);
    84           AddToolStripMenuItem(item);
    85         }
     81      object[] items = ds.GetInstances(userInterfaceItemType);
     82      IEnumerable<IToolStripItem> toolStripItems = items.Where(mi => mi as IToolStripMenuItem != null).Cast<IToolStripItem>();
     83      toolStripItems = toolStripItems.OrderBy(x => x.Position);
     84      foreach (IToolStripMenuItem menuItem in toolStripItems) {
     85        AddToolStripMenuItem(menuItem);
    8686      }
    8787
    88       foreach (Type t in userInterfaceTypes.Where(t => typeof(IToolStripButtonItem).IsAssignableFrom(t))) {
    89         if (!t.IsAbstract && !t.IsInterface && !t.HasElementType) {
    90           IToolStripButtonItem item = (IToolStripButtonItem)Activator.CreateInstance(t);
    91           AddToolStripButtonItem(item);
    92         }
     88      items = ds.GetInstances(userInterfaceItemType);
     89      toolStripItems = items.Where(mi => mi as IToolStripButtonItem != null).Cast<IToolStripItem>();
     90      toolStripItems = toolStripItems.OrderBy(x => x.Position);
     91      foreach (IToolStripButtonItem toolStripButtonItem in toolStripItems) {
     92        AddToolStripButtonItem(toolStripButtonItem);
    9393      }
    9494    }
  • trunk/sources/HeuristicLab.MainForm/3.2/ToolStripItemBase.cs

    r2243 r2247  
    3232  public abstract class ToolStripItemBase : UserInterfaceItemBase, IToolStripItem {
    3333    #region IToolStripItem Members
     34    public abstract int Position { get; }
     35    public virtual ToolStripItemDisplayStyle DisplayStyle {
     36      get { return ToolStripItemDisplayStyle.ImageAndText; }
     37    }
     38
    3439    public virtual System.Drawing.Image Image {
    3540      get { return null; }
    36     }
    37 
    38     public virtual ToolStripItemDisplayStyle DisplayStyle {
    39       get { return ToolStripItemDisplayStyle.ImageAndText; }
    4041    }
    4142
  • trunk/sources/HeuristicLab.MainForm/3.2/ToolStripMenuItemBase.cs

    r2243 r2247  
    2828namespace HeuristicLab.MainForm {
    2929  public abstract class ToolStripMenuItemBase : ToolStripItemBase, IToolStripMenuItem {
    30     public virtual Keys ShortCutKeys { 
    31       get { return Keys.None; } 
     30    public virtual Keys ShortCutKeys {
     31      get { return Keys.None; }
    3232    }
    3333    public virtual string MenuStructure {
    3434      get { return string.Empty; }
     35    }
     36
     37    public override ToolStripItemDisplayStyle DisplayStyle {
     38      get { return ToolStripItemDisplayStyle.ImageAndText; }
    3539    }
    3640
  • trunk/sources/HeuristicLab.sln

    r2243 r2247  
    245245EndProject
    246246Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.MainForm.Test-3.2", "HeuristicLab.MainForm.Test\3.2\HeuristicLab.MainForm.Test-3.2.csproj", "{569E430B-B4CE-4B94-A44E-6246B6E4E3BC}"
     247EndProject
     248Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Common.Resources", "HeuristicLab.Common.Resources\3.2\HeuristicLab.Common.Resources.csproj", "{0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}"
    247249EndProject
    248250Global
     
    39143916    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
    39153917    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
    3916     {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|x64.ActiveCfg = Debug|Any CPU
     3918    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|x64.ActiveCfg = Debug|x64
     3919    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|x64.Build.0 = Debug|x64
    39173920    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|x86.ActiveCfg = Debug|x86
    39183921    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Debug|x86.Build.0 = Debug|x86
     
    39233926    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
    39243927    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|Any CPU.Build.0 = Release|Any CPU
    3925     {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|x64.ActiveCfg = Release|Any CPU
     3928    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|x64.ActiveCfg = Release|x64
     3929    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|x64.Build.0 = Release|x64
    39263930    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|x86.ActiveCfg = Release|x86
    39273931    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Release|x86.Build.0 = Release|x86
     
    39343938    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU
    39353939    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU
     3940    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU
     3941    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU
     3942    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU
     3943    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU
     3944    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
     3945    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
     3946    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|x64.ActiveCfg = Debug|x64
     3947    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|x64.Build.0 = Debug|x64
     3948    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|x86.ActiveCfg = Debug|x86
     3949    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Debug|x86.Build.0 = Debug|x86
     3950    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Modeling Debug|Any CPU.ActiveCfg = Debug|Any CPU
     3951    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Modeling Debug|Any CPU.Build.0 = Debug|Any CPU
     3952    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Modeling Debug|x64.ActiveCfg = Debug|Any CPU
     3953    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Modeling Debug|x86.ActiveCfg = Debug|Any CPU
     3954    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
     3955    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|Any CPU.Build.0 = Release|Any CPU
     3956    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|x64.ActiveCfg = Release|x64
     3957    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|x64.Build.0 = Release|x64
     3958    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|x86.ActiveCfg = Release|x86
     3959    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Release|x86.Build.0 = Release|x86
     3960    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.v3.2 Debug|Any CPU.ActiveCfg = Debug|Any CPU
     3961    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.v3.2 Debug|Any CPU.Build.0 = Debug|Any CPU
     3962    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.v3.2 Debug|x64.ActiveCfg = Debug|Any CPU
     3963    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.v3.2 Debug|x86.ActiveCfg = Debug|Any CPU
     3964    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU
     3965    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU
     3966    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU
     3967    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU
    39363968  EndGlobalSection
    39373969  GlobalSection(SolutionProperties) = preSolution
     
    40254057    {3BD61258-31DA-4B09-89C0-4F71FEF5F05A} = {410732DB-725A-4824-896B-C298978343C0}
    40264058    {569E430B-B4CE-4B94-A44E-6246B6E4E3BC} = {410732DB-725A-4824-896B-C298978343C0}
     4059    {0E27A536-1C4A-4624-A65E-DC4F4F23E3E1} = {410732DB-725A-4824-896B-C298978343C0}
    40274060    {A9E282EA-180F-4233-B809-AEDF0787545C} = {78982D7C-D63D-4A3D-AE1F-F58AC007603B}
    40284061    {BF7D9494-A586-457B-8DF9-ED599F9E6A71} = {78982D7C-D63D-4A3D-AE1F-F58AC007603B}
  • trunk/sources/HeuristicLab/CopyAssemblies.cmd

    r2243 r2247  
    2020copy "%SolutionDir%\HeuristicLab.Charting.Data\3.2\%Outdir%\HeuristicLab.Charting.Data-3.2.dll" .\plugins
    2121copy "%SolutionDir%\HeuristicLab.Charting.Data\3.3\%Outdir%\HeuristicLab.Charting.Data-3.3.dll" .\plugins
     22copy "%SolutionDir%\HeuristicLab.Common.Resources\3.2\%Outdir%\HeuristicLab.Common.Resources-3.2.dll" .\plugins
    2223copy "%SolutionDir%\HeuristicLab.Communication.Data\3.2\%Outdir%\HeuristicLab.Communication.Data-3.2.dll" .\plugins
    2324copy "%SolutionDir%\HeuristicLab.Communication.Operators\3.2\%Outdir%\HeuristicLab.Communication.Operators-3.2.dll" .\plugins
Note: See TracChangeset for help on using the changeset viewer.