Changeset 1457


Ignore:
Timestamp:
May 21, 2010, 3:16:03 PM (12 years ago)
Author:
saternus
Message:

ct changes

Location:
trunk/CrypTool
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypTool/App.xaml.cs

    r1422 r1457  
    2525            pluginMgr.OnPluginLoaded += new CrypCorePluginLoadedHandler(OnPluginLoaded);
    2626            Dictionary<string, Type> plugins = pluginMgr.LoadTypes(AssemblySigningRequirement.LoadAllAssemblies);
    27             OpenMainWindow(plugins);
     27            OpenMainWindow(plugins, pluginMgr);
    2828        }
    2929
     
    4242        }
    4343
    44         private void OpenMainWindow(Dictionary<string, Type> plugins)
     44        private void OpenMainWindow(Dictionary<string, Type> plugins, PluginManager mgr)
    4545        {
    4646
    4747            if (!Application.Current.Dispatcher.CheckAccess())
    4848            {
    49                 Application.Current.Dispatcher.BeginInvoke(new Action<Dictionary<string, Type>>(OpenMainWindow), plugins);
     49                Application.Current.Dispatcher.BeginInvoke(new Action<Dictionary<string, Type>, PluginManager>(OpenMainWindow), plugins, mgr);
    5050            }
    5151            else
     
    5454                MainWindow wnd = new CrypTool.MainWindow();
    5555                wnd.LoadedTypes = plugins;
     56                wnd.PluginManager = mgr;
    5657                Application.Current.MainWindow = wnd;
    5758               
  • trunk/CrypTool/MainWindow.xaml

    r1429 r1457  
    4343                    <ScaleTransform ScaleX="1" ScaleY="1"></ScaleTransform>
    4444                </StackPanel.LayoutTransform>
    45                 <dc:RibbonButton LargeImage="images/File32.png" ToolTip="New File" />
     45                <dc:RibbonButton LargeImage="images/File32.png" ToolTip="New File"   />
    4646                    <dc:RibbonButton LargeImage="images/Open32.png" ToolTip="Open File" />
    4747                    <dc:RibbonButton LargeImage="images/Save32.png" ToolTip="Save File" />
    48                     <dc:RibbonSeparator Height="35"></dc:RibbonSeparator>
    49                     <dc:RibbonButton LargeImage="images/play.png" ToolTip="Start" />
     48                    <dc:RibbonSeparator></dc:RibbonSeparator>
     49                    <dc:RibbonButton LargeImage="images/play.png" ToolTip="Start" Click="Run_Click"   />
    5050                    <dc:RibbonButton LargeImage="images/pause.png" ToolTip="Pause" />
    5151                    <dc:RibbonButton LargeImage="images/stop.png" ToolTip="Stop" />
     
    207207        <!--Editor-->
    208208        <Grid Name="EditorSpace">
    209             <Image Height="150" HorizontalAlignment="Left" Margin="291,12,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="200" Source="images/SplashScreen.png" />
     209           
     210            <TabControl >
     211                <TabItem Header="AnotherEditor" Name="Editor"></TabItem>
     212                <TabItem Header="SimpleEditor"></TabItem>
     213               
     214            </TabControl>
    210215        </Grid>
     216       
     217       
     218       
    211219    </DockPanel>
    212220</dc:RibbonWindow>
  • trunk/CrypTool/MainWindow.xaml.cs

    r1429 r1457  
    2020using Cryptool.PluginBase.Cryptography;
    2121using Cryptool.PluginBase.Editor;
     22using Cryptool.Core;
    2223
    2324namespace CrypTool
     
    3233        public Dictionary<string, Type> LoadedTypes { get; set; }
    3334
     35        public PluginManager PluginManager { get; set; }
     36
    3437        public MainWindow()
    3538        {
     
    3942        private void RibbonButton_Click(object sender, RoutedEventArgs e)
    4043        {
    41             this.activeEditor.Open(@"C:\Users\saternmn\Eigene SVN Projekte\CrypTool\Build\Build\CT2\CrypBuild\x86\Debug\ProjectSamples\Caesar-Sample.cte");
     44            this.activeEditor.PluginManager = this.PluginManager;
     45
     46            this.activeEditor.Open(@"C:\Users\saternmn\Eigene SVN Projekte\CrypTool\Build\Build\CT2\CrypBuild\x86\Debug\ProjectSamples\Caesar_ExhaustiveKeySearch.cte");
    4247           
    4348            if (SkinManager.SkinId == SkinId.OfficeBlue)
     
    7782                        if (interfaceName == typeof(Cryptool.PluginBase.Editor.IEditor).FullName)
    7883                        {
    79                             this.activeEditor = (IEditor)Activator.CreateInstance(pluginType);
    80                             this.EditorSpace.Children.Add(this.activeEditor.Presentation);
    81                            
     84                            if (pluginType.Name != "SimpleEditor")
     85                            {
     86                                this.activeEditor = (IEditor)Activator.CreateInstance(pluginType);
     87                                this.Editor.Content = this.activeEditor.Presentation;
     88                            }
    8289
    8390                        }
     
    170177        }
    171178
    172 
     179        private void Run_Click(object sender, RoutedEventArgs e)
     180        {
     181            this.activeEditor.Execute();
     182        }
    173183    }
    174184
Note: See TracChangeset for help on using the changeset viewer.