//- @Convert -//
        public Object Convert(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)
        {
            DevServer.Instance.InstanceState state = (DevServer.Instance.InstanceState)value;
            switch (state)
            {
            case DevServer.Instance.InstanceState.Started:
                return("Stop");

            case DevServer.Instance.InstanceState.Stopped:
                return("Start");

            default:
                throw new ArgumentOutOfRangeException("Unknown InstanceState value");
            }
        }
Ejemplo n.º 2
0
        //- @Convert -//
        public Object Convert(Object value, Type targetType, Object parameter, System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(System.Windows.Media.ImageSource))
            {
                throw new InvalidOperationException("Target type must be of type ImageSource");
            }
            DevServer.Instance.InstanceState state = (DevServer.Instance.InstanceState)value;
            switch (state)
            {
            case DevServer.Instance.InstanceState.Started:
                return("Image/bullet_green.png");

            case DevServer.Instance.InstanceState.Stopped:
                return("Image/bullet_red.png");

            default:
                throw new ArgumentOutOfRangeException("Unknown InstateState value");
            }
        }