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