source: trunk/CrypPlugins/P2PEditor/Converters/StatusToColorConverter.cs @ 1727

Last change on this file since 1727 was 1727, checked in by Paul Lelgemann, 11 years ago

+ P2PEditor can display the status of jobs, if available; Participating displays overlay while loading workspace data
+ KeySearcher can upload status for P2PEditor display

File size: 1.1 KB
Line 
1using System;
2using System.Globalization;
3using System.Windows.Data;
4using System.Windows.Media;
5using Cryptool.P2PEditor.Distributed;
6
7namespace Cryptool.P2PEditor.Converters
8{
9    public class StatusToColorConverter : IValueConverter
10    {
11        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
12        {
13            if (value == null)
14            {
15                return Brushes.DarkGray;
16            }
17           
18            var status = (DistributedJobStatus.Status)value;
19            switch (status)
20            {
21                case DistributedJobStatus.Status.New:
22                    return Brushes.DeepSkyBlue;
23                case DistributedJobStatus.Status.Active:
24                    return Brushes.DarkOrange;
25                case DistributedJobStatus.Status.Finished:
26                    return Brushes.GreenYellow;
27            }
28
29            return Brushes.DarkGray;
30        }
31
32        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
33        {
34            throw new NotImplementedException();
35        }
36    }
37}
Note: See TracBrowser for help on using the repository browser.