Changeset 2295


Ignore:
Timestamp:
Jan 7, 2011, 2:25:21 PM (11 years ago)
Author:
Sven Rech
Message:

Prepared KeySearcher for Localization

Location:
trunk
Files:
5 added
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/CrypPluginBase/Attributes/SettingsTabAttribute.cs

    r2227 r2295  
    2626    public class SettingsTabAttribute : Attribute
    2727    {
    28         public string ResourceFile { get; private set; }
    2928        public string Caption { get; private set; }
    3029        public string Address { get; private set; }
    3130
    32         public SettingsTabAttribute(string resourceFile, string caption, string address)
     31        public SettingsTabAttribute(string caption, string address)
    3332        {
    34             ResourceFile = resourceFile;
    3533            Caption = caption;
    3634            Address = address;
  • trunk/CrypPluginBase/CrypPluginBase.csproj

    r2227 r2295  
    106106  <ItemGroup>
    107107    <Compile Include="Attributes\DontSaveAttribute.cs" />
     108    <Compile Include="Attributes\LocalizationAttribute.cs" />
    108109    <Compile Include="Attributes\SettingsFormatAttribute.cs" />
    109110    <Compile Include="Attributes\ContextMenuAttribute.cs" />
     
    141142    </Compile>
    142143    <Compile Include="Miscellaneous\Msieve.cs" />
    143     <Compile Include="Miscellaneous\SLocExtension.cs" />
     144    <Compile Include="Miscellaneous\LocExtension.cs" />
    144145    <Compile Include="Miscellaneous\SuperTooltip.cs" />
    145146    <Compile Include="Miscellaneous\Tokenizer.cs" />
  • trunk/CrypPluginBase/Miscellaneous/LocExtension.cs

    r2294 r2295  
    3333    [MarkupExtensionReturnType(typeof(object))]
    3434    [ContentProperty("Key")]
    35     public class SLocExtension : MarkupExtension
     35    public class LocExtension : MarkupExtension
    3636    {
    3737        public string Key { get; set; }
    3838
    39         public SLocExtension(String key)
     39        public LocExtension(String key)
    4040        {
    4141            Key = key;
     
    4747            {
    4848                IRootObjectProvider service = serviceProvider.GetService(typeof(IRootObjectProvider)) as IRootObjectProvider;
    49                 var tabAttribute = (SettingsTabAttribute)Attribute.GetCustomAttribute(service.RootObject.GetType(), typeof(SettingsTabAttribute));
    50                 ResourceManager resman = new ResourceManager(tabAttribute.ResourceFile, service.RootObject.GetType().Assembly);
     49                var locAttribute = (LocalizationAttribute)Attribute.GetCustomAttribute(service.RootObject.GetType(), typeof(LocalizationAttribute));
     50                ResourceManager resman = new ResourceManager(locAttribute.ResourceFile, service.RootObject.GetType().Assembly);
    5151                return resman.GetString(Key);
    5252            }
  • trunk/CrypPlugins/KeySearcher/KeySearcher.cs

    r2293 r2295  
    4040using KeySearcherPresentation;
    4141using KeySearcherPresentation.Controls;
     42using KeySearcher.Properties;
    4243using OpenCLNet;
    4344
     
    332333                else
    333334                {
    334                     GuiLogMessage("You have to connect the KeySearcher with the Decryption Control!", NotificationLevel.Warning);
     335                    GuiLogMessage(Resources.You_have_to_connect_the_KeySearcher_with_the_Decryption_Control_, NotificationLevel.Warning);
    335336                }
    336337            }
     
    733734        {
    734735            beginBruteforcing = DateTime.Now;
    735             GuiLogMessage("Start bruteforcing pattern '" + pattern.getKey() + "'", NotificationLevel.Debug);
     736            GuiLogMessage(Resources.Start_bruteforcing_pattern__ + pattern.getKey() + "'", NotificationLevel.Debug);
    736737                       
    737738            int maxInList = 10;
     
    747748            if (!pattern.testWildcardKey(settings.Key))
    748749            {
    749                 GuiLogMessage("Wrong key pattern!", NotificationLevel.Error);
     750                GuiLogMessage(Resources.Wrong_key_pattern_, NotificationLevel.Error);
    750751                return null;
    751752            }
     
    759760            catch (Exception ex)
    760761            {
    761                 GuiLogMessage("Bytes used not valid: " + ex.Message, NotificationLevel.Error);
     762                GuiLogMessage(Resources.Bytes_used_not_valid__ + ex.Message, NotificationLevel.Error);
    762763                return null;
    763764            }
     
    768769                if (settings.UseExternalClient)
    769770                {
    770                     GuiLogMessage("Waiting for external client!", NotificationLevel.Info);
     771                    GuiLogMessage(Resources.Waiting_for_external_client_, NotificationLevel.Info);
    771772                    cryptoolServer = new CryptoolServer();
    772773                    externalClientConnected = null;
     
    807808            if (!update)
    808809            {
    809                 GuiLogMessage("Launching p2p based bruteforce logic...", NotificationLevel.Info);
     810                GuiLogMessage(Resources.Launching_p2p_based_bruteforce_logic___, NotificationLevel.Info);
    810811
    811812                try
     
    818819                catch (NotConnectedException)
    819820                {
    820                     GuiLogMessage("P2P not connected.", NotificationLevel.Error);
     821                    GuiLogMessage(Resources.P2P_not_connected_, NotificationLevel.Error);
    821822                }
    822823                catch (KeySearcherStopException)
     
    828829            else
    829830            {
    830                 GuiLogMessage("Keysearcher Fullstop.Please Update your Version.", NotificationLevel.Error);
     831                GuiLogMessage(Resources.Keysearcher_Fullstop__Please_Update_your_Version_, NotificationLevel.Error);
    831832                Thread.Sleep(3000);
    832833            }
     
    852853            if (settings.UseExternalClient)
    853854            {
    854                 GuiLogMessage("Only using external client to bruteforce!", NotificationLevel.Info);
     855                GuiLogMessage(Resources.Only_using_external_client_to_bruteforce_, NotificationLevel.Info);
    855856                lock (this)
    856857                {
     
    871872                if (patterns == null || patterns.Length == 0)
    872873                {
    873                     GuiLogMessage("No ressources to BruteForce available. Check the KeySearcher settings!", NotificationLevel.Error);
     874                    GuiLogMessage(Resources.No_ressources_to_BruteForce_available__Check_the_KeySearcher_settings_, NotificationLevel.Error);
    874875                    throw new Exception("No ressources to BruteForce available. Check the KeySearcher settings!");
    875876                }
     
    905906
    906907                    if (keycounter > keysInThisChunk)
    907                         GuiLogMessage("There must be an error, because we bruteforced too much keys...", NotificationLevel.Error);
     908                        GuiLogMessage(Resources.There_must_be_an_error__because_we_bruteforced_too_much_keys___, NotificationLevel.Error);
    908909
    909910                    #region determination of the thread with most keys
     
    986987            StringBuilder sbBFTime = new StringBuilder();
    987988            if (bruteforcingTime.Days > 0)
    988                 sbBFTime.Append(bruteforcingTime.Days.ToString() + " days ");
     989                sbBFTime.Append(bruteforcingTime.Days.ToString() + Resources._days_);
    989990            if (bruteforcingTime.Hours > 0)
    990991            {
     
    10051006            sbBFTime.Append(bruteforcingTime.Milliseconds.ToString());
    10061007
    1007             GuiLogMessage("Ended bruteforcing pattern '" + pattern.getKey() + "'. Bruteforcing TimeSpan: " + sbBFTime.ToString(), NotificationLevel.Debug);
     1008            GuiLogMessage(Resources.Ended_bruteforcing_pattern__ + pattern.getKey() + Resources.___Bruteforcing_TimeSpan__ + sbBFTime.ToString(), NotificationLevel.Debug);
    10081009            /* END: For evaluation issues - added by Arnold 2010.03.17 */
    10091010
     
    10151016        void cryptoolServer_OnClientDisconnected(EndPoint client)
    10161017        {
    1017             GuiLogMessage("Client disconnected!", NotificationLevel.Info);
     1018            GuiLogMessage(Resources.Client_disconnected_, NotificationLevel.Info);
    10181019            externalClientConnected = null;
    10191020        }
     
    10261027                {
    10271028                    externalClientConnected = client;
    1028                     GuiLogMessage(string.Format("Client {0} connected!", identification), NotificationLevel.Info);
     1029                    GuiLogMessage(string.Format(Resources.Client__0__connected_, identification), NotificationLevel.Info);
    10291030                    AssignJobToClient(client, externalKeySearcherOpenCLCode.CreateOpenCLBruteForceCode(externalKeyTranslator));
    10301031                }
    10311032                else
    10321033                {
    1033                     GuiLogMessage("Client tried to connect, but only one client allowed!", NotificationLevel.Info);
     1034                    GuiLogMessage(Resources.Client_tried_to_connect__but_only_one_client_allowed_, NotificationLevel.Info);
    10341035                }
    10351036            }
     
    10461047            j.Size = externalKeyTranslator.GetOpenCLBatchSize();
    10471048            j.ResultSize = 10;
    1048             GuiLogMessage(string.Format("Assigning new job with Guid {0} to client!", j.Guid), NotificationLevel.Info);
     1049            GuiLogMessage(string.Format(Resources.Assigning_new_job_with_Guid__0__to_client_, j.Guid), NotificationLevel.Info);
    10491050            cryptoolServer.SendJob(j, client);
    10501051            assignTime = DateTime.Now;
     
    10531054        void server_OnJobCompleted(System.Net.EndPoint client, JobResult jr)
    10541055        {
    1055             GuiLogMessage(string.Format("Client returned result of job with Guid {0}!", jr.Guid), NotificationLevel.Info);
     1056            GuiLogMessage(string.Format(Resources.Client_returned_result_of_job_with_Guid__0__, jr.Guid), NotificationLevel.Info);
    10561057            //check:
    10571058            var op = this.costMaster.getRelationOperator();
     
    11481149                        catch
    11491150                        {
    1150                             localQuickWatchPresentation.endTime.Content = "in a galaxy far, far away...";
     1151                            localQuickWatchPresentation.endTime.Content = Resources.in_a_galaxy_far__far_away___;
    11511152                        }
    11521153                    }
    11531154                    else
    11541155                    {
    1155                         localQuickWatchPresentation.timeLeft.Content = "incalculable :-)";
    1156                         localQuickWatchPresentation.endTime.Content = "in a galaxy far, far away...";
     1156                        localQuickWatchPresentation.timeLeft.Content = Resources.incalculable____;
     1157                        localQuickWatchPresentation.endTime.Content = Resources.in_a_galaxy_far__far_away___;
    11571158                    }
    11581159
     
    12131214            else
    12141215                valueKey.value = double.MinValue;
    1215             valueKey.key = "dummykey";
     1216            valueKey.key = Resources.dummykey;
    12161217            valueKey.decryption = new byte[0];
    12171218            value_threshold = valueKey.value;
  • trunk/CrypPlugins/KeySearcher/KeySearcher.csproj

    r2285 r2295  
    159159    <Compile Include="Properties\AssemblyInfo.cs" />
    160160    <Compile Include="KeyPattern\Wildcard.cs" />
     161    <Compile Include="Properties\Resources.de-DE.Designer.cs">
     162      <DependentUpon>Resources.de-DE.resx</DependentUpon>
     163      <AutoGen>True</AutoGen>
     164      <DesignTime>True</DesignTime>
     165    </Compile>
     166    <Compile Include="Properties\Resources.Designer.cs">
     167      <AutoGen>True</AutoGen>
     168      <DesignTime>True</DesignTime>
     169      <DependentUpon>Resources.resx</DependentUpon>
     170    </Compile>
    161171    <Compile Include="Server\Job.cs" />
    162172    <Compile Include="Server\Opcodes.cs" />
     
    243253    <Folder Include="Server\.svn\tmp\text-base\" />
    244254  </ItemGroup>
     255  <ItemGroup>
     256    <EmbeddedResource Include="Properties\Resources.de-DE.resx">
     257      <Generator>ResXFileCodeGenerator</Generator>
     258      <LastGenOutput>Resources.de-DE.Designer.cs</LastGenOutput>
     259      <SubType>Designer</SubType>
     260    </EmbeddedResource>
     261    <EmbeddedResource Include="Properties\Resources.resx">
     262      <Generator>ResXFileCodeGenerator</Generator>
     263      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     264      <SubType>Designer</SubType>
     265    </EmbeddedResource>
     266  </ItemGroup>
    245267  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    246268  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  • trunk/CrypPlugins/KeySearcher/KeySearcherSettings.cs

    r2282 r2295  
    66using System.Collections.ObjectModel;
    77using KeySearcher.P2P.Storage;
     8using KeySearcher.Properties;
    89using OpenCLNet;
    910
     
    8182                OnPropertyChanged("Key");
    8283                if (!(keysearcher.Pattern != null && keysearcher.Pattern.testWildcardKey(value)))
    83                     keysearcher.GuiLogMessage("Wrong key pattern!", NotificationLevel.Error);
     84                    keysearcher.GuiLogMessage(Resources.Wrong_key_pattern_, NotificationLevel.Error);
    8485                HasChanges = true;
    8586            }
     
    180181            if (!keysearcher.IsKeySearcherRunning)
    181182            {
    182                 keysearcher.GuiLogMessage("KeySearcher must be running to copy the status key.", NotificationLevel.Error);
     183                keysearcher.GuiLogMessage(Resources.KeySearcher_must_be_running_to_copy_the_status_key_, NotificationLevel.Error);
    183184                return;
    184185            }
     
    188189
    189190            Clipboard.SetDataObject(statusKey, true);
    190             keysearcher.GuiLogMessage("Status key '" + statusKey + "' has been copied to clipboard.",
     191            keysearcher.GuiLogMessage(string.Format(Resources.Status_key___0___has_been_copied_to_clipboard_, statusKey),
    191192                                      NotificationLevel.Info);
    192193        }
     
    273274        public string NoOpenCL
    274275        {
    275             get { return "No OpenCL Device available!"; }
     276            get { return Resources.No_OpenCL_Device_available_; }
    276277            set {}
    277278        }
  • trunk/CrypPlugins/KeySearcher/OpenCL/KeySearcherOpenCLCode.cs

    r2202 r2295  
    55using Cryptool.PluginBase;
    66using Cryptool.PluginBase.Control;
     7using KeySearcher.Properties;
    78using OpenCLNet;
    89
     
    8485            catch (Exception ex)
    8586            {
    86                 throw new Exception("An error occured when trying to compile OpenCL code: " + ex.Message);
     87                throw new Exception(Resources.An_error_occured_when_trying_to_compile_OpenCL_code__ + ex.Message);
    8788            }
    8889        }
  • trunk/CrypPlugins/KeySearcher/P2P/DistributedBruteForceManager.cs

    r2283 r2295  
    1616using KeySearcher.P2P.Tree;
    1717using KeySearcherPresentation.Controls;
     18using KeySearcher.Properties;
    1819using System.Timers;
    1920using Timer = System.Timers.Timer;
     
    6263        public void Execute()
    6364        {
    64             status.CurrentOperation = "Initializing connection to the peer-to-peer system";
     65            status.CurrentOperation = Resources.Initializing_connection_to_the_peer_to_peer_system;
    6566            new ConnectionHelper(keySearcher, settings).ValidateConnectionToPeerToPeerSystem();
    6667
    6768            if (!P2PManager.IsConnected)
    6869            {
    69                 keySearcher.GuiLogMessage("Unable to use peer-to-peer system.", NotificationLevel.Error);
    70                 status.CurrentOperation = "Unable to use peer-to-peer system";
     70                keySearcher.GuiLogMessage(Resources.Unable_to_use_peer_to_peer_system_, NotificationLevel.Error);
     71                status.CurrentOperation = Resources.Unable_to_use_peer_to_peer_system_;
    7172                return;
    7273            }
    7374
    74             status.CurrentOperation = "Initializing distributed key pool tree";
     75            status.CurrentOperation = Resources.Initializing_distributed_key_pool_tree;
    7576            InitializeTree();
    7677           
     
    8990                    keySearcher.ResetStatistics();
    9091                    keySearcher.SetInitialized(false);
    91                     status.CurrentOperation = "Updating statistic";
     92                    status.CurrentOperation = Resources.Updating_statistic;
    9293                    InitializeTree();
    9394                    statupdate = false;
     
    101102                try
    102103                {
    103                     status.CurrentOperation = "Finding next leaf to calculate";
     104                    status.CurrentOperation = Resources.Finding_next_leaf_to_calculate;
    104105                    currentLeaf = keyPoolTree.FindNextLeaf();
    105106                    if (currentLeaf == null)
     
    111112                catch (AlreadyCalculatedException)
    112113                {
    113                     keySearcher.GuiLogMessage("Node was already calculated.", NotificationLevel.Info);
     114                    keySearcher.GuiLogMessage(Resources.Node_was_already_calculated_, NotificationLevel.Info);
    114115                    keyPoolTree.Reset();
    115116                    continue;
     
    117118                catch (KeySearcherStopException)  //Fullstopfunction
    118119                {
    119                     keySearcher.GuiLogMessage("Keysearcher Fullstop.Please Update your Version.", NotificationLevel.Debug);
    120                     status.CurrentOperation = "PLEASE UPDATE";
     120                    keySearcher.GuiLogMessage(Resources.Keysearcher_Fullstop__Please_Update_your_Version_, NotificationLevel.Debug);
     121                    status.CurrentOperation = Resources.PLEASE_UPDATE;
    121122                    keyPoolTree.Reset();
    122123                    keySearcher.Stop();
     
    129130                {
    130131                    keySearcher.GuiLogMessage(
    131                         "Pattern #" + displayablePatternId +
    132                         " was reserved before it could be reserved for this CrypTool instance.",
     132                        string.Format(Resources.Pattern___0__was_reserved_before_it_could_be_reserved_for_this_CrypTool_instance_, displayablePatternId),
    133133                        NotificationLevel.Info);
    134134                    keyPoolTree.Reset();
     
    141141                                                                        {
    142142                                                                            var oldMessage = status.CurrentOperation;
    143                                                                             var message = string.Format("Rereserving pattern #{0}", displayablePatternId);
     143                                                                            var message = string.Format(Resources.Rereserving_pattern___0_, displayablePatternId);
    144144                                                                            keySearcher.GuiLogMessage(message, NotificationLevel.Info);
    145145                                                                            status.CurrentOperation = message;
     
    147147                                                                            {
    148148                                                                                if (!currentLeaf.ReserveLeaf())
    149                                                                                     keySearcher.GuiLogMessage("Rereserving pattern failed!", NotificationLevel.Warning);
     149                                                                                    keySearcher.GuiLogMessage(Resources.Rereserving_pattern_failed_, NotificationLevel.Warning);
    150150
    151151                                                                                //if (!currentLeaf.ReserveLeaf())
     
    159159                                                                            catch (Cryptool.P2P.Internal.NotConnectedException)
    160160                                                                            {
    161                                                                                 keySearcher.GuiLogMessage("Rereserving pattern failed, because there is no connection!",
     161                                                                                keySearcher.GuiLogMessage(Resources.Rereserving_pattern_failed__because_there_is_no_connection_,
    162162                                                                                        NotificationLevel.Warning);
    163163                                                                                //TODO: Register OnSystemJoined event to rereserve pattern immediately after reconnect
     
    172172
    173173                keySearcher.GuiLogMessage(
    174                     "Running pattern #" + displayablePatternId + " of " + patternPool.Length,
     174                    string.Format(Resources.Running_pattern___0__of__1_, displayablePatternId, patternPool.Length),
    175175                    NotificationLevel.Info);
    176176                status.CurrentChunk = displayablePatternId;
    177                 status.CurrentOperation = "Calculating pattern " + status.CurrentChunk;
     177                status.CurrentOperation = Resources.Calculating_pattern_ + status.CurrentChunk;
    178178
    179179                try
     
    205205                        if (!P2PManager.IsConnected)
    206206                        {
    207                             status.CurrentOperation = "Connection lost! Waiting for reconnection to store the results!";
     207                            status.CurrentOperation = Resources.Connection_lost__Waiting_for_reconnection_to_store_the_results_;
    208208                            keySearcher.GuiLogMessage(status.CurrentOperation, NotificationLevel.Info);
    209209                           
     
    211211                            systemJoinEvent.WaitOne();
    212212                        }
    213                         status.CurrentOperation = "Processing results of calculation";
     213                        status.CurrentOperation = Resources.Processing_results_of_calculation;
    214214                        KeyPoolTree.ProcessCurrentPatternCalculationResult(currentLeaf, result);
    215215                        StatisticsGenerator.ProcessPatternResults(result);
    216216
    217                         status.CurrentOperation = "Calculating global statistics";
     217                        status.CurrentOperation = Resources.Calculating_global_statistics;
    218218                        StatisticsGenerator.CalculateGlobalStatistics(displayablePatternId);
    219219
    220220                        status.LocalFinishedChunks++;
    221221                        keySearcher.GuiLogMessage(
    222                             string.Format("Best match: {0} with {1}", result.First.Value.key, result.First.Value.value),
     222                            string.Format(Resources.Best_match___0__with__1_, result.First.Value.key, result.First.Value.value),
    223223                            NotificationLevel.Info);
    224224
    225                         status.CurrentOperation = "Updating status in DHT";
     225                        status.CurrentOperation = Resources.Updating_status_in_DHT;
    226226                        keyPoolTree.UpdateStatus(currentLeaf);
    227227                    }
    228228                    else
    229229                    {
    230                         keySearcher.GuiLogMessage("Brute force was stopped, not saving results...",
     230                        keySearcher.GuiLogMessage(Resources.Brute_force_was_stopped__not_saving_results___,
    231231                                                  NotificationLevel.Info);
    232232                        status.ProgressOfCurrentChunk = 0;
    233233                        currentLeaf.GiveLeafFree();
    234                         var message = string.Format("Removed reservation of pattern #{0}", displayablePatternId);
     234                        var message = string.Format(Resources.Removed_reservation_of_pattern___0_, displayablePatternId);
    235235                        keySearcher.GuiLogMessage(message, NotificationLevel.Info);
    236236                        status.CurrentOperation = message;
     
    239239                catch (ReservationRemovedException)
    240240                {
    241                     keySearcher.GuiLogMessage("Reservation removed by another node (while calculating). " +
    242                                               "To avoid a state in limbo, proceeding to first available leaf...",
     241                    keySearcher.GuiLogMessage(Resources.Reservation_removed_by_another_node__while_calculating___To_avoid_a_state_in_limbo__proceeding_to_first_available_leaf___,
    243242                                              NotificationLevel.Info);
    244243                    keyPoolTree.Reset();
     
    247246                catch (UpdateFailedException e)
    248247                {
    249                     keySearcher.GuiLogMessage("Could not store results: " + e.Message, NotificationLevel.Info);
     248                    keySearcher.GuiLogMessage(Resources.Could_not_store_results__ + e.Message, NotificationLevel.Info);
    250249                    keyPoolTree.Reset();
    251250                    continue;
     
    253252                catch (KeySearcherStopException)  //Fullstopfunction
    254253                {
    255                     keySearcher.GuiLogMessage("Keysearcher Fullstop.Please Update your Version.", NotificationLevel.Debug);
    256                     status.CurrentOperation = "PLEASE UPDATE";
     254                    keySearcher.GuiLogMessage(Resources.Keysearcher_Fullstop__Please_Update_your_Version_, NotificationLevel.Debug);
     255                    status.CurrentOperation = Resources.PLEASE_UPDATE;
    257256                    keyPoolTree.Reset();
    258257                    keySearcher.Stop();
     
    261260
    262261                // Push statistics to database
    263                 status.CurrentOperation = "Pushing statistics to evaluation database";
     262                status.CurrentOperation = Resources.Pushing_statistics_to_evaluation_database;
    264263                DatabaseStatistics.PushToDatabase(status, StopWatch.ElapsedMilliseconds, keyPoolTree.Identifier, settings, keySearcher);
    265264            }
     
    269268            {
    270269                keySearcher.showProgress(keySearcher.costList, 1, 1, 1);
    271                 keySearcher.GuiLogMessage("Calculation complete.", NotificationLevel.Info);
     270                keySearcher.GuiLogMessage(Resources.Calculation_complete_, NotificationLevel.Info);
    272271                keyPoolTree.UpdateStatusForFinishedCalculation();
    273272            }
     
    308307            catch (KeySearcherStopException)
    309308            {
    310                 status.CurrentOperation = "PLEASE UPDATE";
    311                 keySearcher.GuiLogMessage("Keysearcher Fullstop.Please Update your Version.", NotificationLevel.Error);
     309                status.CurrentOperation = Resources.PLEASE_UPDATE;
     310                keySearcher.GuiLogMessage(Resources.Keysearcher_Fullstop__Please_Update_your_Version_, NotificationLevel.Error);
    312311                keySearcher.Stop();
    313312                throw new KeySearcherStopException();
     
    316315
    317316            keySearcher.GuiLogMessage(
    318                 "Total amount of patterns: " + patternPool.Length + ", each containing " + patternPool.PartSize +
    319                 " keys.", NotificationLevel.Info);
    320             status.CurrentOperation = "Ready for calculation";
     317                string.Format(Resources.Total_amount_of_patterns___0___each_containing__1__keys_, patternPool.Length, patternPool.PartSize), NotificationLevel.Info);
     318            status.CurrentOperation = Resources.Ready_for_calculation;
    321319
    322320            status.StartDate = keyPoolTree.StartDate();
  • trunk/CrypPlugins/KeySearcher/P2P/Helper/ConnectionHelper.cs

    r1707 r2295  
    22using Cryptool.P2P;
    33using Cryptool.PluginBase;
     4using KeySearcher.Properties;
    45
    56namespace KeySearcher.P2P.Helper
     
    3031            else
    3132            {
    32                 keySearcher.GuiLogMessage("P2P network not connected and autoconnect disabled. Cannot compute job.",
     33                keySearcher.GuiLogMessage(Resources.P2P_network_not_connected_and_autoconnect_disabled__Cannot_compute_job_,
    3334                                          NotificationLevel.Error);
    3435            }
     
    4647            if (P2PManager.IsConnected)
    4748            {
    48                 keySearcher.GuiLogMessage("P2P network was connected due to plugin setting.",
     49                keySearcher.GuiLogMessage(Resources.P2P_network_was_connected_due_to_plugin_setting_,
    4950                                          NotificationLevel.Info);
    5051            }
    5152            else
    5253            {
    53                 keySearcher.GuiLogMessage("P2P network could not be connected.",
     54                keySearcher.GuiLogMessage(Resources.P2P_network_could_not_be_connected_,
    5455                                          NotificationLevel.Error);
    5556            }
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/KeyPoolTree.cs

    r2142 r2295  
    88using KeySearcher.P2P.Presentation;
    99using KeySearcher.P2P.Storage;
     10using KeySearcher.Properties;
    1011
    1112namespace KeySearcher.P2P.Tree
     
    200201            if ((!isHigherPatternThanBefore || !patternIdQualifiesForUpdate) && !isLastPattern) return;
    201202            statusUpdater.SendUpdate();
    202             keySearcher.GuiLogMessage("Updating status in DHT", NotificationLevel.Info);
     203            keySearcher.GuiLogMessage(Resources.Updating_status_in_DHT, NotificationLevel.Info);
    203204        }
    204205    }
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/Leaf.cs

    r2217 r2295  
    55using KeySearcher.P2P.Exceptions;
    66using KeySearcher.P2P.Storage;
     7using KeySearcher.Properties;
    78
    89namespace KeySearcher.P2P.Tree
     
    8485        public override string ToString()
    8586        {
    86             return base.ToString() + ", last reservation date " + LastReservationDate;
     87            return base.ToString() + Resources.__last_reservation_date_ + LastReservationDate;
    8788        }
    8889
  • trunk/CrypPlugins/KeySearcher/P2P/Tree/Node.cs

    r2152 r2295  
    44using KeySearcher.P2P.Exceptions;
    55using KeySearcher.P2P.Storage;
     6using KeySearcher.Properties;
    67
    78namespace KeySearcher.P2P.Tree
     
    137138        public override string ToString()
    138139        {
    139             return base.ToString() + ", LeftChildFinished " + LeftChildFinished + ",  RightChildFinished " +
     140            return base.ToString() + Resources.__LeftChildFinished_ + LeftChildFinished + Resources.___RightChildFinished_ +
    140141                   RightChildFinished;
    141142        }
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml

    r2189 r2295  
    2828                        </Grid.RowDefinitions>
    2929                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FFE56B00" Grid.Column="0" Grid.RowSpan="3">
    30                             <Label Content="Local" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
     30                            <Label Content="{Loc Local_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    3131                        </Border>
    32                         <Label Content="Start:" Grid.Column="1" />
     32                        <Label Content="{Loc Start_}" Grid.Column="1" />
    3333                        <Label Name="startTime" Style="{StaticResource ValueRow1}" Grid.Column="1" />
    34                         <Label Content="End:" HorizontalAlignment="Left" Grid.Column="2" />
     34                        <Label Content="{Loc End_}" HorizontalAlignment="Left" Grid.Column="2" />
    3535                        <Label Name="endTime" Style="{StaticResource ValueRow2}" Grid.Column="2" />
    36                         <Label Content="Elapsed:" Grid.Column="1" Grid.Row="1" />
     36                        <Label Content="{Loc Elapsed_}" Grid.Column="1" Grid.Row="1" />
    3737                        <Label Name="elapsedTime" Style="{StaticResource ValueRow1}" Grid.Column="1" Grid.Row="1" />
    38                         <Label Content="Remaining:" Grid.Column="2" Grid.Row="1" />
     38                        <Label Content="{Loc Remaining_}" Grid.Column="2" Grid.Row="1" />
    3939                        <Label Name="timeLeft" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
    40                         <Label Content="Keys / sec:" Grid.Column="2" Grid.Row="2" />
     40                        <Label Content="{Loc Keys_Sec_}" Grid.Column="2" Grid.Row="2" />
    4141                        <Label Name="keysPerSecond" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="2" />
    4242                    </Grid>
     
    5050                        </Grid.ColumnDefinitions>
    5151                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF479308" Grid.Column="0">
    52                             <Label Content="Top Ten" FontSize="11" HorizontalAlignment="Center" Foreground="White" Width="50" />
     52                            <Label Content="{Loc Top_Ten_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" Width="50" />
    5353                        </Border>
    5454                        <ListView Name="ListView" Background="#AFE2FFCE" ItemsSource="{Binding}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" FontSize="10" Grid.Column="1" Height="250">
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/LocalQuickWatchPresentation.xaml.cs

    r2158 r2295  
    77
    88namespace KeySearcherPresentation.Controls
    9 {   
     9{
     10    [Cryptool.PluginBase.Attributes.Localization("KeySearcher.Properties.Resources")]
    1011    public partial class LocalQuickWatchPresentation
    1112    {       
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/OpenCLPresentation.xaml

    r2158 r2295  
    2828                        <Label Content="OpenCL" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    2929                    </Border>
    30                    
    31                     <Label Content="Keys/sec (OpenCL):" Grid.Column="1" Grid.Row="0" />
     30
     31                    <Label Content="{Loc Keys_sec_OpenCL_}" Grid.Column="1" Grid.Row="0" />
    3232                    <Label Name="keysPerSecondOpenCL" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="0" />
    33                     <Label Content="Keys/sec (CPU):" Grid.Column="2" Grid.Row="0" />
     33                    <Label Content="{Loc Keys_sec_CPU_}" Grid.Column="2" Grid.Row="0" />
    3434                    <Label Name="keysPerSecondCPU" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    3535                   
    36                     <Label Content="Devices:" Grid.Column="1" Grid.Row="1" />
     36                    <Label Content="{Loc Devices_}" Grid.Column="1" Grid.Row="1" />
    3737                    <Label Name="devices" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="1" />
    38                    
    39                     <Label Content="Work Items:" Grid.Column="2" Grid.Row="1" />
     38
     39                    <Label Content="{Loc Work_Items_}" Grid.Column="2" Grid.Row="1" />
    4040                    <Label Name="workItems" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
    4141                   
    42                     <Label Content="Ratio:" Grid.Column="1" Grid.Row="2" />
     42                    <Label Content="{Loc Ration_}" Grid.Column="1" Grid.Row="2" />
    4343                    <Label Name="ratio" Style="{StaticResource ValueRow2}" Grid.Column="1" Grid.Row="2" />
    4444                </Grid>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/OpenCLPresentation.xaml.cs

    r2146 r2295  
    55
    66namespace KeySearcherPresentation.Controls
    7 {   
     7{
     8    [Cryptool.PluginBase.Attributes.Localization("KeySearcher.Properties.Resources")]
    89    public partial class OpenCLPresentation
    910    {
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml

    r2189 r2295  
    4444                                                        </TransformGroup>
    4545                                                </Grid.RenderTransform>
    46                                                 <Label x:Name="label" Content="Endgame mode" Height="28" HorizontalAlignment="Center" VerticalAlignment="Center" />
     46                                                <Label x:Name="label" Content="{Loc Endgame_Mode_}" Height="28" HorizontalAlignment="Center" VerticalAlignment="Center" />
    4747                                        </Grid>
    4848                                </Border>
     
    5959                                                </Grid.ColumnDefinitions>
    6060                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Grid.Column="0" Background="#FF5C5CFF">
    61                             <Label Content="Static" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    62                         </Border>
    63                         <Label Content="Total chunks:" VerticalAlignment="Center" Grid.Column="1" />
     61                            <Label Content="{Loc Static_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
     62                        </Border>
     63                        <Label Content="{Loc Total_Chunks_}" VerticalAlignment="Center" Grid.Column="1" />
    6464                        <Label Content="-" Name="TotalAmountOfChunks" Style="{StaticResource ValueRow1}" VerticalAlignment="Center" Grid.Column="1" />
    65                         <Label Content="Keys per chunk:" VerticalAlignment="Center" Grid.Column="2" />
     65                        <Label Content="{Loc Keys_Per_Chunk_}" VerticalAlignment="Center" Grid.Column="2" />
    6666                        <Label Content="-" Name="KeysPerChunk" Style="{StaticResource ValueRow2}" VerticalAlignment="Center" Grid.Column="2" />
    67                         <Label Content="Tested bits:" VerticalAlignment="Center" Grid.Column="3" />
     67                        <Label Content="{Loc Tested_Bits_}" VerticalAlignment="Center" Grid.Column="3" />
    6868                        <Label Content="-" Name="TestedBits" Style="{StaticResource ValueRow3}" VerticalAlignment="Center" Grid.Column="3" />
    6969                                        </Grid>
     
    8484                            <Label Content="Global" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    8585                        </Border>
    86                                                 <Label Content="Participants:" Grid.Column="1" />
     86                        <Label Content="{Loc Participants_}" Grid.Column="1" />
    8787                        <Label Content="{Binding TotalAmountOfParticipants, FallbackValue=-}" Style="{StaticResource ValueRow1}" Grid.Column="1" />
    88                         <Label Content="Start:" Grid.Column="2" />
     88                        <Label Content="{Loc Start_}" Grid.Column="2" />
    8989                        <Label Content="{Binding StartDate, FallbackValue=-, Converter={StaticResource DateTimeConverter}}" Style="{StaticResource ValueRow2}" Grid.Column="2" />
    90                         <Label Content="End:" HorizontalAlignment="Left" Grid.Column="3" />
     90                        <Label Content="{Loc End_}" HorizontalAlignment="Left" Grid.Column="3" />
    9191                        <Label Content="{Binding EstimatedFinishDate, FallbackValue=-}" Style="{StaticResource ValueRow3}" Grid.Column="3" />
    92                         <Label Content="Elapsed:" Grid.Column="2" Grid.Row="2" />
     92                        <Label Content="{Loc Elapsed_}" Grid.Column="2" Grid.Row="2" />
    9393                        <Label Content="{Binding ElapsedTime, FallbackValue=-, Converter={StaticResource TimeSpanToStringConverter}}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="2" />
    94                         <Label Content="Remaining:" Grid.Column="3" Grid.Row="2" />
     94                        <Label Content="{Loc Remaining_}" Grid.Column="3" Grid.Row="2" />
    9595                        <Label Content="{Binding RemainingTimeTotal, FallbackValue=-, Converter={StaticResource TimeSpanToStringConverter}}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="2" />
    9696                    </Grid>
     
    110110                                                </Grid.RowDefinitions>
    111111                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FFE56B00" Grid.Column="0" Grid.RowSpan="3">
    112                             <Label Content="Local" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    113                         </Border>
    114                                                 <Label Content="Finished chunks:" Grid.Column="1" Grid.Row="0" />
     112                            <Label Content="{Loc Local_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
     113                        </Border>
     114                        <Label Content="{Loc Finished_Chunks_}" Grid.Column="1" Grid.Row="0" />
    115115                        <Label Content="{Binding LocalFinishedChunks, FallbackValue=-}" Style="{StaticResource ValueRow1}" Grid.Column="1" Grid.Row="0" />
    116                         <Label Content="Keys / sec:" Grid.Column="2" Grid.Row="0" />
     116                        <Label Content="{Loc Keys_Sec_}" Grid.Column="2" Grid.Row="0" />
    117117                        <Label Name="keysPerSecond" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    118118                        <TextBlock Text="{Binding KeysPerSecond, StringFormat=' {0:0,0}', FallbackValue=-}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    119                         <Label Content="Current chunk:" Grid.Column="3" />
     119                        <Label Content="{Loc Current_Chunk_}" Grid.Column="3" />
    120120                        <Label Content="{Binding CurrentChunk, FallbackValue=-}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="0" />
    121121                        <Grid  Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1">
     
    143143                        </Grid.RowDefinitions>
    144144                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF8309A7" Grid.Column="0" Grid.RowSpan="3">
    145                             <Label Content="Requests" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    146                         </Border>
    147                         <Label Content="Store:" Grid.Column="1" Grid.Row="0" />
     145                            <Label Content="{Loc Requests_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
     146                        </Border>
     147                        <Label Content="{Loc Store_}" Grid.Column="1" Grid.Row="0" />
    148148                        <Label Content="{Binding StoreRequests, FallbackValue=-}" Style="{StaticResource ValueRow1}" Grid.Column="1" Grid.Row="0" />
    149                         <Label Content="Retrieve:" Grid.Column="2" Grid.Row="0" />
     149                        <Label Content="{Loc Retrieve_}" Grid.Column="2" Grid.Row="0" />
    150150                        <Label Content="{Binding RetrieveRequests, FallbackValue=-}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    151                         <Label Content="Remove:" Grid.Column="3" Grid.Row="0" />
     151                        <Label Content="{Loc Remove_}" Grid.Column="3" Grid.Row="0" />
    152152                        <Label Content="{Binding RemoveRequests, FallbackValue=-}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="0" />
    153                         <Label Content="Total:" Grid.Column="2" Grid.Row="1" />
     153                        <Label Content="{Loc Total_}" Grid.Column="2" Grid.Row="1" />
    154154                        <Label Content="{Binding TotalDhtRequests, FallbackValue=-}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
    155                         <Label Content="Per chunk:" Grid.Column="3" Grid.Row="1" />
     155                        <Label Content="{Loc Per_Chunk_}" Grid.Column="3" Grid.Row="1" />
    156156                        <Label Content="{Binding RequestsPerNode, FallbackValue=-}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="1" />
    157                         <Label Content="Overhead (abs):" Grid.Column="2" Grid.Row="2" />
     157                        <Label Content="{Loc Overhead_Abs_}" Grid.Column="2" Grid.Row="2" />
    158158                        <Label Content="{Binding DhtOverheadInReadableTime, FallbackValue=-, Converter={StaticResource TimeSpanToStringConverter}}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="2" />
    159                         <Label Content="Overhead (%):" Grid.Column="3" Grid.Row="2" />
     159                        <Label Content="{Loc Overhead_Perc_}" Grid.Column="3" Grid.Row="2" />
    160160                        <Label Content="{Binding DhtOverheadInPercent, FallbackValue=-}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="2" />
    161161                    </Grid>
     
    174174                                                </Grid.RowDefinitions>
    175175                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF525252" Grid.Column="0" Grid.RowSpan="3">
    176                             <Label Content="Traffic" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
    177                         </Border>
    178                         <Label Content="Sent (payload):" Grid.Column="1" Grid.Row="0" />
     176                            <Label Content="{Loc Traffic_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" />
     177                        </Border>
     178                        <Label Content="{Loc Sent_Payload_}" Grid.Column="1" Grid.Row="0" />
    179179                        <Label Content="{Binding StoredBytes, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow1}" Grid.Column="1" Grid.Row="0" />
    180                         <Label Content="Received (payload):" Grid.Column="2" Grid.Row="0" />
     180                        <Label Content="{Loc Received_Payload_}" Grid.Column="2" Grid.Row="0" />
    181181                        <Label Content="{Binding RetrievedBytes, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="0" />
    182                         <Label Content="Total (payload):" Grid.Column="3" Grid.Row="0" />
     182                        <Label Content="{Loc Total_Payload_}" Grid.Column="3" Grid.Row="0" />
    183183                        <Label Content="{Binding TotalBytes, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="0" />
    184                         <Label Content="Sent (link):" Grid.Column="1" Grid.Row="1" />
     184                        <Label Content="{Loc Sent_Link_}" Grid.Column="1" Grid.Row="1" />
    185185                        <Label Content="{Binding SentBytesByLinkManager, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow1}"  Grid.Column="1" Grid.Row="1" />
    186                         <Label Content="Received (link):" Grid.Column="2" Grid.Row="2" />
     186                        <Label Content="{Loc Received_Link_}" Grid.Column="2" Grid.Row="2" />
    187187                        <Label Content="{Binding ReceivedBytesByLinkManager, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow2}" Grid.Column="2" Grid.Row="1" />
    188                         <Label Content="Total (link):" Grid.Column="3" Grid.Row="2" />
     188                        <Label Content="{Loc Total_Link_}" Grid.Column="3" Grid.Row="2" />
    189189                        <Label Content="{Binding TotalBytesByLinkManager, FallbackValue=-, Converter={StaticResource LongToSizeMetricString}}" Style="{StaticResource ValueRow3}" Grid.Column="3" Grid.Row="1" />
    190190                    </Grid>
     
    197197                        </Grid.ColumnDefinitions>
    198198                        <Border BorderThickness="1" BorderBrush="Black" LayoutTransform="{StaticResource HeaderRotate}" Background="#FF479308" Grid.Column="0">
    199                             <Label Content="Top Ten" FontSize="11" HorizontalAlignment="Center" Foreground="White" Width="50" />
     199                            <Label Content="{Loc Top_Ten_}" FontSize="11" HorizontalAlignment="Center" Foreground="White" Width="50" />
    200200                        </Border>
    201201                        <ListView Name="ToplistView" Background="#AFE2FFCE" ItemsSource="{Binding TopList}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto"  Height="120" Grid.Column="1">
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/P2PQuickWatchPresentation.xaml.cs

    r2189 r2295  
    99namespace KeySearcherPresentation.Controls
    1010{
     11    [Cryptool.PluginBase.Attributes.Localization("KeySearcher.Properties.Resources")]
    1112    public partial class P2PQuickWatchPresentation : UserControl
    1213    {
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml

    r2293 r2295  
    2121   
    2222    <TabControl>
    23         <TabItem Header="Users">
     23        <TabItem Header="{Loc _Users_}">
    2424            <TreeView HorizontalAlignment="Stretch" Name="statisticsTree" VerticalAlignment="Stretch" ItemsSource="{Binding}" AlternationCount="3">
    2525                <TreeView.ItemTemplate>
     
    4545                                <ProgressBar x:Name="Bar" Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TreeViewItem}},Path=(ItemsControl.AlternationIndex),Converter={StaticResource ResourceKey=TeamsBackgroundConverter}}" Value="{Binding Path=Value, Mode=OneTime, Converter={StaticResource ResourceKey=InformationToProgressConverter}}" Width="{Binding ElementName=statisticsTree, Path=ActualWidth, Converter={StaticResource ResourceKey=WidthConverter}}" Maximum="1" />
    4646                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
    47                                     <TextBlock Text="Chunks: "/>
     47                                    <TextBlock Text="{Loc Chunks_}"/>
    4848                                    <TextBlock Text="{Binding Path=Key, Converter={StaticResource ResourceKey=ChunkSumConverter}, StringFormat=\{0\,-5\}}"/>
    4949                                </StackPanel>
     
    5656        </TabItem>
    5757       
    58         <TabItem Header="Machines">
     58        <TabItem Header="{Loc _Machines_}">
    5959            <TreeView HorizontalAlignment="Stretch" Name="machineTree" VerticalAlignment="Stretch" ItemsSource="{Binding}" AlternationCount="3">
    6060                <TreeView.ItemTemplate>
     
    7070                                <ProgressBar Value="{Binding Path=Value.Sum, Mode=OneTime, Converter={StaticResource ResourceKey=MachineSumToProgressConverter}}" Width="{Binding ElementName=machineTree, Path=ActualWidth, Converter={StaticResource ResourceKey=WidthConverter}}" Maximum="1" />
    7171                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
    72                                     <TextBlock Text="Chunks: "/>
     72                                    <TextBlock Text="{Loc Chunks_}"/>
    7373                                    <TextBlock Text="{Binding Path=Value.Sum,StringFormat=\{0\,-5\}}"/>
    7474                                </StackPanel>
  • trunk/CrypPlugins/KeySearcher/Presentation/Controls/StatisticsPresentation.xaml.cs

    r2293 r2295  
    2020namespace KeySearcherPresentation.Controls
    2121{
     22    /// <summary>
     23    /// Interaction logic for StatisticsPresentation.xaml
     24    /// </summary>
     25    [Cryptool.PluginBase.Attributes.Localization("KeySearcher.Properties.Resources")]
     26    public partial class StatisticsPresentation : UserControl
     27    {
     28        public StatisticsPresentation()
     29        {
     30            InitializeComponent();
     31            ((InformationToProgressConverter)Resources["InformationToProgressConverter"]).StatisticsPresentation = this;
     32            ((InformationToProgressConverter2)Resources["InformationToProgressConverter2"]).StatisticsPresentation = this;
     33            ((ChunkSumConverter)Resources["ChunkSumConverter"]).StatisticsPresentation = this;
     34            ((MachineSumToProgressConverter)Resources["MachineSumToProgressConverter"]).StatisticsPresentation = this;
     35        }
    2236
     37        private Dictionary<string, Dictionary<long, Information>> statistics = null;
     38        public Dictionary<string, Dictionary<long, Information>> Statistics
     39        {
     40            get { return statistics; }
     41            set
     42            {
     43                statistics = value;
     44                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     45                                               {
     46                                                   var orderedstats = statistics.OrderByDescending((x) => x.Value.Sum((z) => z.Value.Count));
     47                                                   statisticsTree.DataContext = orderedstats;
     48                                                   statisticsTree.Items.Refresh();
     49                                                }, null);
     50
     51            }
     52        }
     53
     54        private Dictionary<long, Maschinfo> machineHierarchy = null;
     55        public Dictionary<long, Maschinfo> MachineHierarchy
     56        {
     57            get { return machineHierarchy; }
     58            set
     59            {
     60                machineHierarchy = value;
     61                Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
     62                                                {
     63                                                    var orderedstats = machineHierarchy.OrderByDescending((x) => x.Value.Sum);
     64                                                    machineTree.DataContext = orderedstats;
     65                                                    machineTree.Items.Refresh();
     66                                                }, null);
     67            }
     68        }
     69    }
     70
     71    #region Converters
    2372    [ValueConversion(typeof(Dictionary<long, Information>), typeof(Double))]
    2473    class InformationToProgressConverter : IValueConverter
     
    80129            if (StatisticsPresentation != null)
    81130            {
    82                 string key = (string) value;
     131                string key = (string)value;
    83132                var data = (StatisticsPresentation.Statistics)[key];
    84133                return data.Sum(i => i.Value.Count);
     
    119168        }
    120169    }
     170    #endregion
    121171
    122     /// <summary>
    123     /// Interaction logic for StatisticsPresentation.xaml
    124     /// </summary>
    125     public partial class StatisticsPresentation : UserControl
    126     {
    127         public StatisticsPresentation()
    128         {
    129             InitializeComponent();
    130             ((InformationToProgressConverter)Resources["InformationToProgressConverter"]).StatisticsPresentation = this;
    131             ((InformationToProgressConverter2)Resources["InformationToProgressConverter2"]).StatisticsPresentation = this;
    132             ((ChunkSumConverter)Resources["ChunkSumConverter"]).StatisticsPresentation = this;
    133             ((MachineSumToProgressConverter)Resources["MachineSumToProgressConverter"]).StatisticsPresentation = this;
    134         }
    135 
    136         private Dictionary<string, Dictionary<long, Information>> statistics = null;
    137         public Dictionary<string, Dictionary<long, Information>> Statistics
    138         {
    139             get { return statistics; }
    140             set
    141             {
    142                 statistics = value;
    143                 Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    144                                                {
    145                                                    var orderedstats = statistics.OrderByDescending((x) => x.Value.Sum((z) => z.Value.Count));
    146                                                    statisticsTree.DataContext = orderedstats;
    147                                                    statisticsTree.Items.Refresh();
    148                                                 }, null);
    149 
    150             }
    151         }
    152 
    153         private Dictionary<long, Maschinfo> machineHierarchy = null;
    154         public Dictionary<long, Maschinfo> MachineHierarchy
    155         {
    156             get { return machineHierarchy; }
    157             set
    158             {
    159                 machineHierarchy = value;
    160                 Dispatcher.Invoke(DispatcherPriority.Normal, (SendOrPostCallback)delegate
    161                                                 {
    162                                                     var orderedstats = machineHierarchy.OrderByDescending((x) => x.Value.Sum);
    163                                                     machineTree.DataContext = orderedstats;
    164                                                     machineTree.Items.Refresh();
    165                                                 }, null);
    166             }
    167         }
    168     }
    169172}
  • trunk/CrypPlugins/Wizard/WizardSettingsTab.xaml.cs

    r2237 r2295  
    1919    /// Interaction logic for WizardSettingsTab.xaml
    2020    /// </summary>
    21     [SettingsTab("Wizard.Resources.settingsRes", "WizardSettings", "/MainSettings/")]
     21    [Localization("Wizard.Resources.settingsRes")]
     22    [SettingsTab("WizardSettings", "/MainSettings/")]
    2223    public partial class WizardSettingsTab : UserControl
    2324    {
Note: See TracChangeset for help on using the changeset viewer.