Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The command manager.</param>
 /// <param name="commandType">Type of the command.</param>
 protected MediaCommand(MediaCommandManager manager, MediaCommandType commandType)
 {
     Manager       = manager;
     CommandType   = commandType;
     TaskCompleter = new TaskCompletionSource <bool>();
     Promise       = TaskCompleter.Task;
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaCommand" /> class.
        /// </summary>
        /// <param name="manager">The command manager.</param>
        /// <param name="commandType">Type of the command.</param>
        protected MediaCommand(MediaCommandManager manager, MediaCommandType commandType)
        {
            Manager     = manager;
            CommandType = commandType;

            CancellableTask = new Task <Task>(ExecuteInternal, CancelTokenSource.Token);
            TaskContext     = CancellableTask.Unwrap();
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SpeedRatioCommand"/> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="speedRatio">The speed ratio.</param>
 public SpeedRatioCommand(MediaCommandManager manager, double speedRatio)
     : base(manager, MediaCommandType.SetSpeedRatio)
 {
     SpeedRatio = speedRatio;
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PlayCommand" /> class.
 /// </summary>
 /// <param name="manager">The media element.</param>
 public PlayCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.Play)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OpenCommand" /> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="source">The source.</param>
 public OpenCommand(MediaCommandManager manager, Uri source)
     : base(manager, MediaCommandType.Open)
 {
     Source = source;
 }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SeekCommand" /> class.
 /// </summary>
 /// <param name="manager">The media element.</param>
 /// <param name="targetPosition">The target position.</param>
 public SeekCommand(MediaCommandManager manager, TimeSpan targetPosition)
     : base(manager, MediaCommandType.Seek)
 {
     TargetPosition = targetPosition;
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The command manager.</param>
 /// <param name="commandType">Type of the command.</param>
 protected MediaCommand(MediaCommandManager manager, MediaCommandType commandType)
 {
     Manager     = manager;
     CommandType = commandType;
     TaskContext = new Task(ExecuteInternal, CancelTokenSource.Token);
 }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StopCommand" /> class.
 /// </summary>
 /// <param name="manager">The media element.</param>
 public StopCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.Stop)
 {
     // placeholder
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CloseCommand" /> class.
 /// </summary>
 /// <param name="manager">The media element.</param>
 public CloseCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.Close)
 {
     // placeholder
 }
Esempio n. 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The command manager.</param>
 /// <param name="commandType">Type of the command.</param>
 protected MediaCommand(MediaCommandManager manager, MediaCommandType commandType)
 {
     Manager     = manager;
     CommandType = commandType;
     Promise     = new Task(Execute);
 }
Esempio n. 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PauseCommand" /> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 public PauseCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.Pause)
 {
 }
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OpenCommand"/> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 /// <param name="inputStream">The custom implementation of an input stream.</param>
 public OpenCommand(MediaCommandManager manager, IMediaInputStream inputStream)
     : base(manager, MediaCommandType.Open)
 {
     InputStream = inputStream;
     Source      = inputStream.StreamUri;
 }
Esempio n. 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChangeMediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 public ChangeMediaCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.ChangeMedia)
 {
     // TODO: Capture the current position
 }
Esempio n. 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ChangeMediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The manager.</param>
 public ChangeMediaCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.ChangeMedia)
 {
     // placheholder
 }
Esempio n. 15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StopCommand" /> class.
 /// </summary>
 /// <param name="manager">The media element.</param>
 public StopCommand(MediaCommandManager manager)
     : base(manager, MediaCommandType.Stop)
 {
 }
Esempio n. 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MediaCommand" /> class.
 /// </summary>
 /// <param name="manager">The command manager.</param>
 /// <param name="commandType">Type of the command.</param>
 protected MediaCommand(MediaCommandManager manager, MediaCommandType commandType)
 {
     Manager     = manager;
     CommandType = commandType;
 }