Exemplo n.º 1
0
        internal static Rotation ToPublic(this MediaControlNativeDisplayRotation mode)
        {
            Debug.Assert(Enum.IsDefined(typeof(MediaControlNativeDisplayRotation), mode));
            Rotation nativeMode = Rotation.Rotate0;

            switch (mode)
            {
            case MediaControlNativeDisplayRotation.Rotate0:
                nativeMode = Rotation.Rotate0;
                break;

            case MediaControlNativeDisplayRotation.Rotate90:
                nativeMode = Rotation.Rotate90;
                break;

            case MediaControlNativeDisplayRotation.Rotate180:
                nativeMode = Rotation.Rotate180;
                break;

            case MediaControlNativeDisplayRotation.Rotate270:
                nativeMode = Rotation.Rotate270;
                break;
            }
            return(nativeMode);
        }
Exemplo n.º 2
0
        internal static IList <Rotation> ToPublicList(this MediaControlNativeDisplayRotation modes)
        {
            var supportedRotations = new List <Rotation>();

            foreach (MediaControlNativeDisplayRotation mode in Enum.GetValues(typeof(MediaControlNativeDisplayRotation)))
            {
                if (modes.HasFlag(mode))
                {
                    supportedRotations.Add(mode.ToPublic());
                }
            }

            return(supportedRotations.AsReadOnly());
        }
Exemplo n.º 3
0
 internal void RaiseDisplayRotationCapabilityUpdatedEvent(MediaControlNativeDisplayRotation rotations)
 {
     DisplayRotationCapabilityUpdated?.Invoke(this, new DisplayRotationCapabilityUpdatedEventArgs(rotations.ToPublicList()));
 }
Exemplo n.º 4
0
 internal void RaiseDisplayRotationUpdatedEvent(MediaControlNativeDisplayRotation rotation)
 {
     DisplayRotationUpdated?.Invoke(this, new DisplayRotationUpdatedEventArgs(rotation.ToPublic()));
 }
 internal static extern MediaControllerError UpdateDisplayRotaton(IntPtr handle, MediaControlNativeDisplayRotation rotation);
 internal static extern MediaControllerError SendDisplayRotationCommand(MediaControllerClientHandle handle,
                                                                        string serverName, MediaControlNativeDisplayRotation mode, out string requestId);
 internal static extern MediaControllerError GetDisplayRotation(MediaControllerClientHandle clientHandle,
                                                                string serverName, out MediaControlNativeDisplayRotation mode);