Event manager improvements. Changed to console.writeline instead of diagnostics
This commit is contained in:
@ -2,7 +2,6 @@
|
||||
<ContentView
|
||||
xmlns="http://xamarin.com/schemas/2014/forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:hl="clr-namespace:Aurora.Design.Components.HorizontalList"
|
||||
xmlns:flv="clr-namespace:DLToolkit.Forms.Controls;assembly=DLToolkit.Forms.Controls.FlowListView"
|
||||
x:Class="Aurora.Design.Components.MemberList.MemberList">
|
||||
<ContentView.Resources>
|
||||
@ -14,7 +13,6 @@
|
||||
x:Name="MembersList"
|
||||
FlowColumnMinWidth="150"
|
||||
RowHeight="150"
|
||||
VerticalOptions="FillAndExpand"
|
||||
SeparatorVisibility="None"
|
||||
BackgroundColor="#181818"
|
||||
HasUnevenRows="false">
|
||||
|
@ -25,7 +25,7 @@ namespace Aurora.Design.Extensions
|
||||
|
||||
foreach (var res in gtkAsm.GetManifestResourceNames())
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("found resource: " + res);
|
||||
Console.WriteLine("found resource: " + res);
|
||||
}
|
||||
|
||||
if (gtkAsm == null && gtkAsm is Assembly)
|
||||
|
@ -146,7 +146,6 @@ namespace Aurora.Design.Views.Main
|
||||
vm.OnActive();
|
||||
|
||||
_viewContent.Content = view;
|
||||
MasterPage.ListView.SelectedItem = firstNavItem;
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,4 +5,33 @@ Label {
|
||||
#MembersList {
|
||||
height: 100;
|
||||
background-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
#LeaveButton {
|
||||
margin-top: 20;
|
||||
margin-bottom: 20;
|
||||
vertical-align: bottom;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
#MembersList {
|
||||
background-color: #1e1e1e;
|
||||
}
|
||||
|
||||
#MembersList Grid {
|
||||
margin-left: 20;
|
||||
margin-right: 20;
|
||||
margin-top: 20;
|
||||
margin-bottom: 20;
|
||||
width: 150;
|
||||
border-radius: 25;
|
||||
background-color: #626363;
|
||||
}
|
||||
|
||||
#MembersList Label {
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
color: white;
|
||||
font-size: 20;
|
||||
}
|
||||
|
||||
|
@ -22,13 +22,31 @@
|
||||
HeaderBackgroundColor="#181818"
|
||||
x:Name="TabView">
|
||||
<tabView:TabViewControl.ItemSource>
|
||||
<!-- Members Tab -->
|
||||
<tabView:TabItem
|
||||
HeaderText="Members">
|
||||
<ml:MemberList
|
||||
x:Name="MembersList"
|
||||
VerticalOptions="FillAndExpand"
|
||||
Members="{Binding Members}"/>
|
||||
<Grid
|
||||
HorizontalOptions="FillAndExpand"
|
||||
VerticalOptions="FillAndExpand">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition
|
||||
Height="*"/>
|
||||
<RowDefinition
|
||||
Height="30"/>
|
||||
</Grid.RowDefinitions>
|
||||
<ml:MemberList
|
||||
x:Name="MembersList"
|
||||
Grid.Row="0"
|
||||
VerticalOptions="FillAndExpand"
|
||||
Members="{Binding Members}"/>
|
||||
<!-- Leave Party Button -->
|
||||
<Button
|
||||
Grid.Row="1"
|
||||
Text="Leave Party"
|
||||
Command="{Binding LeavePartyCommand}"/>
|
||||
</Grid>
|
||||
</tabView:TabItem>
|
||||
<!-- Library Tab -->
|
||||
<tabView:TabItem
|
||||
HeaderText="Queue">
|
||||
<library:Library
|
||||
|
@ -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