Changeset 1422 for trunk


Ignore:
Timestamp:
May 11, 2010, 4:37:44 PM (12 years ago)
Author:
saternus
Message:

Add files

Location:
trunk/CrypTool
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypTool/App.xaml

    r1421 r1422  
    22             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4              StartupUri="MainWindow.xaml">
     4             Startup="OnStartup"
     5             StartupUri="SplashScreen.xaml">
    56    <Application.Resources>
    67         
  • trunk/CrypTool/App.xaml.cs

    r1421 r1422  
    55using System.Linq;
    66using System.Windows;
     7using System.Threading;
     8using Cryptool.Core;
    79
    810namespace CrypTool
     
    1315    public partial class App : Application
    1416    {
     17        private void OnStartup(object sender, StartupEventArgs e)
     18        {
     19            new Thread(LoadPlugins).Start();
     20        }
     21
     22        private void LoadPlugins()
     23        {
     24            PluginManager pluginMgr = new PluginManager();
     25            pluginMgr.OnPluginLoaded += new CrypCorePluginLoadedHandler(OnPluginLoaded);
     26            Dictionary<string, Type> plugins = pluginMgr.LoadTypes(AssemblySigningRequirement.LoadAllAssemblies);
     27            OpenMainWindow(plugins);
     28        }
     29
     30        private void OnPluginLoaded(object sender, PluginLoadedEventArgs args)
     31        {
     32            if (!Application.Current.Dispatcher.CheckAccess())
     33            {
     34                Application.Current.Dispatcher.BeginInvoke(new Action<Object, PluginLoadedEventArgs>(OnPluginLoaded), sender, args);
     35            }
     36            else
     37            {
     38                SplashScreen screen = (SplashScreen)this.MainWindow;
     39                screen.Text = args.AssemblyName;
     40                screen.Value = args.CurrentPluginNumber == 0 ? 0 : (int)((double)args.CurrentPluginNumber / (double)args.NumberPluginsFound * 100);
     41            }
     42        }
     43
     44        private void OpenMainWindow(Dictionary<string, Type> plugins)
     45        {
     46
     47            if (!Application.Current.Dispatcher.CheckAccess())
     48            {
     49                Application.Current.Dispatcher.BeginInvoke(new Action<Dictionary<string, Type>>(OpenMainWindow), plugins);
     50            }
     51            else
     52            {
     53                SplashScreen screen = (SplashScreen)this.MainWindow;
     54                MainWindow wnd = new CrypTool.MainWindow();
     55                wnd.LoadedTypes = plugins;
     56                Application.Current.MainWindow = wnd;
     57               
     58                screen.Close();
     59                Application.Current.MainWindow.Show();
     60            }
     61        }
    1562    }
    1663}
  • trunk/CrypTool/CrypTool.csproj

    r1421 r1422  
    1212    <AssemblyName>CrypTool</AssemblyName>
    1313    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    14     <TargetFrameworkProfile>Client</TargetFrameworkProfile>
     14    <TargetFrameworkProfile>
     15    </TargetFrameworkProfile>
    1516    <FileAlignment>512</FileAlignment>
    1617    <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     
    2223    <DebugType>full</DebugType>
    2324    <Optimize>false</Optimize>
    24     <OutputPath>bin\Debug\</OutputPath>
     25    <OutputPath>..\CrypBuild\x86\Debug\</OutputPath>
    2526    <DefineConstants>DEBUG;TRACE</DefineConstants>
    2627    <ErrorReport>prompt</ErrorReport>
     
    3132    <DebugType>pdbonly</DebugType>
    3233    <Optimize>true</Optimize>
    33     <OutputPath>bin\Release\</OutputPath>
     34    <OutputPath>..\CrypBuild\x86\Release\</OutputPath>
    3435    <DefineConstants>TRACE</DefineConstants>
    3536    <ErrorReport>prompt</ErrorReport>
    3637    <WarningLevel>4</WarningLevel>
     38  </PropertyGroup>
     39  <PropertyGroup>
     40    <StartupObject>CrypTool.App</StartupObject>
     41  </PropertyGroup>
     42  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
     43    <DebugSymbols>true</DebugSymbols>
     44    <OutputPath>..\CrypBuild\x64\Debug\</OutputPath>
     45    <DefineConstants>DEBUG;TRACE</DefineConstants>
     46    <DebugType>full</DebugType>
     47    <PlatformTarget>x64</PlatformTarget>
     48    <CodeAnalysisLogFile>bin\Debug\CrypTool.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
     49    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
     50    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
     51    <ErrorReport>prompt</ErrorReport>
     52    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     53    <CodeAnalysisRuleSetDirectories>;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
     54    <CodeAnalysisRuleDirectories>;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
     55  </PropertyGroup>
     56  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     57    <OutputPath>..\CrypBuild\x64\Release\</OutputPath>
     58    <DefineConstants>TRACE</DefineConstants>
     59    <Optimize>true</Optimize>
     60    <DebugType>pdbonly</DebugType>
     61    <PlatformTarget>x64</PlatformTarget>
     62    <CodeAnalysisLogFile>bin\Release\CrypTool.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
     63    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
     64    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
     65    <ErrorReport>prompt</ErrorReport>
     66    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
     67    <CodeAnalysisRuleSetDirectories>;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
     68    <CodeAnalysisRuleDirectories>;C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    3769  </PropertyGroup>
    3870  <ItemGroup>
     
    5688      <SubType>Designer</SubType>
    5789    </ApplicationDefinition>
     90    <Compile Include="SplashScreen.xaml.cs">
     91      <DependentUpon>SplashScreen.xaml</DependentUpon>
     92    </Compile>
    5893    <Page Include="MainWindow.xaml">
    5994      <Generator>MSBuild:Compile</Generator>
     
    68103      <SubType>Code</SubType>
    69104    </Compile>
     105    <Page Include="SplashScreen.xaml">
     106      <SubType>Designer</SubType>
     107      <Generator>MSBuild:Compile</Generator>
     108    </Page>
    70109  </ItemGroup>
    71110  <ItemGroup>
     
    87126      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
    88127    </EmbeddedResource>
     128    <None Include="app.config" />
    89129    <None Include="Properties\Settings.settings">
    90130      <Generator>SettingsSingleFileGenerator</Generator>
     
    92132    </None>
    93133    <AppDesigner Include="Properties\" />
     134  </ItemGroup>
     135  <ItemGroup>
     136    <Resource Include="Images\SplashScreen.png" />
     137  </ItemGroup>
     138  <ItemGroup>
     139    <ProjectReference Include="..\CrypCore\CrypCore.csproj">
     140      <Project>{FF5D473C-0716-4D3E-9078-2EBD979F94C6}</Project>
     141      <Name>CrypCore</Name>
     142      <Private>False</Private>
     143    </ProjectReference>
     144    <ProjectReference Include="..\CrypPluginBase\CrypPluginBase.csproj">
     145      <Project>{25DB2B47-A457-4EC2-960B-395CE07AE093}</Project>
     146      <Name>CrypPluginBase</Name>
     147      <Private>False</Private>
     148    </ProjectReference>
    94149  </ItemGroup>
    95150  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  • trunk/CrypTool/CrypTool.sln

    r1421 r1422  
    66Global
    77        GlobalSection(SolutionConfigurationPlatforms) = preSolution
     8                Debug|x64 = Debug|x64
    89                Debug|x86 = Debug|x86
     10                Release|x64 = Release|x64
    911                Release|x86 = Release|x86
    1012        EndGlobalSection
    1113        GlobalSection(ProjectConfigurationPlatforms) = postSolution
     14                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Debug|x64.ActiveCfg = Debug|x64
     15                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Debug|x64.Build.0 = Debug|x64
    1216                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Debug|x86.ActiveCfg = Debug|x86
    1317                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Debug|x86.Build.0 = Debug|x86
     18                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Release|x64.ActiveCfg = Release|x64
     19                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Release|x64.Build.0 = Release|x64
    1420                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Release|x86.ActiveCfg = Release|x86
    1521                {3A40A779-9A54-4633-8A3C-CE0AD4623A85}.Release|x86.Build.0 = Release|x86
  • trunk/CrypTool/MainWindow.xaml

    r1421 r1422  
    22        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4         Title="MainWindow" Height="350" Width="525">
     4        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
    55    <Grid>
    6        
     6        <Image Height="150" HorizontalAlignment="Left" Margin="291,12,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" Source="/CrypTool;component/Images/SplashScreen.png" />
     7        <ListBox Height="311" HorizontalAlignment="Left" Name="listBox1" VerticalAlignment="Top" Width="198" />
    78    </Grid>
    89</Window>
  • trunk/CrypTool/MainWindow.xaml.cs

    r1421 r1422  
    1212using System.Windows.Navigation;
    1313using System.Windows.Shapes;
     14using Cryptool.PluginBase;
    1415
    1516namespace CrypTool
     
    2021    public partial class MainWindow : Window
    2122    {
     23        private Dictionary<string, List<Type>> currentPlugins = new Dictionary<string, List<Type>>();
     24
     25       
     26
     27       
     28        public Dictionary<string, Type> LoadedTypes { get; set; }
     29       
     30
     31
     32
    2233        public MainWindow()
    2334        {
    2435            InitializeComponent();
    2536        }
     37
     38
     39
     40
     41        private void LoadPlugins()
     42        {
     43            foreach (Type pluginType in this.LoadedTypes.Values)
     44            {
     45                if (pluginType.GetEditorSpecificPluginAttribute() != null)
     46                    continue;
     47               
     48                foreach (string interfaceName in PluginExtension.Interfaces)
     49                {
     50                    if (pluginType.GetInterface(interfaceName) != null)
     51                    {
     52                        if (!this.currentPlugins.ContainsKey(interfaceName))
     53                            this.currentPlugins.Add(interfaceName, new List<Type>());
     54                        this.currentPlugins[interfaceName].Add(pluginType);
     55
     56
     57
     58                    }
     59                }
     60            }
     61
     62
     63        }
     64
     65        private void Window_Loaded(object sender, RoutedEventArgs e)
     66        {
     67            LoadPlugins();
     68        }
     69
    2670    }
    2771}
  • trunk/CrypTool/Properties/Resources.Designer.cs

    r1421 r1422  
    99//------------------------------------------------------------------------------
    1010
    11 namespace CrypTool.Properties
    12 {
    13 
    14 
     11namespace CrypTool.Properties {
     12    using System;
     13   
     14   
    1515    /// <summary>
    1616    ///   A strongly-typed resource class, for looking up localized strings, etc.
     
    2323    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    2424    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    25     internal class Resources
    26     {
    27 
     25    internal class Resources {
     26       
    2827        private static global::System.Resources.ResourceManager resourceMan;
    29 
     28       
    3029        private static global::System.Globalization.CultureInfo resourceCulture;
    31 
     30       
    3231        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
    33         internal Resources()
    34         {
     32        internal Resources() {
    3533        }
    36 
     34       
    3735        /// <summary>
    3836        ///   Returns the cached ResourceManager instance used by this class.
    3937        /// </summary>
    4038        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
    41         internal static global::System.Resources.ResourceManager ResourceManager
    42         {
    43             get
    44             {
    45                 if ((resourceMan == null))
    46                 {
     39        internal static global::System.Resources.ResourceManager ResourceManager {
     40            get {
     41                if (object.ReferenceEquals(resourceMan, null)) {
    4742                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CrypTool.Properties.Resources", typeof(Resources).Assembly);
    4843                    resourceMan = temp;
     
    5146            }
    5247        }
    53 
     48       
    5449        /// <summary>
    5550        ///   Overrides the current thread's CurrentUICulture property for all
     
    5752        /// </summary>
    5853        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
    59         internal static global::System.Globalization.CultureInfo Culture
    60         {
    61             get
    62             {
     54        internal static global::System.Globalization.CultureInfo Culture {
     55            get {
    6356                return resourceCulture;
    6457            }
    65             set
    66             {
     58            set {
    6759                resourceCulture = value;
    6860            }
  • trunk/CrypTool/Properties/Settings.Designer.cs

    r1421 r1422  
    99//------------------------------------------------------------------------------
    1010
    11 namespace CrypTool.Properties
    12 {
    13 
    14 
     11namespace CrypTool.Properties {
     12   
     13   
    1514    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    1615    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
    17     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
    18     {
    19 
     16    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
     17       
    2018        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
    21 
    22         public static Settings Default
    23         {
    24             get
    25             {
     19       
     20        public static Settings Default {
     21            get {
    2622                return defaultInstance;
    2723            }
Note: See TracChangeset for help on using the changeset viewer.