Event manager improvements. Changed to console.writeline instead of diagnostics
This commit is contained in:
		| @@ -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