mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -6,25 +6,25 @@ using Xamarin.Forms;
|
|||
namespace TINK.View.Settings
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Translates user permissions into visibility state.
|
||||
/// Used for container which holds a bunch of GUI elemets which migth all/ partly/ none be visible
|
||||
/// If all childs are invisible frame must be invisible as well. As soon as one child is visible frame must be visible as well.
|
||||
/// </summary>
|
||||
public class BackendPermissionsToVisibleConverter : IValueConverter
|
||||
{
|
||||
/// <summary> Converts permission value into visible state.</summary>
|
||||
/// <param name="value">Permission value from view model used to derive whether object is visible or not.</param>
|
||||
/// <returns>Boolean value indicating whether object is visible or not.</returns>
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var enumValue = (Permissions)value;
|
||||
return enumValue.HasFlag(Permissions.PickCopriServer) | enumValue.HasFlag(Permissions.ManagePolling) | enumValue.HasFlag(Permissions.ManageCopriCacheExpiration);
|
||||
}
|
||||
/// <summary>
|
||||
/// Translates user permissions into visibility state.
|
||||
/// Used for container which holds a bunch of GUI elemets which migth all/ partly/ none be visible
|
||||
/// If all childs are invisible frame must be invisible as well. As soon as one child is visible frame must be visible as well.
|
||||
/// </summary>
|
||||
public class BackendPermissionsToVisibleConverter : IValueConverter
|
||||
{
|
||||
/// <summary> Converts permission value into visible state.</summary>
|
||||
/// <param name="value">Permission value from view model used to derive whether object is visible or not.</param>
|
||||
/// <returns>Boolean value indicating whether object is visible or not.</returns>
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
var enumValue = (Permissions)value;
|
||||
return enumValue.HasFlag(Permissions.PickCopriServer) | enumValue.HasFlag(Permissions.ManagePolling) | enumValue.HasFlag(Permissions.ManageCopriCacheExpiration);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Permissions.None;
|
||||
}
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Permissions.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,30 +5,30 @@ using Xamarin.Forms;
|
|||
|
||||
namespace TINK.View.Settings
|
||||
{
|
||||
/// <summary> Translates user permissions into visibility state. </summary>
|
||||
public class PermissionToVisibleConverter : BindableObject, IValueConverter
|
||||
{
|
||||
static readonly BindableProperty VisibleFlagProperty =
|
||||
BindableProperty.Create(nameof(VisibleFlag), typeof(Permissions), typeof(BindableObject));
|
||||
/// <summary> Translates user permissions into visibility state. </summary>
|
||||
public class PermissionToVisibleConverter : BindableObject, IValueConverter
|
||||
{
|
||||
static readonly BindableProperty VisibleFlagProperty =
|
||||
BindableProperty.Create(nameof(VisibleFlag), typeof(Permissions), typeof(BindableObject));
|
||||
|
||||
/// <summary> Property set from XAML determinig for which permission value object is visible.</summary>
|
||||
public Permissions VisibleFlag
|
||||
{
|
||||
get => (Permissions)GetValue(VisibleFlagProperty);
|
||||
set => SetValue(VisibleFlagProperty, value);
|
||||
}
|
||||
/// <summary> Property set from XAML determinig for which permission value object is visible.</summary>
|
||||
public Permissions VisibleFlag
|
||||
{
|
||||
get => (Permissions)GetValue(VisibleFlagProperty);
|
||||
set => SetValue(VisibleFlagProperty, value);
|
||||
}
|
||||
|
||||
/// <summary> Converts permission value into visible state.</summary>
|
||||
/// <param name="value">Permission value from view model used to derive whether object is visible or not.</param>
|
||||
/// <returns>Boolean value indicating whether object is visible or not.</returns>
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return ((Permissions)value).HasFlag(VisibleFlag);
|
||||
}
|
||||
/// <summary> Converts permission value into visible state.</summary>
|
||||
/// <param name="value">Permission value from view model used to derive whether object is visible or not.</param>
|
||||
/// <returns>Boolean value indicating whether object is visible or not.</returns>
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return ((Permissions)value).HasFlag(VisibleFlag);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Permissions.None;
|
||||
}
|
||||
}
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return Permissions.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue