Cosmetic refactoring
This commit is contained in:
		| @@ -20,8 +20,8 @@ namespace Aurora.Design.Views | |||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// Command event handler for player play button |         /// Command event handler for player play button | ||||||
|         /// </summary> |         /// </summary> | ||||||
|         public virtual void OnPlayButtonExecute() { } |         public virtual void OnPlayButtonCommandExecute() { } | ||||||
|         public virtual bool CanPlayButtonExecute() |         public virtual bool CanPlayButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
| @@ -30,7 +30,7 @@ namespace Aurora.Design.Views | |||||||
|         /// Command event handler for player next button |         /// Command event handler for player next button | ||||||
|         /// </summary> |         /// </summary> | ||||||
|         public virtual void OnNextButtonExecute() { } |         public virtual void OnNextButtonExecute() { } | ||||||
|         public virtual bool CanNextButtonExecute() |         public virtual bool CanNextButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
| @@ -39,7 +39,7 @@ namespace Aurora.Design.Views | |||||||
|         /// Command event handler for player previous button |         /// Command event handler for player previous button | ||||||
|         /// </summary> |         /// </summary> | ||||||
|         public virtual void OnPreviousButtonExecute() { } |         public virtual void OnPreviousButtonExecute() { } | ||||||
|         public virtual bool CanPreviousButtonExecute() |         public virtual bool CanPreviousButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -166,9 +166,9 @@ namespace Aurora.Design.Views.Main | |||||||
|         /// <param name="vm">BaseViewModel to assign controls to</param> |         /// <param name="vm">BaseViewModel to assign controls to</param> | ||||||
|         private void AssignPlayerControls(BaseViewModel vm) |         private void AssignPlayerControls(BaseViewModel vm) | ||||||
|         { |         { | ||||||
|             _playerComponent.PlayButtonCommand = new Command(vm.OnPlayButtonExecute, vm.CanPlayButtonExecute); |             _playerComponent.PlayButtonCommand = new Command(vm.OnPlayButtonCommandExecute, vm.CanPlayButtonCommandExecute); | ||||||
|             _playerComponent.NextButtonCommand = new Command(vm.OnNextButtonExecute, vm.CanNextButtonExecute); |             _playerComponent.NextButtonCommand = new Command(vm.OnNextButtonExecute, vm.CanNextButtonCommandExecute); | ||||||
|             _playerComponent.PreviousButtonCommand = new Command(vm.OnPreviousButtonExecute, vm.CanPreviousButtonExecute); |             _playerComponent.PreviousButtonCommand = new Command(vm.OnPreviousButtonExecute, vm.CanPreviousButtonCommandExecute); | ||||||
|  |  | ||||||
|             vm.ChangePlayerState = ChangePlayerState; |             vm.ChangePlayerState = ChangePlayerState; | ||||||
|             vm.IsPlaying = () => |             vm.IsPlaying = () => | ||||||
|   | |||||||
| @@ -43,15 +43,15 @@ namespace Aurora.Design.Views.Party | |||||||
|  |  | ||||||
|             SetState(PartyState.SelectingHost); |             SetState(PartyState.SelectingHost); | ||||||
|  |  | ||||||
|             PlayCommand = new Command(OnDoubleClickExecute, CanDoubleClickExecute); |             PlayCommand = new Command(OnDoubleClickCommandExecute, CanDoubleClickCommandExecute); | ||||||
|  |  | ||||||
|             LeavePartyCommand = new Command(OnLeavePartyExecute, CanLeaveParty); |             LeavePartyCommand = new Command(OnLeavePartyCommandExecute, CanLeavePartyCommandExecute); | ||||||
|  |  | ||||||
|             _client = ClientService.Instance; |             _client = ClientService.Instance; | ||||||
|  |  | ||||||
|             _client.OnMediaPaused += this.OnMediaPaused; |             _client.OnMediaPaused += this.OnRemoteMediaPaused; | ||||||
|             _client.OnMediaResumed += this.OnMediaResumed; |             _client.OnMediaResumed += this.OnRemoteMediaResumed; | ||||||
|             _client.OnNewMediaPlaying += this.OnNewMediaPlaying; |             _client.OnNewMediaPlaying += this.OnNewRemoteMediaPlaying; | ||||||
|             _client.OnPartyMemberJoined += this.OnPartyMemberJoined; |             _client.OnPartyMemberJoined += this.OnPartyMemberJoined; | ||||||
|             _client.OnPartyMemberLeft += this.OnPartyMemberLeft; |             _client.OnPartyMemberLeft += this.OnPartyMemberLeft; | ||||||
|  |  | ||||||
| @@ -152,12 +152,12 @@ namespace Aurora.Design.Views.Party | |||||||
|                     { |                     { | ||||||
|                         case ConnectionType.Host: |                         case ConnectionType.Host: | ||||||
|                             { |                             { | ||||||
|                                 OnHostExecute(); |                                 OnHostCommandExecute(); | ||||||
|                                 break; |                                 break; | ||||||
|                             } |                             } | ||||||
|                         case ConnectionType.Join: |                         case ConnectionType.Join: | ||||||
|                             { |                             { | ||||||
|                                 OnJoinExecute(); |                                 OnJoinCommandExecute(); | ||||||
|                                 break; |                                 break; | ||||||
|                             } |                             } | ||||||
|                     } |                     } | ||||||
| @@ -182,7 +182,7 @@ namespace Aurora.Design.Views.Party | |||||||
|         /// </summary> |         /// </summary> | ||||||
|         /// <param name="sender"></param> |         /// <param name="sender"></param> | ||||||
|         /// <param name="args"></param> |         /// <param name="args"></param> | ||||||
|         public void OnMediaPaused(object sender, MediaPausedEventArgs args) |         public void OnRemoteMediaPaused(object sender, MediaPausedEventArgs args) | ||||||
|         { |         { | ||||||
|             StopPlaying(); |             StopPlaying(); | ||||||
|         } |         } | ||||||
| @@ -192,7 +192,7 @@ namespace Aurora.Design.Views.Party | |||||||
|         /// </summary> |         /// </summary> | ||||||
|         /// <param name="sender"></param> |         /// <param name="sender"></param> | ||||||
|         /// <param name="args"></param> |         /// <param name="args"></param> | ||||||
|         public void OnNewMediaPlaying(object sender, NewMediaPlayingEventArgs args) |         public void OnNewRemoteMediaPlaying(object sender, NewMediaPlayingEventArgs args) | ||||||
|         { |         { | ||||||
|             PlayFromBeginning(GetMediaFromQueue(args.Event.Media.Id)); |             PlayFromBeginning(GetMediaFromQueue(args.Event.Media.Id)); | ||||||
|         } |         } | ||||||
| @@ -202,7 +202,7 @@ namespace Aurora.Design.Views.Party | |||||||
|         /// </summary> |         /// </summary> | ||||||
|         /// <param name="sender"></param> |         /// <param name="sender"></param> | ||||||
|         /// <param name="args"></param> |         /// <param name="args"></param> | ||||||
|         public void OnMediaResumed(object sender, MediaResumedEventArgs args) |         public void OnRemoteMediaResumed(object sender, MediaResumedEventArgs args) | ||||||
|         { |         { | ||||||
|             PlayResume(); |             PlayResume(); | ||||||
|         } |         } | ||||||
| @@ -242,7 +242,7 @@ namespace Aurora.Design.Views.Party | |||||||
|         #endregion Events |         #endregion Events | ||||||
|  |  | ||||||
|         #region Commands |         #region Commands | ||||||
|         private async void OnJoinExecute() |         private async void OnJoinCommandExecute() | ||||||
|         { |         { | ||||||
|             SetState(PartyState.Connecting); |             SetState(PartyState.Connecting); | ||||||
|             _client.Start(_hostname, SettingsService.Instance.DefaultPort.ToString()); |             _client.Start(_hostname, SettingsService.Instance.DefaultPort.ToString()); | ||||||
| @@ -260,12 +260,12 @@ namespace Aurora.Design.Views.Party | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private bool CanJoinExecute() |         private bool CanJoinCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private async void OnHostExecute() |         private async void OnHostCommandExecute() | ||||||
|         { |         { | ||||||
|             //Change state |             //Change state | ||||||
|             SetState(PartyState.Connecting); |             SetState(PartyState.Connecting); | ||||||
| @@ -288,22 +288,22 @@ namespace Aurora.Design.Views.Party | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private bool CanHostExecute() |         private bool CanHostCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private async void OnLeavePartyExecute() |         private async void OnLeavePartyCommandExecute() | ||||||
|         { |         { | ||||||
|             await _client.RemotePartyClient.LeavePartyAsync(new LeavePartyRequest()); |             await _client.RemotePartyClient.LeavePartyAsync(new LeavePartyRequest()); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private bool CanLeaveParty() |         private bool CanLeavePartyCommandExecute() | ||||||
|         { |         { | ||||||
|             return (this._state == PartyState.InParty || this._state == PartyState.Hosting) ? true : false; |             return (this._state == PartyState.InParty || this._state == PartyState.Hosting) ? true : false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override void OnPlayButtonExecute() |         public override void OnPlayButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             if (base.IsPlaying()) |             if (base.IsPlaying()) | ||||||
|             { |             { | ||||||
| @@ -329,17 +329,17 @@ namespace Aurora.Design.Views.Party | |||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override bool CanPlayButtonExecute() |         public override bool CanPlayButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return this._state == PartyState.Hosting; |             return this._state == PartyState.Hosting; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override bool CanNextButtonExecute() |         public override bool CanNextButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return this._state == PartyState.Hosting; |             return this._state == PartyState.Hosting; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override bool CanPreviousButtonExecute() |         public override bool CanPreviousButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return this._state == PartyState.Hosting; |             return this._state == PartyState.Hosting; | ||||||
|         } |         } | ||||||
| @@ -347,7 +347,7 @@ namespace Aurora.Design.Views.Party | |||||||
|         /// <summary> |         /// <summary> | ||||||
|         /// On double click execute, fire media playing event |         /// On double click execute, fire media playing event | ||||||
|         /// </summary> |         /// </summary> | ||||||
|         public void OnDoubleClickExecute() |         public void OnDoubleClickCommandExecute() | ||||||
|         { |         { | ||||||
|             //Fire Playing event |             //Fire Playing event | ||||||
|             AudioMetadata meta = _selectedMedia.Metadata as AudioMetadata; |             AudioMetadata meta = _selectedMedia.Metadata as AudioMetadata; | ||||||
| @@ -368,7 +368,7 @@ namespace Aurora.Design.Views.Party | |||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public bool CanDoubleClickExecute() |         public bool CanDoubleClickCommandExecute() | ||||||
|         { |         { | ||||||
|             return this._state == PartyState.Hosting; |             return this._state == PartyState.Hosting; | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -51,7 +51,7 @@ namespace Aurora.Design.Views.Songs | |||||||
|         #endregion Methods |         #endregion Methods | ||||||
|  |  | ||||||
|         #region Commmands |         #region Commmands | ||||||
|         public override bool CanPreviousButtonExecute() |         public override bool CanPreviousButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
| @@ -60,12 +60,12 @@ namespace Aurora.Design.Views.Songs | |||||||
|  |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override bool CanPlayButtonExecute() |         public override bool CanPlayButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override void OnPlayButtonExecute() |         public override void OnPlayButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             if (_selectedSong == null) |             if (_selectedSong == null) | ||||||
|             { |             { | ||||||
| @@ -82,7 +82,7 @@ namespace Aurora.Design.Views.Songs | |||||||
|  |  | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         public override bool CanNextButtonExecute() |         public override bool CanNextButtonCommandExecute() | ||||||
|         { |         { | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user