Implemente l'accès authentifié au chat
This commit is contained in:
parent
2237cf717e
commit
f10956c13e
12 changed files with 179 additions and 62 deletions
|
|
@ -8,7 +8,7 @@ using Xamarin.Forms;
|
|||
|
||||
namespace BookAStar.Converters
|
||||
{
|
||||
class BooleanToObjectConverter<T> : IValueConverter
|
||||
public class BooleanToObjectConverter<T> : IValueConverter
|
||||
{
|
||||
public T FalseObject { set; get; }
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
using Microsoft.AspNet.SignalR.Client;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace BookAStar.Converters
|
||||
{
|
||||
public class SignalRConnectionStateToObject<T> : IValueConverter
|
||||
{
|
||||
public T ConnectedObject { set; get; }
|
||||
|
||||
public T ConnectingObject { set; get; }
|
||||
|
||||
public T DisconnectedObject { set; get; }
|
||||
|
||||
public T ReconnectingObject { set; get; }
|
||||
|
||||
public object Convert(object value, Type targetType,
|
||||
object parameter, CultureInfo culture)
|
||||
{
|
||||
switch ((ConnectionState)value) {
|
||||
case ConnectionState.Connected: return ConnectedObject;
|
||||
case ConnectionState.Connecting: return ConnectingObject;
|
||||
case ConnectionState.Disconnected: return DisconnectedObject;
|
||||
case ConnectionState.Reconnecting: return ReconnectingObject;
|
||||
}
|
||||
Debug.Assert(false);
|
||||
return null;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType,
|
||||
object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue