Event manager improvements. Changed to console.writeline instead of diagnostics
This commit is contained in:
@ -45,6 +45,8 @@ namespace Aurora.Design.Views.Party
|
||||
|
||||
PlayCommand = new Command(OnDoubleClickExecute, CanDoubleClickExecute);
|
||||
|
||||
LeavePartyCommand = new Command(OnLeavePartyExecute, CanLeaveParty);
|
||||
|
||||
_client = ClientService.Instance;
|
||||
|
||||
_client.OnMediaPaused += this.OnMediaPaused;
|
||||
@ -52,6 +54,7 @@ namespace Aurora.Design.Views.Party
|
||||
_client.OnNewMediaPlaying += this.OnNewMediaPlaying;
|
||||
_client.OnPartyMemberJoined += this.OnPartyMemberJoined;
|
||||
_client.OnPartyMemberLeft += this.OnPartyMemberLeft;
|
||||
|
||||
}
|
||||
|
||||
~PartyViewModel()
|
||||
@ -118,6 +121,8 @@ namespace Aurora.Design.Views.Party
|
||||
/// <value></value>
|
||||
public Command PlayCommand { get; private set; }
|
||||
|
||||
public Command LeavePartyCommand { get; private set; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Events
|
||||
@ -251,7 +256,7 @@ namespace Aurora.Design.Views.Party
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Exception occurred while receiviing events: ", ex.Message);
|
||||
Console.WriteLine("Exception occurred while receiviing events: ", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,7 +284,7 @@ namespace Aurora.Design.Views.Party
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Exception occurred while receiviing events: ", ex.Message);
|
||||
Console.WriteLine("Exception occurred while receiviing events: ", ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -288,6 +293,16 @@ namespace Aurora.Design.Views.Party
|
||||
return true;
|
||||
}
|
||||
|
||||
private async void OnLeavePartyExecute()
|
||||
{
|
||||
await _client.RemotePartyClient.LeavePartyAsync(new LeavePartyRequest());
|
||||
}
|
||||
|
||||
private bool CanLeaveParty()
|
||||
{
|
||||
return (this._state == PartyState.InParty || this._state == PartyState.Hosting) ? true : false;
|
||||
}
|
||||
|
||||
public override void OnPlayButtonExecute()
|
||||
{
|
||||
if (base.IsPlaying())
|
||||
@ -408,7 +423,7 @@ namespace Aurora.Design.Views.Party
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("Error subscribing to events: " + ex.Message);
|
||||
Console.WriteLine("Error subscribing to events: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -438,7 +453,7 @@ namespace Aurora.Design.Views.Party
|
||||
}
|
||||
|
||||
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("CLIENT {0} - SubscribeToEvents called from client with id", SettingsService.Instance.ClientId));
|
||||
Console.WriteLine(string.Format("CLIENT {0} - SubscribeToEvents called from client with id", SettingsService.Instance.ClientId));
|
||||
await _client.RemoteEventClient.SubscribeToEventsAsync(req);
|
||||
}
|
||||
private async Task UnsubscribeFromEvents()
|
||||
|
Reference in New Issue
Block a user