public void Function(StringValue type) { var stec = new StringToEnumConverter(typeof(DisplayStyle)); var value = stec.Convert(type); Context.DefaultDisplayStyle = (DisplayStyle)value; Context.RaiseNotification(new NotificationEventArgs(NotificationType.Information, "Display format changed to " + value + ".")); }
public ScalarValue Function(StringValue p) { var conv = new StringToEnumConverter(typeof(VideoProperty)); var property = (VideoProperty)conv.Convert(p); var deviceReader = default(VideoDeviceReader); if (NamedProperties.TryGetValue(property, out deviceReader)) { return deviceReader.GetValue(_sensor); } return new ScalarValue(); }
public ScalarValue Function(StringValue p) { var conv = new StringToEnumConverter(typeof(AudioProperty)); var property = (AudioProperty)conv.Convert(p); var callback = default(Func<Microphone, ScalarValue>); if (NamedProperties.TryGetValue(property, out callback)) { return callback(_sensor); } return new ScalarValue(); }