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

Prepared KeySearcher for Localization

Location:
trunk/CrypPlugins/KeySearcher/Presentation/Controls
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.