mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-21 21:46:27 +02:00
Version 3.0.338
This commit is contained in:
parent
573fe77e12
commit
0468955d49
751 changed files with 62747 additions and 60672 deletions
|
@ -3,53 +3,53 @@ using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
|
|||
|
||||
namespace TINK.View
|
||||
{
|
||||
public interface IViewService
|
||||
{
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
Task DisplayAlert(
|
||||
string title,
|
||||
string message,
|
||||
string cancel);
|
||||
public interface IViewService
|
||||
{
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
Task DisplayAlert(
|
||||
string title,
|
||||
string message,
|
||||
string cancel);
|
||||
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
Task DisplayAdvancedAlert(
|
||||
string title,
|
||||
string message,
|
||||
string details,
|
||||
string cancel);
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
Task DisplayAdvancedAlert(
|
||||
string title,
|
||||
string message,
|
||||
string details,
|
||||
string cancel);
|
||||
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
Task<bool> DisplayAlert(string title, string message, string accept, string cancel);
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
Task<bool> DisplayAlert(string title, string message, string accept, string cancel);
|
||||
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel);
|
||||
/// <summary> Displays alert message. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="details">Detailed error description.</param>
|
||||
/// <param name="accept">Text of accept button.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel);
|
||||
|
||||
/// <summary> Displays an action sheet. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <param name="destruction"></param>
|
||||
/// <param name="buttons">Buttons holding options to select.</param>
|
||||
/// <returns>T</returns>
|
||||
Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons);
|
||||
/// <summary> Displays an action sheet. </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Text of button.</param>
|
||||
/// <param name="destruction"></param>
|
||||
/// <param name="buttons">Buttons holding options to select.</param>
|
||||
/// <returns>T</returns>
|
||||
Task<string> DisplayActionSheet(string title, string cancel, string destruction, params string[] buttons);
|
||||
|
||||
#if USEFLYOUT
|
||||
/// <summary> Shows a page.</summary>
|
||||
|
@ -57,33 +57,33 @@ namespace TINK.View
|
|||
/// <param name="title">Title of page to show.</param>
|
||||
void ShowPage(ViewTypes type, string title = null);
|
||||
#else
|
||||
/// <summary> Shows a page.</summary>
|
||||
/// <param name="route">Route of the page to show.</param>
|
||||
/// <summary> Shows a page.</summary>
|
||||
/// <param name="route">Route of the page to show.</param>
|
||||
#if USCSHARP9
|
||||
public Task ShowPage(string route);
|
||||
#else
|
||||
Task ShowPage(string route);
|
||||
Task ShowPage(string route);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// <summary> Pushes a page onto the stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
Task PushAsync(ViewTypes typeOfPage);
|
||||
/// <summary> Pushes a page onto the stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
Task PushAsync(ViewTypes typeOfPage);
|
||||
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
Task PushModalAsync(ViewTypes typeOfPage);
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
Task PushModalAsync(ViewTypes typeOfPage);
|
||||
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
Task PopModalAsync();
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
Task PopModalAsync();
|
||||
|
||||
/// <summary> Displays user feedback popup.</summary>
|
||||
/// <param name="battery">Object holding info about battery. For some batteries charging level might need to be updated by user.</param>
|
||||
/// <param name="co2Saving"> Co2 saving information.</param>
|
||||
/// <returns>User feedback.</returns>
|
||||
Task<IUserFeedback> DisplayUserFeedbackPopup(
|
||||
IBattery battery = null,
|
||||
string co2Saving = null);
|
||||
/// <summary> Displays user feedback popup.</summary>
|
||||
/// <param name="battery">Object holding info about battery. For some batteries charging level might need to be updated by user.</param>
|
||||
/// <param name="co2Saving"> Co2 saving information.</param>
|
||||
/// <returns>User feedback.</returns>
|
||||
Task<IUserFeedback> DisplayUserFeedbackPopup(
|
||||
IBattery battery = null,
|
||||
string co2Saving = null);
|
||||
|
||||
#if USCSHARP9
|
||||
/// <summary>
|
||||
|
@ -105,31 +105,31 @@ namespace TINK.View
|
|||
string Message { get; set; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if !USCSHARP9
|
||||
/// <summary>
|
||||
/// Feedback given by user when returning bike.
|
||||
/// </summary>
|
||||
public interface IUserFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds the current chargeing level of the battery in bars, null if unkonwn.
|
||||
/// </summary>
|
||||
int? CurrentChargeBars { get; set; }
|
||||
/// <summary>
|
||||
/// Feedback given by user when returning bike.
|
||||
/// </summary>
|
||||
public interface IUserFeedback
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds the current chargeing level of the battery in bars, null if unkonwn.
|
||||
/// </summary>
|
||||
int? CurrentChargeBars { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds whether bike is broken or not.
|
||||
/// </summary>
|
||||
bool IsBikeBroken { get; set; }
|
||||
/// <summary>
|
||||
/// Holds whether bike is broken or not.
|
||||
/// </summary>
|
||||
bool IsBikeBroken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds either
|
||||
/// - general feedback
|
||||
/// - error description of broken bike
|
||||
/// or both.
|
||||
/// </summary>
|
||||
string Message { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Holds either
|
||||
/// - general feedback
|
||||
/// - error description of broken bike
|
||||
/// or both.
|
||||
/// </summary>
|
||||
string Message { get; set; }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
namespace TINK.View.Themes
|
||||
{
|
||||
public interface ITheme
|
||||
{
|
||||
string OperatorInfo { get; }
|
||||
}
|
||||
public interface ITheme
|
||||
{
|
||||
string OperatorInfo { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,16 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.Themes
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class Konrad : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "Mein konrad";
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class Konrad : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "Mein konrad";
|
||||
|
||||
public Konrad()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public Konrad()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
}
|
|
@ -4,16 +4,16 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.Themes
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class LastenradBayern : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "Lastenrad Bayern";
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class LastenradBayern : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "Lastenrad Bayern";
|
||||
|
||||
public LastenradBayern()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public LastenradBayern()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
}
|
|
@ -4,16 +4,16 @@ using Xamarin.Forms.Xaml;
|
|||
|
||||
namespace TINK.Themes
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ShareeBike : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "sharee.bike";
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ShareeBike : ResourceDictionary, ITheme
|
||||
{
|
||||
public const string OPERATORINFO = "sharee.bike";
|
||||
|
||||
public ShareeBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public ShareeBike()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
public string OperatorInfo => OPERATORINFO;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue