mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-01-03 04:06:27 +01:00
Manually merged.
This commit is contained in:
parent
c7c9f252af
commit
e5c09b9b8d
33 changed files with 39827 additions and 529 deletions
222
TINK/TINK.Android/Resources/Resource.Designer.cs
generated
222
TINK/TINK.Android/Resources/Resource.Designer.cs
generated
|
@ -29,6 +29,228 @@ namespace TINK.Droid
|
|||
global::PCLCrypto.Resource.String.Hello = global::TINK.Droid.Resource.String.Hello;
|
||||
global::PCLStorage.Resource.String.ApplicationName = global::TINK.Droid.Resource.String.ApplicationName;
|
||||
global::PCLStorage.Resource.String.Hello = global::TINK.Droid.Resource.String.Hello;
|
||||
global::Plugin.Permissions.Resource.Attribute.alpha = global::TINK.Droid.Resource.Attribute.alpha;
|
||||
global::Plugin.Permissions.Resource.Attribute.coordinatorLayoutStyle = global::TINK.Droid.Resource.Attribute.coordinatorLayoutStyle;
|
||||
global::Plugin.Permissions.Resource.Attribute.font = global::TINK.Droid.Resource.Attribute.font;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderAuthority = global::TINK.Droid.Resource.Attribute.fontProviderAuthority;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderCerts = global::TINK.Droid.Resource.Attribute.fontProviderCerts;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderFetchStrategy = global::TINK.Droid.Resource.Attribute.fontProviderFetchStrategy;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderFetchTimeout = global::TINK.Droid.Resource.Attribute.fontProviderFetchTimeout;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderPackage = global::TINK.Droid.Resource.Attribute.fontProviderPackage;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontProviderQuery = global::TINK.Droid.Resource.Attribute.fontProviderQuery;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontStyle = global::TINK.Droid.Resource.Attribute.fontStyle;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontVariationSettings = global::TINK.Droid.Resource.Attribute.fontVariationSettings;
|
||||
global::Plugin.Permissions.Resource.Attribute.fontWeight = global::TINK.Droid.Resource.Attribute.fontWeight;
|
||||
global::Plugin.Permissions.Resource.Attribute.keylines = global::TINK.Droid.Resource.Attribute.keylines;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_anchor = global::TINK.Droid.Resource.Attribute.layout_anchor;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_anchorGravity = global::TINK.Droid.Resource.Attribute.layout_anchorGravity;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_behavior = global::TINK.Droid.Resource.Attribute.layout_behavior;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_dodgeInsetEdges = global::TINK.Droid.Resource.Attribute.layout_dodgeInsetEdges;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_insetEdge = global::TINK.Droid.Resource.Attribute.layout_insetEdge;
|
||||
global::Plugin.Permissions.Resource.Attribute.layout_keyline = global::TINK.Droid.Resource.Attribute.layout_keyline;
|
||||
global::Plugin.Permissions.Resource.Attribute.statusBarBackground = global::TINK.Droid.Resource.Attribute.statusBarBackground;
|
||||
global::Plugin.Permissions.Resource.Attribute.ttcIndex = global::TINK.Droid.Resource.Attribute.ttcIndex;
|
||||
global::Plugin.Permissions.Resource.Color.browser_actions_bg_grey = global::TINK.Droid.Resource.Color.browser_actions_bg_grey;
|
||||
global::Plugin.Permissions.Resource.Color.browser_actions_divider_color = global::TINK.Droid.Resource.Color.browser_actions_divider_color;
|
||||
global::Plugin.Permissions.Resource.Color.browser_actions_text_color = global::TINK.Droid.Resource.Color.browser_actions_text_color;
|
||||
global::Plugin.Permissions.Resource.Color.browser_actions_title_color = global::TINK.Droid.Resource.Color.browser_actions_title_color;
|
||||
global::Plugin.Permissions.Resource.Color.notification_action_color_filter = global::TINK.Droid.Resource.Color.notification_action_color_filter;
|
||||
global::Plugin.Permissions.Resource.Color.notification_icon_bg_color = global::TINK.Droid.Resource.Color.notification_icon_bg_color;
|
||||
global::Plugin.Permissions.Resource.Color.ripple_material_light = global::TINK.Droid.Resource.Color.ripple_material_light;
|
||||
global::Plugin.Permissions.Resource.Color.secondary_text_default_material_light = global::TINK.Droid.Resource.Color.secondary_text_default_material_light;
|
||||
global::Plugin.Permissions.Resource.Dimension.browser_actions_context_menu_max_width = global::TINK.Droid.Resource.Dimension.browser_actions_context_menu_max_width;
|
||||
global::Plugin.Permissions.Resource.Dimension.browser_actions_context_menu_min_padding = global::TINK.Droid.Resource.Dimension.browser_actions_context_menu_min_padding;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_button_inset_horizontal_material = global::TINK.Droid.Resource.Dimension.compat_button_inset_horizontal_material;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_button_inset_vertical_material = global::TINK.Droid.Resource.Dimension.compat_button_inset_vertical_material;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_button_padding_horizontal_material = global::TINK.Droid.Resource.Dimension.compat_button_padding_horizontal_material;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_button_padding_vertical_material = global::TINK.Droid.Resource.Dimension.compat_button_padding_vertical_material;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_control_corner_material = global::TINK.Droid.Resource.Dimension.compat_control_corner_material;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_notification_large_icon_max_height = global::TINK.Droid.Resource.Dimension.compat_notification_large_icon_max_height;
|
||||
global::Plugin.Permissions.Resource.Dimension.compat_notification_large_icon_max_width = global::TINK.Droid.Resource.Dimension.compat_notification_large_icon_max_width;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_action_icon_size = global::TINK.Droid.Resource.Dimension.notification_action_icon_size;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_action_text_size = global::TINK.Droid.Resource.Dimension.notification_action_text_size;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_big_circle_margin = global::TINK.Droid.Resource.Dimension.notification_big_circle_margin;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_content_margin_start = global::TINK.Droid.Resource.Dimension.notification_content_margin_start;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_large_icon_height = global::TINK.Droid.Resource.Dimension.notification_large_icon_height;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_large_icon_width = global::TINK.Droid.Resource.Dimension.notification_large_icon_width;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_main_column_padding_top = global::TINK.Droid.Resource.Dimension.notification_main_column_padding_top;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_media_narrow_margin = global::TINK.Droid.Resource.Dimension.notification_media_narrow_margin;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_right_icon_size = global::TINK.Droid.Resource.Dimension.notification_right_icon_size;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_right_side_padding_top = global::TINK.Droid.Resource.Dimension.notification_right_side_padding_top;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_small_icon_background_padding = global::TINK.Droid.Resource.Dimension.notification_small_icon_background_padding;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_small_icon_size_as_large = global::TINK.Droid.Resource.Dimension.notification_small_icon_size_as_large;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_subtext_size = global::TINK.Droid.Resource.Dimension.notification_subtext_size;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_top_pad = global::TINK.Droid.Resource.Dimension.notification_top_pad;
|
||||
global::Plugin.Permissions.Resource.Dimension.notification_top_pad_large_text = global::TINK.Droid.Resource.Dimension.notification_top_pad_large_text;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_action_background = global::TINK.Droid.Resource.Drawable.notification_action_background;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg = global::TINK.Droid.Resource.Drawable.notification_bg;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg_low = global::TINK.Droid.Resource.Drawable.notification_bg_low;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg_low_normal = global::TINK.Droid.Resource.Drawable.notification_bg_low_normal;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg_low_pressed = global::TINK.Droid.Resource.Drawable.notification_bg_low_pressed;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg_normal = global::TINK.Droid.Resource.Drawable.notification_bg_normal;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_bg_normal_pressed = global::TINK.Droid.Resource.Drawable.notification_bg_normal_pressed;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_icon_background = global::TINK.Droid.Resource.Drawable.notification_icon_background;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_template_icon_bg = global::TINK.Droid.Resource.Drawable.notification_template_icon_bg;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_template_icon_low_bg = global::TINK.Droid.Resource.Drawable.notification_template_icon_low_bg;
|
||||
global::Plugin.Permissions.Resource.Drawable.notification_tile_bg = global::TINK.Droid.Resource.Drawable.notification_tile_bg;
|
||||
global::Plugin.Permissions.Resource.Drawable.notify_panel_notification_icon_bg = global::TINK.Droid.Resource.Drawable.notify_panel_notification_icon_bg;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_action_clickable_span = global::TINK.Droid.Resource.Id.accessibility_action_clickable_span;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_0 = global::TINK.Droid.Resource.Id.accessibility_custom_action_0;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_1 = global::TINK.Droid.Resource.Id.accessibility_custom_action_1;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_10 = global::TINK.Droid.Resource.Id.accessibility_custom_action_10;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_11 = global::TINK.Droid.Resource.Id.accessibility_custom_action_11;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_12 = global::TINK.Droid.Resource.Id.accessibility_custom_action_12;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_13 = global::TINK.Droid.Resource.Id.accessibility_custom_action_13;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_14 = global::TINK.Droid.Resource.Id.accessibility_custom_action_14;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_15 = global::TINK.Droid.Resource.Id.accessibility_custom_action_15;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_16 = global::TINK.Droid.Resource.Id.accessibility_custom_action_16;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_17 = global::TINK.Droid.Resource.Id.accessibility_custom_action_17;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_18 = global::TINK.Droid.Resource.Id.accessibility_custom_action_18;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_19 = global::TINK.Droid.Resource.Id.accessibility_custom_action_19;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_2 = global::TINK.Droid.Resource.Id.accessibility_custom_action_2;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_20 = global::TINK.Droid.Resource.Id.accessibility_custom_action_20;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_21 = global::TINK.Droid.Resource.Id.accessibility_custom_action_21;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_22 = global::TINK.Droid.Resource.Id.accessibility_custom_action_22;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_23 = global::TINK.Droid.Resource.Id.accessibility_custom_action_23;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_24 = global::TINK.Droid.Resource.Id.accessibility_custom_action_24;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_25 = global::TINK.Droid.Resource.Id.accessibility_custom_action_25;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_26 = global::TINK.Droid.Resource.Id.accessibility_custom_action_26;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_27 = global::TINK.Droid.Resource.Id.accessibility_custom_action_27;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_28 = global::TINK.Droid.Resource.Id.accessibility_custom_action_28;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_29 = global::TINK.Droid.Resource.Id.accessibility_custom_action_29;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_3 = global::TINK.Droid.Resource.Id.accessibility_custom_action_3;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_30 = global::TINK.Droid.Resource.Id.accessibility_custom_action_30;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_31 = global::TINK.Droid.Resource.Id.accessibility_custom_action_31;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_4 = global::TINK.Droid.Resource.Id.accessibility_custom_action_4;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_5 = global::TINK.Droid.Resource.Id.accessibility_custom_action_5;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_6 = global::TINK.Droid.Resource.Id.accessibility_custom_action_6;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_7 = global::TINK.Droid.Resource.Id.accessibility_custom_action_7;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_8 = global::TINK.Droid.Resource.Id.accessibility_custom_action_8;
|
||||
global::Plugin.Permissions.Resource.Id.accessibility_custom_action_9 = global::TINK.Droid.Resource.Id.accessibility_custom_action_9;
|
||||
global::Plugin.Permissions.Resource.Id.actions = global::TINK.Droid.Resource.Id.actions;
|
||||
global::Plugin.Permissions.Resource.Id.action_container = global::TINK.Droid.Resource.Id.action_container;
|
||||
global::Plugin.Permissions.Resource.Id.action_divider = global::TINK.Droid.Resource.Id.action_divider;
|
||||
global::Plugin.Permissions.Resource.Id.action_image = global::TINK.Droid.Resource.Id.action_image;
|
||||
global::Plugin.Permissions.Resource.Id.action_text = global::TINK.Droid.Resource.Id.action_text;
|
||||
global::Plugin.Permissions.Resource.Id.all = global::TINK.Droid.Resource.Id.all;
|
||||
global::Plugin.Permissions.Resource.Id.async = global::TINK.Droid.Resource.Id.async;
|
||||
global::Plugin.Permissions.Resource.Id.blocking = global::TINK.Droid.Resource.Id.blocking;
|
||||
global::Plugin.Permissions.Resource.Id.bottom = global::TINK.Droid.Resource.Id.bottom;
|
||||
global::Plugin.Permissions.Resource.Id.browser_actions_header_text = global::TINK.Droid.Resource.Id.browser_actions_header_text;
|
||||
global::Plugin.Permissions.Resource.Id.browser_actions_menu_items = global::TINK.Droid.Resource.Id.browser_actions_menu_items;
|
||||
global::Plugin.Permissions.Resource.Id.browser_actions_menu_item_icon = global::TINK.Droid.Resource.Id.browser_actions_menu_item_icon;
|
||||
global::Plugin.Permissions.Resource.Id.browser_actions_menu_item_text = global::TINK.Droid.Resource.Id.browser_actions_menu_item_text;
|
||||
global::Plugin.Permissions.Resource.Id.browser_actions_menu_view = global::TINK.Droid.Resource.Id.browser_actions_menu_view;
|
||||
global::Plugin.Permissions.Resource.Id.center = global::TINK.Droid.Resource.Id.center;
|
||||
global::Plugin.Permissions.Resource.Id.center_horizontal = global::TINK.Droid.Resource.Id.center_horizontal;
|
||||
global::Plugin.Permissions.Resource.Id.center_vertical = global::TINK.Droid.Resource.Id.center_vertical;
|
||||
global::Plugin.Permissions.Resource.Id.chronometer = global::TINK.Droid.Resource.Id.chronometer;
|
||||
global::Plugin.Permissions.Resource.Id.clip_horizontal = global::TINK.Droid.Resource.Id.clip_horizontal;
|
||||
global::Plugin.Permissions.Resource.Id.clip_vertical = global::TINK.Droid.Resource.Id.clip_vertical;
|
||||
global::Plugin.Permissions.Resource.Id.dialog_button = global::TINK.Droid.Resource.Id.dialog_button;
|
||||
global::Plugin.Permissions.Resource.Id.end = global::TINK.Droid.Resource.Id.end;
|
||||
global::Plugin.Permissions.Resource.Id.fill = global::TINK.Droid.Resource.Id.fill;
|
||||
global::Plugin.Permissions.Resource.Id.fill_horizontal = global::TINK.Droid.Resource.Id.fill_horizontal;
|
||||
global::Plugin.Permissions.Resource.Id.fill_vertical = global::TINK.Droid.Resource.Id.fill_vertical;
|
||||
global::Plugin.Permissions.Resource.Id.forever = global::TINK.Droid.Resource.Id.forever;
|
||||
global::Plugin.Permissions.Resource.Id.icon = global::TINK.Droid.Resource.Id.icon;
|
||||
global::Plugin.Permissions.Resource.Id.icon_group = global::TINK.Droid.Resource.Id.icon_group;
|
||||
global::Plugin.Permissions.Resource.Id.info = global::TINK.Droid.Resource.Id.info;
|
||||
global::Plugin.Permissions.Resource.Id.italic = global::TINK.Droid.Resource.Id.italic;
|
||||
global::Plugin.Permissions.Resource.Id.left = global::TINK.Droid.Resource.Id.left;
|
||||
global::Plugin.Permissions.Resource.Id.line1 = global::TINK.Droid.Resource.Id.line1;
|
||||
global::Plugin.Permissions.Resource.Id.line3 = global::TINK.Droid.Resource.Id.line3;
|
||||
global::Plugin.Permissions.Resource.Id.none = global::TINK.Droid.Resource.Id.none;
|
||||
global::Plugin.Permissions.Resource.Id.normal = global::TINK.Droid.Resource.Id.normal;
|
||||
global::Plugin.Permissions.Resource.Id.notification_background = global::TINK.Droid.Resource.Id.notification_background;
|
||||
global::Plugin.Permissions.Resource.Id.notification_main_column = global::TINK.Droid.Resource.Id.notification_main_column;
|
||||
global::Plugin.Permissions.Resource.Id.notification_main_column_container = global::TINK.Droid.Resource.Id.notification_main_column_container;
|
||||
global::Plugin.Permissions.Resource.Id.right = global::TINK.Droid.Resource.Id.right;
|
||||
global::Plugin.Permissions.Resource.Id.right_icon = global::TINK.Droid.Resource.Id.right_icon;
|
||||
global::Plugin.Permissions.Resource.Id.right_side = global::TINK.Droid.Resource.Id.right_side;
|
||||
global::Plugin.Permissions.Resource.Id.start = global::TINK.Droid.Resource.Id.start;
|
||||
global::Plugin.Permissions.Resource.Id.tag_accessibility_actions = global::TINK.Droid.Resource.Id.tag_accessibility_actions;
|
||||
global::Plugin.Permissions.Resource.Id.tag_accessibility_clickable_spans = global::TINK.Droid.Resource.Id.tag_accessibility_clickable_spans;
|
||||
global::Plugin.Permissions.Resource.Id.tag_accessibility_heading = global::TINK.Droid.Resource.Id.tag_accessibility_heading;
|
||||
global::Plugin.Permissions.Resource.Id.tag_accessibility_pane_title = global::TINK.Droid.Resource.Id.tag_accessibility_pane_title;
|
||||
global::Plugin.Permissions.Resource.Id.tag_screen_reader_focusable = global::TINK.Droid.Resource.Id.tag_screen_reader_focusable;
|
||||
global::Plugin.Permissions.Resource.Id.tag_transition_group = global::TINK.Droid.Resource.Id.tag_transition_group;
|
||||
global::Plugin.Permissions.Resource.Id.tag_unhandled_key_event_manager = global::TINK.Droid.Resource.Id.tag_unhandled_key_event_manager;
|
||||
global::Plugin.Permissions.Resource.Id.tag_unhandled_key_listeners = global::TINK.Droid.Resource.Id.tag_unhandled_key_listeners;
|
||||
global::Plugin.Permissions.Resource.Id.text = global::TINK.Droid.Resource.Id.text;
|
||||
global::Plugin.Permissions.Resource.Id.text2 = global::TINK.Droid.Resource.Id.text2;
|
||||
global::Plugin.Permissions.Resource.Id.time = global::TINK.Droid.Resource.Id.time;
|
||||
global::Plugin.Permissions.Resource.Id.title = global::TINK.Droid.Resource.Id.title;
|
||||
global::Plugin.Permissions.Resource.Id.top = global::TINK.Droid.Resource.Id.top;
|
||||
global::Plugin.Permissions.Resource.Integer.status_bar_notification_info_maxnum = global::TINK.Droid.Resource.Integer.status_bar_notification_info_maxnum;
|
||||
global::Plugin.Permissions.Resource.Layout.browser_actions_context_menu_page = global::TINK.Droid.Resource.Layout.browser_actions_context_menu_page;
|
||||
global::Plugin.Permissions.Resource.Layout.browser_actions_context_menu_row = global::TINK.Droid.Resource.Layout.browser_actions_context_menu_row;
|
||||
global::Plugin.Permissions.Resource.Layout.custom_dialog = global::TINK.Droid.Resource.Layout.custom_dialog;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_action = global::TINK.Droid.Resource.Layout.notification_action;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_action_tombstone = global::TINK.Droid.Resource.Layout.notification_action_tombstone;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_template_custom_big = global::TINK.Droid.Resource.Layout.notification_template_custom_big;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_template_icon_group = global::TINK.Droid.Resource.Layout.notification_template_icon_group;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_template_part_chronometer = global::TINK.Droid.Resource.Layout.notification_template_part_chronometer;
|
||||
global::Plugin.Permissions.Resource.Layout.notification_template_part_time = global::TINK.Droid.Resource.Layout.notification_template_part_time;
|
||||
global::Plugin.Permissions.Resource.String.status_bar_notification_info_overflow = global::TINK.Droid.Resource.String.status_bar_notification_info_overflow;
|
||||
global::Plugin.Permissions.Resource.Style.TextAppearance_Compat_Notification = global::TINK.Droid.Resource.Style.TextAppearance_Compat_Notification;
|
||||
global::Plugin.Permissions.Resource.Style.TextAppearance_Compat_Notification_Info = global::TINK.Droid.Resource.Style.TextAppearance_Compat_Notification_Info;
|
||||
global::Plugin.Permissions.Resource.Style.TextAppearance_Compat_Notification_Line2 = global::TINK.Droid.Resource.Style.TextAppearance_Compat_Notification_Line2;
|
||||
global::Plugin.Permissions.Resource.Style.TextAppearance_Compat_Notification_Time = global::TINK.Droid.Resource.Style.TextAppearance_Compat_Notification_Time;
|
||||
global::Plugin.Permissions.Resource.Style.TextAppearance_Compat_Notification_Title = global::TINK.Droid.Resource.Style.TextAppearance_Compat_Notification_Title;
|
||||
global::Plugin.Permissions.Resource.Style.Widget_Compat_NotificationActionContainer = global::TINK.Droid.Resource.Style.Widget_Compat_NotificationActionContainer;
|
||||
global::Plugin.Permissions.Resource.Style.Widget_Compat_NotificationActionText = global::TINK.Droid.Resource.Style.Widget_Compat_NotificationActionText;
|
||||
global::Plugin.Permissions.Resource.Style.Widget_Support_CoordinatorLayout = global::TINK.Droid.Resource.Style.Widget_Support_CoordinatorLayout;
|
||||
global::Plugin.Permissions.Resource.Styleable.ColorStateListItem = global::TINK.Droid.Resource.Styleable.ColorStateListItem;
|
||||
global::Plugin.Permissions.Resource.Styleable.ColorStateListItem_alpha = global::TINK.Droid.Resource.Styleable.ColorStateListItem_alpha;
|
||||
global::Plugin.Permissions.Resource.Styleable.ColorStateListItem_android_alpha = global::TINK.Droid.Resource.Styleable.ColorStateListItem_android_alpha;
|
||||
global::Plugin.Permissions.Resource.Styleable.ColorStateListItem_android_color = global::TINK.Droid.Resource.Styleable.ColorStateListItem_android_color;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout = global::TINK.Droid.Resource.Styleable.CoordinatorLayout;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_keylines = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_keylines;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_android_layout_gravity = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_android_layout_gravity;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_anchor = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_anchor;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_anchorGravity = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_anchorGravity;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_behavior = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_behavior;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_dodgeInsetEdges = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_dodgeInsetEdges;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_insetEdge = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_insetEdge;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_Layout_layout_keyline = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_Layout_layout_keyline;
|
||||
global::Plugin.Permissions.Resource.Styleable.CoordinatorLayout_statusBarBackground = global::TINK.Droid.Resource.Styleable.CoordinatorLayout_statusBarBackground;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily = global::TINK.Droid.Resource.Styleable.FontFamily;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont = global::TINK.Droid.Resource.Styleable.FontFamilyFont;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_android_font = global::TINK.Droid.Resource.Styleable.FontFamilyFont_android_font;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_android_fontStyle = global::TINK.Droid.Resource.Styleable.FontFamilyFont_android_fontStyle;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_android_fontVariationSettings = global::TINK.Droid.Resource.Styleable.FontFamilyFont_android_fontVariationSettings;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_android_fontWeight = global::TINK.Droid.Resource.Styleable.FontFamilyFont_android_fontWeight;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_android_ttcIndex = global::TINK.Droid.Resource.Styleable.FontFamilyFont_android_ttcIndex;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_font = global::TINK.Droid.Resource.Styleable.FontFamilyFont_font;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_fontStyle = global::TINK.Droid.Resource.Styleable.FontFamilyFont_fontStyle;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_fontVariationSettings = global::TINK.Droid.Resource.Styleable.FontFamilyFont_fontVariationSettings;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_fontWeight = global::TINK.Droid.Resource.Styleable.FontFamilyFont_fontWeight;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamilyFont_ttcIndex = global::TINK.Droid.Resource.Styleable.FontFamilyFont_ttcIndex;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderAuthority = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderAuthority;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderCerts = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderCerts;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderFetchStrategy = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderFetchStrategy;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderFetchTimeout = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderFetchTimeout;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderPackage = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderPackage;
|
||||
global::Plugin.Permissions.Resource.Styleable.FontFamily_fontProviderQuery = global::TINK.Droid.Resource.Styleable.FontFamily_fontProviderQuery;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor = global::TINK.Droid.Resource.Styleable.GradientColor;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColorItem = global::TINK.Droid.Resource.Styleable.GradientColorItem;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColorItem_android_color = global::TINK.Droid.Resource.Styleable.GradientColorItem_android_color;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColorItem_android_offset = global::TINK.Droid.Resource.Styleable.GradientColorItem_android_offset;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_centerColor = global::TINK.Droid.Resource.Styleable.GradientColor_android_centerColor;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_centerX = global::TINK.Droid.Resource.Styleable.GradientColor_android_centerX;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_centerY = global::TINK.Droid.Resource.Styleable.GradientColor_android_centerY;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_endColor = global::TINK.Droid.Resource.Styleable.GradientColor_android_endColor;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_endX = global::TINK.Droid.Resource.Styleable.GradientColor_android_endX;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_endY = global::TINK.Droid.Resource.Styleable.GradientColor_android_endY;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_gradientRadius = global::TINK.Droid.Resource.Styleable.GradientColor_android_gradientRadius;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_startColor = global::TINK.Droid.Resource.Styleable.GradientColor_android_startColor;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_startX = global::TINK.Droid.Resource.Styleable.GradientColor_android_startX;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_startY = global::TINK.Droid.Resource.Styleable.GradientColor_android_startY;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_tileMode = global::TINK.Droid.Resource.Styleable.GradientColor_android_tileMode;
|
||||
global::Plugin.Permissions.Resource.Styleable.GradientColor_android_type = global::TINK.Droid.Resource.Styleable.GradientColor_android_type;
|
||||
global::Plugin.Permissions.Resource.Xml.xamarin_essentials_fileprovider_file_paths = global::TINK.Droid.Resource.Xml.xamarin_essentials_fileprovider_file_paths;
|
||||
global::Xamarin.Auth.Resource.Animation.slide_in_right = global::TINK.Droid.Resource.Animation.slide_in_right;
|
||||
global::Xamarin.Auth.Resource.Animation.slide_out_left = global::TINK.Droid.Resource.Animation.slide_out_left;
|
||||
global::Xamarin.Auth.Resource.Attribute.alpha = global::TINK.Droid.Resource.Attribute.alpha;
|
||||
|
|
36940
TINK/TINK.Android/Resources/Resource.Designer.cs.bak
Normal file
36940
TINK/TINK.Android/Resources/Resource.Designer.cs.bak
Normal file
File diff suppressed because it is too large
Load diff
|
@ -30,7 +30,7 @@ namespace TINK.iOS
|
|||
e.NativeView.AccessibilityIdentifier = e.View.AutomationId;
|
||||
}
|
||||
};
|
||||
LoadApplication (new App ());
|
||||
LoadApplication (new TINK.App ());
|
||||
|
||||
// Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
|
||||
Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000");
|
||||
|
|
44
TINK/TINK.iOS/AppDelegate.cs.bak
Normal file
44
TINK/TINK.iOS/AppDelegate.cs.bak
Normal file
|
@ -0,0 +1,44 @@
|
|||
using Foundation;
|
||||
using UIKit;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace TINK.iOS
|
||||
{
|
||||
// The UIApplicationDelegate for the application. This class is responsible for launching the
|
||||
// User Interface of the application, as well as listening (and optionally responding) to
|
||||
// application events from iOS.
|
||||
[Register("AppDelegate")]
|
||||
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
|
||||
{
|
||||
//
|
||||
// This method is invoked when the application has loaded and is ready to run. In this
|
||||
// method you should instantiate the window, load the UI into it and then make the window
|
||||
// visible.
|
||||
//
|
||||
// You have 17 seconds to return from this method, or iOS will terminate your application.
|
||||
//
|
||||
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
||||
{
|
||||
global::Xamarin.Forms.Forms.Init ();
|
||||
|
||||
new iOS.Device.AppInfo(NSBundle.MainBundle.InfoDictionary[new NSString("CFBundleShortVersionString")]?.ToString() ?? string.Empty);
|
||||
|
||||
Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
|
||||
// http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
|
||||
if (null != e.View.AutomationId)
|
||||
{
|
||||
e.NativeView.AccessibilityIdentifier = e.View.AutomationId;
|
||||
}
|
||||
};
|
||||
LoadApplication (new App ());
|
||||
|
||||
// Required for initialization of Maps, see https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/
|
||||
Xamarin.FormsGoogleMaps.Init("000000000000000000000000000000000000000");
|
||||
|
||||
// Required for initialization of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
|
||||
Xamarin.FormsGoogleMapsBindings.Init();
|
||||
|
||||
return base.FinishedLaunching (app, options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -151,6 +151,7 @@ namespace TINK
|
|||
DependencyService.Get<ISmartDevice>(),
|
||||
specialFolders,
|
||||
new Cipher(),
|
||||
null, // Permissions, no more used.
|
||||
#if ARENDI
|
||||
DependencyService.Get<ICentral>(),
|
||||
#else
|
||||
|
|
306
TINK/TINK/App.xaml.cs.bak
Normal file
306
TINK/TINK/App.xaml.cs.bak
Normal file
|
@ -0,0 +1,306 @@
|
|||
using System;
|
||||
using Xamarin.Forms.Xaml;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.User.Account;
|
||||
using Xamarin.Forms;
|
||||
using Serilog;
|
||||
using Serilog.Core;
|
||||
using System.Collections.Generic;
|
||||
using Serilog.Events;
|
||||
using TINK.Model.Logging;
|
||||
using TINK.Model.Device;
|
||||
using System.Linq;
|
||||
using MonkeyCache.FileStore;
|
||||
using Plugin.Connectivity;
|
||||
using System.Threading;
|
||||
using TINK.Model.Settings;
|
||||
using TINK.Services.BluetoothLock.Crypto;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Services;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Services.Permissions;
|
||||
#if ARENDI
|
||||
using Arendi.BleLibrary.Local;
|
||||
#endif
|
||||
|
||||
// Required for support of binding package, see https://github.com/nuitsjp/Xamarin.Forms.GoogleMaps.Bindings.
|
||||
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
namespace TINK
|
||||
{
|
||||
public partial class App : Application
|
||||
{
|
||||
/// <summary>Title of the attachment file.</summary>
|
||||
private const string ATTACHMENTTITLE = "Diagnostics.txt";
|
||||
|
||||
/// <summary> Model root. </summary>
|
||||
private static TinkApp m_oModelRoot;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the model root.
|
||||
/// </summary>
|
||||
public static TinkApp ModelRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_oModelRoot != null)
|
||||
{
|
||||
// Root model already exists, nothing to do.
|
||||
return m_oModelRoot;
|
||||
}
|
||||
|
||||
// Get folder where to read settings from
|
||||
var specialFolders = DependencyService.Get<ISpecialFolder>();
|
||||
var internalPersonalDir = specialFolders.GetInternalPersonalDir();
|
||||
|
||||
// Delete attachtment from previous session.
|
||||
DeleteAttachment(internalPersonalDir);
|
||||
|
||||
// Setup logger using default settings.
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(new LoggingLevelSwitch { MinimumLevel = Model.Settings.Settings.DEFAULTLOGGINLEVEL })
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.File(internalPersonalDir, Model.Logging.RollingInterval.Session)
|
||||
.CreateLogger();
|
||||
|
||||
// Subscribe to any unhandled/ unobserved exceptions.
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, unobservedTaskExceptionEventArgs) => { Log.Fatal("Unobserved task exception: {Exception}", unobservedTaskExceptionEventArgs.ExceptionObject); };
|
||||
TaskScheduler.UnobservedTaskException += (sender, unhandledExceptionEventArgs) => { Log.Fatal("Unhandled exception: {Exception}", unhandledExceptionEventArgs.Exception); };
|
||||
|
||||
// Restore last model state from json- file.
|
||||
Dictionary<string, string> settingsJSON = new Dictionary<string, string>();
|
||||
try
|
||||
{
|
||||
settingsJSON = JsonSettingsDictionary.Deserialize(internalPersonalDir);
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.Error("Reading application settings from file failed.", exception);
|
||||
}
|
||||
|
||||
Model.Settings.Settings settings;
|
||||
try
|
||||
{
|
||||
settings = new Model.Settings.Settings(
|
||||
null, // Turn off filtering for sharee.bike- context
|
||||
null, // Turn off filtering for sharee.bike- context
|
||||
JsonSettingsDictionary.GetCopriHostUri(settingsJSON),
|
||||
JsonSettingsDictionary.GetPollingParameters(settingsJSON),
|
||||
JsonSettingsDictionary.GetMinimumLoggingLevel(settingsJSON),
|
||||
JsonSettingsDictionary.GetIsReportLevelVerbose(settingsJSON),
|
||||
JsonSettingsDictionary.GetExpiresAfter(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveLockService(settingsJSON),
|
||||
JsonSettingsDictionary.GetConnectTimeout(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveGeolocationService(settingsJSON),
|
||||
JsonSettingsDictionary.GetCenterMapToCurrentLocation(settingsJSON),
|
||||
Xamarin.Forms.GoogleMaps.MapSpan.FromCenterAndRadius(new Xamarin.Forms.GoogleMaps.Position(47.995865, 7.815086), Xamarin.Forms.GoogleMaps.Distance.FromKilometers(2.9)),
|
||||
JsonSettingsDictionary.GetLogToExternalFolder(settingsJSON),
|
||||
JsonSettingsDictionary.GetIsSiteCachingOn(settingsJSON),
|
||||
JsonSettingsDictionary.GetActiveTheme(settingsJSON));
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.Error("Deserializing application settings from dictionary failed.", exception);
|
||||
settings = new Model.Settings.Settings();
|
||||
}
|
||||
|
||||
if (settings.MinimumLogEventLevel != Model.Settings.Settings.DEFAULTLOGGINLEVEL
|
||||
|| settings.LogToExternalFolder)
|
||||
{
|
||||
// Eigher
|
||||
// - logging is not set to default value or
|
||||
// - logging is performed to external folder.
|
||||
// Need to reconfigure.
|
||||
Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs.
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(new LoggingLevelSwitch(settings.MinimumLogEventLevel))
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.File(!settings.LogToExternalFolder ? internalPersonalDir : specialFolders.GetExternalFilesDir(), Model.Logging.RollingInterval.Session)
|
||||
.CreateLogger();
|
||||
}
|
||||
|
||||
// Get auth cookie
|
||||
Log.Debug("Get auth cookie.");
|
||||
IStore store = null;
|
||||
|
||||
var lastVersion = JsonSettingsDictionary.GetAppVersion(settingsJSON);
|
||||
if (lastVersion > new Version(3, 0, 250))
|
||||
{
|
||||
// App versions newer than 3.0.173 stored geolocation service in configuration.
|
||||
// Force a switch to typeof(GeolocationService) for versions < 3.0.251
|
||||
GeolocationServicesContainer.SetActive(settings.ActiveGeolocationService);
|
||||
}
|
||||
|
||||
store = new Store();
|
||||
|
||||
Barrel.ApplicationId = "TINKApp";
|
||||
|
||||
var context = SynchronizationContext.Current;
|
||||
|
||||
var appInfoService = DependencyService.Get<IAppInfo>();
|
||||
|
||||
// Create new app instnace.
|
||||
Log.Debug("Constructing main model...");
|
||||
m_oModelRoot = new TinkApp(
|
||||
settings,
|
||||
store, // Manages user account
|
||||
(isConnected, activeUri, sessionCookie, mail, expiresAfter) => ConnectorFactory.Create(isConnected, activeUri, $"sharee.bike/{appInfoService.Version}", sessionCookie, mail, expiresAfter),
|
||||
GeolocationServicesContainer,
|
||||
null, /* locksService */
|
||||
DependencyService.Get<ISmartDevice>(),
|
||||
specialFolders,
|
||||
new Cipher(),
|
||||
#if ARENDI
|
||||
DependencyService.Get<ICentral>(),
|
||||
#else
|
||||
null,
|
||||
#endif
|
||||
isConnectedFunc: () => CrossConnectivity.Current.IsConnected,
|
||||
postAction: (d, obj) => context.Post(d, obj),
|
||||
currentVersion: appInfoService.Version,
|
||||
lastVersion: JsonSettingsDictionary.GetAppVersion(settingsJSON),
|
||||
whatsNewShownInVersion: JsonSettingsDictionary.GetWhatsNew(settingsJSON) ?? settingsJSON.GetAppVersion());
|
||||
|
||||
Log.Debug("Main model successfully constructed.");
|
||||
return m_oModelRoot;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Entry point of application.
|
||||
/// </summary>
|
||||
public App()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
#if USEFLYOUT
|
||||
// Use flyout page.
|
||||
MainPage = ModelRoot.WhatsNew.IsShowRequired
|
||||
? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.Root.RootPage()) // Show whats new info.
|
||||
: (Page)new View.Root.RootPage(); // Just start sharee- app
|
||||
#else
|
||||
// Use shell.
|
||||
MainPage = ModelRoot.WhatsNew.IsShowRequired
|
||||
? new View.WhatsNew.WhatsNewPage(() => MainPage = new View.RootShell.AppShell()) // Show whats new info.
|
||||
: (Page)new View.RootShell.AppShell(); // Just start sharee- app
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary> Concatenates all log files to a single one. </summary>
|
||||
/// <returns>Full file name of attachment.</returns>
|
||||
public static string CreateAttachment()
|
||||
{
|
||||
var sessionLogFiles = Log.Logger.GetLogFiles().ToArray();
|
||||
|
||||
if (sessionLogFiles.Length < 1)
|
||||
{
|
||||
// Either
|
||||
// - there is no logging file
|
||||
// - an error occurred getting list of log files.
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var fullLogFileName = System.IO.Path.Combine(ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
|
||||
|
||||
// Stop logging to avoid file access exception.
|
||||
Log.CloseAndFlush();
|
||||
|
||||
System.IO.File.WriteAllLines(
|
||||
fullLogFileName,
|
||||
sessionLogFiles.SelectMany(name =>
|
||||
(new List<string> { $"{{\"SessionFileName\":\"{name}\"}}" })
|
||||
.Concat(System.IO.File.ReadLines(name).ToArray())));
|
||||
|
||||
// Resume logging
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(new LoggingLevelSwitch { MinimumLevel = ModelRoot.Level.MinimumLevel })
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.File(ModelRoot.LogFileParentFolder, Model.Logging.RollingInterval.Session)
|
||||
.CreateLogger();
|
||||
|
||||
return fullLogFileName;
|
||||
}
|
||||
|
||||
/// <summary>Deletes an attachment if there is one.</summary>
|
||||
/// <param name="folder">Folder to delete, is null folder is queried from model.</param>
|
||||
private static void DeleteAttachment(string folder = null)
|
||||
{
|
||||
var attachment = System.IO.Path.Combine(folder ?? ModelRoot.LogFileParentFolder, ATTACHMENTTITLE);
|
||||
if (!System.IO.File.Exists(attachment))
|
||||
{
|
||||
// No attachment found.
|
||||
return;
|
||||
}
|
||||
|
||||
System.IO.File.Delete(attachment);
|
||||
}
|
||||
|
||||
protected override void OnSleep()
|
||||
{
|
||||
// Handle when your app sleeps
|
||||
Log.CloseAndFlush();
|
||||
}
|
||||
|
||||
protected override void OnResume()
|
||||
{
|
||||
DeleteAttachment();
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(new LoggingLevelSwitch { MinimumLevel = ModelRoot.Level.MinimumLevel })
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.File(ModelRoot.LogFileParentFolder, Model.Logging.RollingInterval.Session)
|
||||
.CreateLogger();
|
||||
}
|
||||
|
||||
/// <summary> Gets the current logging level.</summary>
|
||||
/// <returns></returns>
|
||||
private static LogEventLevel GetCurrentLogEventLevel()
|
||||
{
|
||||
foreach (LogEventLevel level in Enum.GetValues(typeof(LogEventLevel)))
|
||||
{
|
||||
if (Log.IsEnabled(level))
|
||||
return level;
|
||||
}
|
||||
|
||||
return LogEventLevel.Error;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Holds the permission service instance.
|
||||
/// </summary>
|
||||
private static ILocationPermission _PermissionsService = null;
|
||||
|
||||
/// <summary>
|
||||
/// Service to manage permissions (location) of the app.
|
||||
/// </summary>
|
||||
public static ILocationPermission PermissionsService
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_PermissionsService != null)
|
||||
return _PermissionsService;
|
||||
|
||||
_PermissionsService = new Services.Permissions.Plugin.Permissions();
|
||||
return _PermissionsService;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Service to manage bluetooth stack.
|
||||
/// </summary>
|
||||
public static Plugin.BLE.Abstractions.Contracts.IBluetoothLE BluetoothService => Plugin.BLE.CrossBluetoothLE.Current;
|
||||
|
||||
/// <summary>
|
||||
/// Service container to manage geolocation services.
|
||||
/// </summary>
|
||||
public static IServicesContainer<IGeolocation> GeolocationServicesContainer { get; }
|
||||
= new ServicesContainerMutable<IGeolocation>(
|
||||
new HashSet<IGeolocation> {
|
||||
new LastKnownGeolocationService(DependencyService.Get<IGeolodationDependent>()),
|
||||
new SimulatedGeolocationService(DependencyService.Get<IGeolodationDependent>()),
|
||||
new GeolocationService(DependencyService.Get<IGeolodationDependent>()) },
|
||||
Model.Settings.Settings.DefaultLocationService.FullName);
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@
|
|||
<tr><td>PCLStorage von Daniel Plaisted </td><td><a href="#MSPL_Long">Microsoft Public License (Ms-PL)</a> </td></tr>
|
||||
<tr><td>Pinvoke von AArnott </td><td><a href="#MITLicenseAArnott">MIT- Lizenz für Pinvoke</a> </td></tr>
|
||||
<tr><td>Plugin.BLE Adrian Seceleanu, Sven-Michael Stübe </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Plugin.Permissions von James Montemagno </td><td><a href="#MITLicenseMontemagno2016">MIT Lizenz 2016</a> </td></tr>
|
||||
<tr><td>Polly von Michael Wolfenden, App vNext </td><td><a href="#NewBSDLicense">New BSD License</a> </td></tr>
|
||||
<tr><td>Serilog von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Serilog.Sinks.Debug von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
|
|
667
TINK/TINK/HtmlResouces/V02/InfoLicenses.html.bak
Normal file
667
TINK/TINK/HtmlResouces/V02/InfoLicenses.html.bak
Normal file
|
@ -0,0 +1,667 @@
|
|||
<!DOCTYPE html
|
||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
|
||||
<head>
|
||||
<title>TINK-App</title>
|
||||
<meta name="viewport" content="width=device-width,target-densitydpi=device-dpi,initial-scale=1,user-scalable=yes" />
|
||||
<link rel="manifest" href="" />
|
||||
<link rel="stylesheet" type="text/css" href="https://www2.tink-konstanz.de/css/local_style.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="https://www2.tink-konstanz.de/bootstrap-3.3.6-dist/css/bootstrap.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto+Condensed" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="https://www2.tink-konstanz.de/jquery-ui/jquery-ui.min.css" media="screen" />
|
||||
<style type="text/css">
|
||||
@import url("https://www2.tink-konstanz.de/css/local_style.css");
|
||||
</style>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div class='container'>
|
||||
<div id='Contenttxt'>
|
||||
<div class="content_title2">Version</div>
|
||||
<div style=""></div>
|
||||
<br />Version ACTIVE_APPNAME: <b>CURRENT_VERSION_TINKAPP</b>.
|
||||
<div class="content_title2">Entwickler</div>
|
||||
<div style=""></div>
|
||||
<br />Programmierung ACTIVE_APPNAME: O. Hauff, app@sharee.bike<br />
|
||||
<div class="content_title2">Verwendete Bibliotheken</div>
|
||||
<div style=""></div>
|
||||
<br /><table>
|
||||
<tr><th>Paket </th><th>Lizenz </th></tr>
|
||||
<tr><td>Newtonsoft Json.NET von James Newton-King </td><td><a href="#MITLicense2007">MIT Lizenz 2007</a> </td></tr>
|
||||
<tr><td>PCLCrypto von AArnott </td><td><a href="#MSPL_Long">Microsoft Public License(Ms-PL)</a> </td></tr>
|
||||
<tr><td>PCLStorage von Daniel Plaisted </td><td><a href="#MSPL_Long">Microsoft Public License (Ms-PL)</a> </td></tr>
|
||||
<tr><td>Pinvoke von AArnott </td><td><a href="#MITLicenseAArnott">MIT- Lizenz für Pinvoke</a> </td></tr>
|
||||
<tr><td>Plugin.BLE Adrian Seceleanu, Sven-Michael Stübe </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Polly von Michael Wolfenden, App vNext </td><td><a href="#NewBSDLicense">New BSD License</a> </td></tr>
|
||||
<tr><td>Serilog von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Serilog.Sinks.Debug von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Serilog.Sinks.File von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Serilog.Sinks.Xaramri von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
|
||||
<tr><td>Validation von AArnott </td><td><a href="#MSPL_Short">Microsoft Public License (MS-PL)</a> </td></tr>
|
||||
<tr><td>Xam.Plugins.Messaging von Carel Lotz </td><td><a href="#MITLicense2014">MIT Lizenz 2014</a> </td></tr>
|
||||
<tr><td>MonkeyCache von James Montemagno </td><td><a href="#MITLicense2018">MIT Lizenz 2018</a> </td></tr>
|
||||
<tr><td>Xam.Plugin.Connectivity von James Montemagno </td><td><a href="#MITLicenseMontemagnoLCC2016">MIT Lizenz 2016</a> </td></tr>
|
||||
<tr><td>Xamarin.Forms.GoogleMaps von amay077 </td><td><a href="#MITLicense2016_2017">MIT Lizenz 2016- 2017</a> </td></tr>
|
||||
<tr><td>Xamarin.Essentials von Microsoft </td><td><a href="#MITLicenseMicrosoft">MIT Lizenz</a> </td></tr>
|
||||
</table>
|
||||
|
||||
<div class="content_title2">Lizenzen</div>
|
||||
<div style=""></div>
|
||||
<article id="ApacheLicense2.0_2004">
|
||||
<div class="content2">
|
||||
<span class='content1'>Apache License</span><br />
|
||||
<p>Version 2.0, January 2004</p>
|
||||
<p>www.apache.org</p>
|
||||
|
||||
<p>TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION</p>
|
||||
|
||||
<p>
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, "control" means (i) the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code,
|
||||
generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included
|
||||
in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that
|
||||
is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative Works
|
||||
shall not include works that remain separable from, or merely link (or bind by
|
||||
name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative Works
|
||||
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
||||
by the copyright owner or by an individual or Legal Entity authorized to submit
|
||||
on behalf of the copyright owner. For the purposes of this definition,
|
||||
"submitted" means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
</p>
|
||||
<p>
|
||||
2. Grant of Copyright License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
</p>
|
||||
<p>
|
||||
3. Grant of Patent License.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
||||
such license applies only to those patent claims licensable by such Contributor
|
||||
that are necessarily infringed by their Contribution(s) alone or by combination
|
||||
of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory
|
||||
patent infringement, then any patent licenses granted to You under this License
|
||||
for that Work shall terminate as of the date such litigation is filed.
|
||||
</p>
|
||||
<p>
|
||||
4. Redistribution.
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form,
|
||||
provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of
|
||||
this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form
|
||||
of the Work, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the
|
||||
attribution notices contained within such NOTICE file, excluding those notices
|
||||
that do not pertain to any part of the Derivative Works, in at least one of the
|
||||
following places: within a NOTICE text file distributed as part of the
|
||||
Derivative Works; within the Source form or documentation, if provided along
|
||||
with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents of
|
||||
the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works that
|
||||
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
||||
provided that such additional attribution notices cannot be construed as
|
||||
modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction, or
|
||||
distribution of Your modifications, or for any such Derivative Works as a whole,
|
||||
provided Your use, reproduction, and distribution of the Work otherwise complies
|
||||
with the conditions stated in this License.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
5. Submission of Contributions.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
||||
for inclusion in the Work by You to the Licensor shall be under the terms and
|
||||
conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
||||
any separate license agreement you may have executed with Licensor regarding
|
||||
such Contributions.
|
||||
</p>
|
||||
<p>
|
||||
|
||||
6. Trademarks.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the Licensor, except as required for
|
||||
reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
7. Disclaimer of Warranty.
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the
|
||||
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||
including, without limitation, any warranties or conditions of TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
||||
solely responsible for determining the appropriateness of using or
|
||||
redistributing the Work and assume any risks associated with Your exercise of
|
||||
permissions under this License.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
8. Limitation of Liability.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence),
|
||||
contract, or otherwise, unless required by applicable law (such as deliberate
|
||||
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License or
|
||||
out of the use or inability to use the Work (including but not limited to
|
||||
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||
any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
9. Accepting Warranty or Additional Liability.
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to
|
||||
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
||||
other liability obligations and/or rights consistent with this License. However,
|
||||
in accepting such obligations, You may act only on Your own behalf and on Your
|
||||
sole responsibility, not on behalf of any other Contributor, and only if You
|
||||
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
</p>
|
||||
<p>
|
||||
APPENDIX: How to apply the Apache License to your work
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate
|
||||
notice, with the fields enclosed by brackets "[]" replaced with your own
|
||||
identifying information. (Don't include the brackets!) The text should be
|
||||
enclosed in the appropriate comment syntax for the file format. We also
|
||||
recommend that a file or class name and description of purpose be included on
|
||||
the same "printed page" as the copyright notice for easier identification within
|
||||
third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MSPL_Long">
|
||||
<div class="content2">
|
||||
<span class='content1'>Microsoft Public License (Ms-PL)</span><br />
|
||||
|
||||
<p>
|
||||
This license governs use of the accompanying software. If you use the software,
|
||||
you accept this license. If you do not accept the license, do not use the
|
||||
software.
|
||||
</p>
|
||||
<p>1. Definitions</p>
|
||||
|
||||
<p>
|
||||
The terms "reproduce," "reproduction," "derivative works," and "distribution"
|
||||
have the same meaning here as under U.S. copyright law.
|
||||
</p>
|
||||
<p>
|
||||
A "contribution" is the original software, or any additions or changes to the
|
||||
software.
|
||||
</p>
|
||||
<p>
|
||||
A "contributor" is any person that distributes its contribution under this
|
||||
license.
|
||||
</p>
|
||||
<p>
|
||||
"Licensed patents" are a contributor's patent claims that read directly on its
|
||||
contribution.
|
||||
</p>
|
||||
<p>2. Grant of Rights</p>
|
||||
|
||||
<p>
|
||||
(A) Copyright Grant- Subject to the terms of this license, including the license
|
||||
conditions and limitations in section 3, each contributor grants you a
|
||||
non-exclusive, worldwide, royalty-free copyright license to reproduce its
|
||||
contribution, prepare derivative works of its contribution, and distribute its
|
||||
contribution or any derivative works that you create.
|
||||
</p>
|
||||
<p>
|
||||
(B) Patent Grant- Subject to the terms of this license, including the license
|
||||
conditions and limitations in section 3, each contributor grants you a
|
||||
non-exclusive, worldwide, royalty-free license under its licensed patents to
|
||||
make, have made, use, sell, offer for sale, import, and/or otherwise dispose of
|
||||
its contribution in the software or derivative works of the contribution in the
|
||||
software.
|
||||
</p>
|
||||
<p>3. Conditions and Limitations</p>
|
||||
|
||||
<p>
|
||||
(A) No Trademark License- This license does not grant you rights to use any
|
||||
contributors' name, logo, or trademarks.
|
||||
</p>
|
||||
<p>
|
||||
(B) If you bring a patent claim against any contributor over patents that you
|
||||
claim are infringed by the software, your patent license from such contributor
|
||||
to the software ends automatically.
|
||||
</p>
|
||||
<p>
|
||||
(C) If you distribute any portion of the software, you must retain all
|
||||
copyright, patent, trademark, and attribution notices that are present in the
|
||||
software.
|
||||
</p>
|
||||
<p>
|
||||
(D) If you distribute any portion of the software in source code form, you may
|
||||
do so only under this license by including a complete copy of this license with
|
||||
your distribution. If you distribute any portion of the software in compiled or
|
||||
object code form, you may only do so under a license that complies with this
|
||||
license.
|
||||
</p>
|
||||
<p>
|
||||
(E) The software is licensed "as-is." You bear the risk of using it. The
|
||||
contributors give no express warranties, guarantees or conditions. You may have
|
||||
additional consumer rights under your local laws which this license cannot
|
||||
change. To the extent permitted under your local laws, the contributors exclude
|
||||
the implied warranties of merchantability, fitness for a particular purpose and
|
||||
non-infringement.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MSPL_Short">
|
||||
<div class="content2">
|
||||
<span class='content1'>Microsoft Public License (MS-PL)</span><br />
|
||||
<p>
|
||||
This license governs use of the accompanying software. If you use the software, you
|
||||
accept this license. If you do not accept the license, do not use the software.
|
||||
</p>
|
||||
<p>1. Definitions</p>
|
||||
<p>
|
||||
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
|
||||
same meaning here as under U.S. copyright law.
|
||||
A "contribution" is the original software, or any additions or changes to the software.
|
||||
A "contributor" is any person that distributes its contribution under this license.
|
||||
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
</p>
|
||||
|
||||
<p>2. Grant of Rights</p>
|
||||
<p>
|
||||
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
|
||||
</p>
|
||||
<p>
|
||||
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
|
||||
</p>
|
||||
|
||||
<p>3. Conditions and Limitations</p>
|
||||
<p>
|
||||
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
</p>
|
||||
<p>
|
||||
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
|
||||
</p>
|
||||
<p>
|
||||
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
|
||||
</p>
|
||||
<p>
|
||||
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
|
||||
</p>
|
||||
<p>
|
||||
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicenseAArnott">
|
||||
<div class="content2">
|
||||
<span class='content1'>MIT- Lizenz für Pinvoke von AArnott</span><br />
|
||||
<p>
|
||||
The following license applies to all files in this project unless specified otherwise
|
||||
within individual files.
|
||||
See also the COPYRIGHT.md file.
|
||||
</p>
|
||||
<p>The MIT License (MIT)</p>
|
||||
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicense2007">
|
||||
<div class="content2">
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
|
||||
<p>Copyright (c) 2007 James Newton-King</p>
|
||||
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the /"Software/"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicense2014">
|
||||
<div class="content2">
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
<p>Copyright (c) 2014 Carel Lotz</p>
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicense2016_2017">
|
||||
<div class="content2">
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
|
||||
<p>Copyright (c) amay077 2016 - 2017</p>
|
||||
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicense2018">
|
||||
<div class="content2">
|
||||
<span class='content1'>MIT License</span><br />
|
||||
<p>Copyright (c) 2018 James Montemagno</p>
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicenseMontemagnoLCC2016">
|
||||
<div class="content2">
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
<p>
|
||||
Copyright (c) 2016 James Montemagno / Refractored LLC
|
||||
</p>
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
||||
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="NewBSDLicense">
|
||||
<div class="content2">
|
||||
<span class='content1'>New BSD License</span><br />
|
||||
|
||||
<p>
|
||||
Copyright (c) 2015-2020, App vNext<br />
|
||||
All rights reserved.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
<ul>
|
||||
<li/> Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
<li /> Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
<li /> Neither the name of App vNext nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER
|
||||
BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicenseMicrosoft">
|
||||
<div class="content2">
|
||||
<p>Xamarin.Essentials</p>
|
||||
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
|
||||
<p>Copyright (c) Microsoft Corporation</p>
|
||||
|
||||
<p>All rights reserved.</p>
|
||||
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article id="MITLicenseMontemagno2016">
|
||||
<div class="content2">
|
||||
<span class='content1'>The MIT License (MIT)</span><br />
|
||||
<p>
|
||||
Copyright (c) 2016 James Montemagno
|
||||
</p>
|
||||
<p>
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
</p>
|
||||
<p>
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
</p>
|
||||
<p>
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
</p>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -91,14 +91,6 @@ namespace TINK.View.Contact
|
|||
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
|
||||
#endif
|
||||
|
||||
#if USEFLYOUT
|
||||
|
||||
/// <summary>
|
||||
/// Delegate to perform navigation.
|
||||
/// </summary>
|
||||
public INavigationMasterDetail NavigationMasterDetail { set; private get; }
|
||||
#endif
|
||||
|
||||
#if USEFLYOUT
|
||||
|
||||
/// <summary>
|
||||
|
|
110
TINK/TINK/View/Contact/ContactPage.xaml.cs.bak
Normal file
110
TINK/TINK/View/Contact/ContactPage.xaml.cs.bak
Normal file
|
@ -0,0 +1,110 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using TINK.Model.Device;
|
||||
using TINK.View.MasterDetail;
|
||||
using TINK.ViewModel.Info;
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace TINK.View.Contact
|
||||
{
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
public partial class ContactPage : ContentPage, IViewService, IDetailPage
|
||||
|
||||
{
|
||||
public ContactPage ()
|
||||
{
|
||||
InitializeComponent ();
|
||||
|
||||
ContactPageView.BindingContext = new ContactPageViewModel(
|
||||
App.ModelRoot.SelectedStation,
|
||||
App.ModelRoot.Uris.ActiveUri,
|
||||
() => App.CreateAttachment(),
|
||||
() => DependencyService.Get<IExternalBrowserService>().OpenUrl(DependencyService.Get<IAppInfo>().StoreUrl),
|
||||
this);
|
||||
}
|
||||
|
||||
/// <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">Type of buttons.</param>
|
||||
public async Task DisplayAdvancedAlert(
|
||||
string title,
|
||||
string message,
|
||||
string details,
|
||||
string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
|
||||
|
||||
/// <summary> Displays detailed 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 cancel button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
public async Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", accept, cancel);
|
||||
|
||||
#if USEFLYOUT
|
||||
public void ShowPage(ViewTypes p_oType, string title = null)
|
||||
=> NavigationMasterDetail.ShowPage(p_oType.GetViewType(), title);
|
||||
#else
|
||||
/// <summary> Shows a page.</summary>
|
||||
/// <param name="route">Route of the page to show.</param>
|
||||
public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
|
||||
#endif
|
||||
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
/// <param name="p_oTypeOfPage">Page to display.</param>
|
||||
public Task PushModalAsync(ViewTypes p_oTypeOfPage)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary> Pops a page from the modal stack. </summary>
|
||||
public Task PopModalAsync()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary> Pushes a page onto the stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
public async Task PushAsync(ViewTypes typeOfPage)
|
||||
{
|
||||
|
||||
if (!(Activator.CreateInstance(typeOfPage.GetViewType()) is IDetailPage detailPage))
|
||||
{
|
||||
await Task.CompletedTask;
|
||||
return;
|
||||
}
|
||||
|
||||
// Set reference to navigation object to be able to show page on newly shown detailPage.
|
||||
detailPage.NavigationMasterDetail = NavigationMasterDetail;
|
||||
|
||||
await Navigation.PushAsync((Page)detailPage);
|
||||
}
|
||||
|
||||
#if USCSHARP9
|
||||
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
|
||||
#else
|
||||
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
|
||||
#endif
|
||||
|
||||
#if USEFLYOUT
|
||||
|
||||
/// <summary>
|
||||
/// Delegate to perform navigation.
|
||||
/// </summary>
|
||||
public INavigationMasterDetail NavigationMasterDetail { set; private get; }
|
||||
#endif
|
||||
|
||||
#if USEFLYOUT
|
||||
|
||||
/// <summary>
|
||||
/// Delegate to perform navigation.
|
||||
/// </summary>
|
||||
public INavigationMasterDetail NavigationMasterDetail { set; private get; }
|
||||
#endif
|
||||
}
|
||||
}
|
|
@ -21,9 +21,6 @@ namespace TINK.View.Map
|
|||
/// <summary> View model to notify about whether page appears or hides. </summary>
|
||||
private MapPageViewModel MapPageViewModel { get; set; }
|
||||
|
||||
/// <summary> Initialization status to ensure initialization logic is not called multiple times. </summary>
|
||||
private bool isInitializationStarted = false;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs map page instance.
|
||||
/// </summary>
|
||||
|
@ -135,10 +132,6 @@ namespace TINK.View.Map
|
|||
/// </summary>
|
||||
protected async override void OnAppearing()
|
||||
{
|
||||
// Don't repeat the initialization if it has been completed already.
|
||||
if (isInitializationStarted) return;
|
||||
isInitializationStarted = true;
|
||||
|
||||
// Pass reference to member Navigation to show bikes at station x dialog.
|
||||
try
|
||||
{
|
||||
|
@ -147,10 +140,16 @@ namespace TINK.View.Map
|
|||
#if TRYNOTBACKSTYLE
|
||||
MapPageViewModel = new MapPageViewModel();
|
||||
#else
|
||||
MapPageViewModel = CreateMapPageViewModel();
|
||||
MapPageViewModel = new MapPageViewModel(
|
||||
App.ModelRoot,
|
||||
App.PermissionsService,
|
||||
App.BluetoothService,
|
||||
App.GeolocationServicesContainer.Active,
|
||||
(mapspan) => MyMap.MoveToRegion(mapspan),
|
||||
this,
|
||||
Navigation);
|
||||
#endif
|
||||
}
|
||||
catch (Exception exception)
|
||||
} catch (Exception exception)
|
||||
{
|
||||
|
||||
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
|
||||
|
@ -173,7 +172,15 @@ namespace TINK.View.Map
|
|||
|
||||
try
|
||||
{
|
||||
ApplyCustomiOSStyling();
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
TINKButton.BackgroundColor = Color.LightGray;
|
||||
TINKButton.BorderColor = Color.Black;
|
||||
TINKButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
KonradButton.BackgroundColor = Color.LightGray;
|
||||
KonradButton.BorderColor = Color.Black;
|
||||
KonradButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
@ -218,52 +225,6 @@ namespace TINK.View.Map
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Premoves the Map to a certain location.
|
||||
/// </summary>
|
||||
private void PremoveAndScaleMap()
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates the Map Page's view model.
|
||||
/// </summary>
|
||||
private MapPageViewModel CreateMapPageViewModel()
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
|
||||
return new MapPageViewModel(
|
||||
App.ModelRoot,
|
||||
App.PermissionsService,
|
||||
App.BluetoothService,
|
||||
App.GeolocationServicesContainer.Active,
|
||||
(mapspan) => MyMap.MoveToRegion(mapspan),
|
||||
this,
|
||||
Navigation);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Applies iOS specific styling to branded Buttons.
|
||||
/// </summary>
|
||||
private void ApplyCustomiOSStyling()
|
||||
{
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
TINKButton.BackgroundColor = Color.LightGray;
|
||||
TINKButton.BorderColor = Color.Black;
|
||||
TINKButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
KonradButton.BackgroundColor = Color.LightGray;
|
||||
KonradButton.BorderColor = Color.Black;
|
||||
KonradButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when pages is closed/ hidden.
|
||||
/// Stops update process.
|
||||
|
@ -278,4 +239,4 @@ namespace TINK.View.Map
|
|||
base.OnDisappearing();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
281
TINK/TINK/View/Map/MapPage.xaml.cs.bak
Normal file
281
TINK/TINK/View/Map/MapPage.xaml.cs.bak
Normal file
|
@ -0,0 +1,281 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
#if USEFLYOUT
|
||||
using TINK.View.MasterDetail;
|
||||
#endif
|
||||
using Xamarin.Forms;
|
||||
using Xamarin.Forms.Xaml;
|
||||
|
||||
namespace TINK.View.Map
|
||||
{
|
||||
using Serilog;
|
||||
using TINK.ViewModel.Map;
|
||||
|
||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||
#if USEFLYOUT
|
||||
public partial class MapPage : ContentPage, IViewService, IDetailPage
|
||||
#else
|
||||
public partial class MapPage : ContentPage, IViewService
|
||||
#endif
|
||||
{
|
||||
/// <summary> View model to notify about whether page appears or hides. </summary>
|
||||
private MapPageViewModel MapPageViewModel { get; set; }
|
||||
|
||||
/// <summary> Initialization status to ensure initialization logic is not called multiple times. </summary>
|
||||
private bool isInitializationStarted = false;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs map page instance.
|
||||
/// </summary>
|
||||
public MapPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Displays alert message.
|
||||
/// </summary>
|
||||
/// <param name="title">Title of message.</param>
|
||||
/// <param name="message">Message to display.</param>
|
||||
/// <param name="cancel">Type of buttons.</param>
|
||||
public new async Task DisplayAlert(string title, string message, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, message, 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">Type of buttons.</param>
|
||||
public async Task DisplayAdvancedAlert(
|
||||
string title,
|
||||
string message,
|
||||
string details,
|
||||
string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
|
||||
|
||||
/// <summary> Displays detailed 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 cancel button.</param>
|
||||
/// <returns>True if user pressed accept.</returns>
|
||||
public async Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", accept, 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>
|
||||
public new async Task<bool> DisplayAlert(string title, string message, string accept, string cancel)
|
||||
=> await App.Current.MainPage.DisplayAlert(title, message, accept, cancel);
|
||||
|
||||
#if USEFLYOUT
|
||||
/// <summary>
|
||||
/// Creates and a page an shows it.
|
||||
/// </summary>
|
||||
/// <param name="p_oTypeOfPage">Type of page to show.</param>
|
||||
public void ShowPage(ViewTypes type, string title = null)
|
||||
=> NavigationMasterDetail.ShowPage(type.GetViewType(), title);
|
||||
#else
|
||||
/// <summary> Shows a page.</summary>
|
||||
/// <param name="route">Route of the page to show.</param>
|
||||
public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
|
||||
#endif
|
||||
|
||||
/// <summary> Pushes a page onto the modal stack. </summary>
|
||||
/// <param name="typeOfPage">Type of page to display.</param>
|
||||
public async Task PushModalAsync(ViewTypes typeOfPage)
|
||||
=> await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
|
||||
|
||||
/// <summary> Pops a page from the modal stack. </summary>
|
||||
public async Task PopModalAsync()
|
||||
=> await Navigation.PopModalAsync();
|
||||
|
||||
/// <summary> Pushes a page onto the stack. </summary>
|
||||
/// <param name="typeOfPage">Page to display.</param>
|
||||
public async Task PushAsync(ViewTypes typeOfPage)
|
||||
{
|
||||
#if USEFLYOUT
|
||||
var page = Activator.CreateInstance(typeOfPage.GetViewType()) as IDetailPage;
|
||||
#else
|
||||
var page = Activator.CreateInstance(p_oTypeOfPage.GetViewType());
|
||||
#endif
|
||||
if (page == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if USEFLYOUT
|
||||
page.NavigationMasterDetail = NavigationMasterDetail;
|
||||
#endif
|
||||
|
||||
await Navigation.PushAsync((Page)page);
|
||||
}
|
||||
|
||||
#if USCSHARP9
|
||||
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
|
||||
#else
|
||||
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
|
||||
#endif
|
||||
|
||||
#if USEFLYOUT
|
||||
/// <summary> Delegate to perform navigation.</summary>
|
||||
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
|
||||
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when page is shown.
|
||||
/// Starts update process.
|
||||
/// </summary>
|
||||
protected async override void OnAppearing()
|
||||
{
|
||||
// Don't repeat the initialization if it has been completed already.
|
||||
if (isInitializationStarted) return;
|
||||
isInitializationStarted = true;
|
||||
|
||||
// Pass reference to member Navigation to show bikes at station x dialog.
|
||||
try
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
|
||||
|
||||
#if TRYNOTBACKSTYLE
|
||||
MapPageViewModel = new MapPageViewModel();
|
||||
#else
|
||||
MapPageViewModel = CreateMapPageViewModel();
|
||||
#endif
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
BindingContext = MapPageViewModel;
|
||||
|
||||
#if USEFLYOUT
|
||||
MapPageViewModel.NavigationMasterDetail = NavigationMasterDetail;
|
||||
#endif
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.ForContext<MapPage>().Error("Setting binding/ navigaton on map page failed. {Exception}", exception);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ApplyCustomiOSStyling();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// Continue because styling is not essential.
|
||||
Log.ForContext<MapPage>().Error("IOS specific styling of map page failed. {Exception}", exception);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
base.OnAppearing();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// Continue because styling is not essential.
|
||||
Log.ForContext<MapPage>().Error("Invoking OnAppearing of base failed. {Exception}", exception);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Pre move and scanle maps to avoid initial display of map in Rome.
|
||||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
catch(Exception exception)
|
||||
{
|
||||
// Continue because a map not beeing moved/ scaled is no reason for aborting startup.
|
||||
Log.ForContext<MapPage>().Error("Moving and scaling map failed. {Exception}", exception);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Invoking OnAppearing on map page view model.");
|
||||
await MapPageViewModel.OnAppearing();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.ForContext<MapPage>().Error("Invoking OnAppearing on map page view model failed. {Exception}", exception);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Premoves the Map to a certain location.
|
||||
/// </summary>
|
||||
private void PremoveAndScaleMap()
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
|
||||
MapPageViewModel.MoveAndScale(
|
||||
(mapSpan) => MyMap.MoveToRegion(mapSpan),
|
||||
App.ModelRoot.MapSpan);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Creates the Map Page's view model.
|
||||
/// </summary>
|
||||
private MapPageViewModel CreateMapPageViewModel()
|
||||
{
|
||||
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
|
||||
return new MapPageViewModel(
|
||||
App.ModelRoot,
|
||||
App.PermissionsService,
|
||||
App.BluetoothService,
|
||||
App.GeolocationServicesContainer.Active,
|
||||
(mapspan) => MyMap.MoveToRegion(mapspan),
|
||||
this,
|
||||
Navigation);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Applies iOS specific styling to branded Buttons.
|
||||
/// </summary>
|
||||
private void ApplyCustomiOSStyling()
|
||||
{
|
||||
if (Device.RuntimePlatform == Device.iOS)
|
||||
{
|
||||
TINKButton.BackgroundColor = Color.LightGray;
|
||||
TINKButton.BorderColor = Color.Black;
|
||||
TINKButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
KonradButton.BackgroundColor = Color.LightGray;
|
||||
KonradButton.BorderColor = Color.Black;
|
||||
KonradButton.Margin = new Thickness(10, 10, 10, 10);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when pages is closed/ hidden.
|
||||
/// Stops update process.
|
||||
/// </summary>
|
||||
protected override async void OnDisappearing()
|
||||
{
|
||||
if (MapPageViewModel != null)
|
||||
{
|
||||
// View model might be null.
|
||||
await MapPageViewModel?.OnDisappearing();
|
||||
}
|
||||
base.OnDisappearing();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -551,39 +551,5 @@ namespace TINK.Model.Connector
|
|||
|
||||
return bookingFinished;
|
||||
}
|
||||
|
||||
/// <summary> Creates a survey object from response.</summary>
|
||||
/// <param name="response">Response to create survey object from.</param>
|
||||
public static MiniSurveyModel Create(this ReservationCancelReturnResponse response)
|
||||
{
|
||||
if (response?.user_miniquery == null)
|
||||
{
|
||||
return new MiniSurveyModel();
|
||||
}
|
||||
|
||||
var miniquery = response.user_miniquery;
|
||||
var survey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
|
||||
foreach (var question in miniquery?.questions?.OrderBy(x => x.Key) ?? new Dictionary<string, MiniSurveyResponse.Question>().OrderBy(x => x.Key))
|
||||
{
|
||||
if (string.IsNullOrEmpty(question.Key.Trim())
|
||||
|| question.Value.query == null)
|
||||
{
|
||||
// Skip invalid entries.
|
||||
continue;
|
||||
}
|
||||
|
||||
survey.Questions.Add(
|
||||
question.Key,
|
||||
new MiniSurveyModel.QuestionModel());
|
||||
}
|
||||
|
||||
return survey;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
589
TINKLib/Model/Connector/Updater/UpdaterJSON.cs.bak
Normal file
589
TINKLib/Model/Connector/Updater/UpdaterJSON.cs.bak
Normal file
|
@ -0,0 +1,589 @@
|
|||
using System;
|
||||
using TINK.Model.Bike;
|
||||
using TINK.Model.Station;
|
||||
using TINK.Repository.Response;
|
||||
using TINK.Model.User.Account;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Model.State;
|
||||
using TINK.Repository.Exception;
|
||||
using Serilog;
|
||||
|
||||
using BikeInfo = TINK.Model.Bike.BC.BikeInfo;
|
||||
using IBikeInfoMutable = TINK.Model.Bikes.Bike.BC.IBikeInfoMutable;
|
||||
using System.Globalization;
|
||||
using TINK.Model.Station.Operator;
|
||||
using Xamarin.Forms;
|
||||
using System.Linq;
|
||||
using TINK.Model.MiniSurvey;
|
||||
|
||||
namespace TINK.Model.Connector
|
||||
{
|
||||
/// <summary>
|
||||
/// Connects TINK app to copri using JSON as input data format.
|
||||
/// </summary>
|
||||
/// <todo>Rename to UpdateFromCopri.</todo>
|
||||
public static class UpdaterJSON
|
||||
{
|
||||
/// <summary> Loads a bike object from copri server cancel reservation/ booking update request.</summary>
|
||||
/// <param name="bike">Bike object to load response into.</param>
|
||||
/// <param name="notifyLevel">Controls whether notify property changed events are fired or not.</param>
|
||||
public static void Load(
|
||||
this IBikeInfoMutable bike,
|
||||
Bikes.Bike.BC.NotifyPropertyChangedLevel notifyLevel)
|
||||
{
|
||||
|
||||
bike.State.Load(InUseStateEnum.Disposable, notifyLevel: notifyLevel);
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets all statsion for station provider and add them into station list.
|
||||
/// </summary>
|
||||
/// <param name="p_oStationList">List of stations to update.</param>
|
||||
public static StationDictionary GetStationsAllMutable(this StationsAvailableResponse stationsAllResponse)
|
||||
{
|
||||
// Get stations from Copri/ file/ memory, ....
|
||||
if (stationsAllResponse == null
|
||||
|| stationsAllResponse.stations == null)
|
||||
{
|
||||
// Latest list of stations could not be retrieved from provider.
|
||||
return new StationDictionary();
|
||||
}
|
||||
|
||||
Version.TryParse(stationsAllResponse.copri_version, out Version copriVersion);
|
||||
|
||||
var stations = new StationDictionary(p_oVersion: copriVersion);
|
||||
|
||||
foreach (var station in stationsAllResponse.stations)
|
||||
{
|
||||
if (stations.GetById(station.Value.station) != null)
|
||||
{
|
||||
// Can not add station to list of station. Id is not unique.
|
||||
throw new InvalidResponseException<StationsAvailableResponse>(
|
||||
string.Format("Station id {0} is not unique.", station.Value.station), stationsAllResponse);
|
||||
}
|
||||
|
||||
stations.Add(new Station.Station(
|
||||
station.Value.station,
|
||||
station.Value.GetGroup(),
|
||||
station.Value.GetPosition(),
|
||||
station.Value.description,
|
||||
new Data(station.Value.operator_data?.operator_name,
|
||||
station.Value.operator_data?.operator_phone,
|
||||
station.Value.operator_data?.operator_hours,
|
||||
station.Value.operator_data?.operator_email,
|
||||
!string.IsNullOrEmpty(station.Value.operator_data?.operator_color)
|
||||
? Color.FromHex(station.Value.operator_data?.operator_color)
|
||||
: (Color?)null)));
|
||||
}
|
||||
|
||||
return stations;
|
||||
}
|
||||
|
||||
/// <summary> Gets account object from login response.</summary>
|
||||
/// <param name="merchantId">Needed to extract cookie from autorization response.</param>
|
||||
/// <param name="loginResponse">Response to get session cookie and debug level from.</param>
|
||||
/// <param name="mail">Mail address needed to construct a complete account object (is not part of response).</param>
|
||||
/// <param name="password">Password needed to construct a complete account object (is not part of response).</param>
|
||||
public static IAccount GetAccount(
|
||||
this AuthorizationResponse loginResponse,
|
||||
string merchantId,
|
||||
string mail,
|
||||
string password)
|
||||
{
|
||||
if (loginResponse == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(loginResponse));
|
||||
}
|
||||
|
||||
return new Account(
|
||||
mail,
|
||||
password,
|
||||
loginResponse.authcookie?.Replace(merchantId, ""),
|
||||
loginResponse.GetGroup(),
|
||||
loginResponse.debuglevel == 1
|
||||
? Permissions.All :
|
||||
(Permissions)loginResponse.debuglevel) ;
|
||||
}
|
||||
|
||||
/// <summary> Load bike object from booking response. </summary>
|
||||
/// <param name="bike">Bike object to load from response.</param>
|
||||
/// <param name="bikeInfo">Booking response.</param>
|
||||
/// <param name="mailAddress">Mail address of user which books bike.</param>
|
||||
/// <param name="p_strSessionCookie">Session cookie of user which books bike.</param>
|
||||
/// <param name="notifyLevel">Controls whether notify property changed events are fired or not.</param>
|
||||
public static void Load(
|
||||
this IBikeInfoMutable bike,
|
||||
BikeInfoReservedOrBooked bikeInfo,
|
||||
string mailAddress,
|
||||
Func<DateTime> dateTimeProvider,
|
||||
Bikes.Bike.BC.NotifyPropertyChangedLevel notifyLevel = Bikes.Bike.BC.NotifyPropertyChangedLevel.All)
|
||||
{
|
||||
|
||||
var l_oDateTimeProvider = dateTimeProvider != null
|
||||
? dateTimeProvider
|
||||
: () => DateTime.Now;
|
||||
|
||||
if (bike is Bike.BluetoothLock.BikeInfoMutable btBikeInfo)
|
||||
{
|
||||
btBikeInfo.LockInfo.Load(
|
||||
bikeInfo.GetBluetoothLockId(),
|
||||
bikeInfo.GetBluetoothLockGuid(),
|
||||
bikeInfo.GetSeed(),
|
||||
bikeInfo.GetUserKey(),
|
||||
bikeInfo.GetAdminKey());
|
||||
}
|
||||
|
||||
var l_oState = bikeInfo.GetState();
|
||||
switch (l_oState)
|
||||
{
|
||||
case InUseStateEnum.Disposable:
|
||||
bike.State.Load(
|
||||
InUseStateEnum.Disposable,
|
||||
notifyLevel: notifyLevel);
|
||||
break;
|
||||
|
||||
case InUseStateEnum.Reserved:
|
||||
bike.State.Load(
|
||||
InUseStateEnum.Reserved,
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.timeCode,
|
||||
notifyLevel);
|
||||
break;
|
||||
|
||||
case InUseStateEnum.Booked:
|
||||
bike.State.Load(
|
||||
InUseStateEnum.Booked,
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.timeCode,
|
||||
notifyLevel);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Exception(string.Format("Unexpected bike state detected. state is {0}.", l_oState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes available from copri server response.</summary>
|
||||
/// <param name="bikesAvailableResponse">Response to create collection from.</param>
|
||||
/// <returns>New collection of available bikes.</returns>
|
||||
public static BikeCollection GetBikesAvailable(
|
||||
this BikesAvailableResponse bikesAvailableResponse)
|
||||
{
|
||||
return GetBikesAll(
|
||||
bikesAvailableResponse,
|
||||
new BikesReservedOccupiedResponse(), // There are no occupied bikes.
|
||||
string.Empty,
|
||||
() => DateTime.Now);
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied from copri server response. </summary>
|
||||
/// <param name="p_oBikesAvailable">Response to create bikes from.</param>
|
||||
/// <returns>New collection of occupied bikes.</returns>
|
||||
public static BikeCollection GetBikesOccupied(
|
||||
this BikesReservedOccupiedResponse bikesOccupiedResponse,
|
||||
string mail,
|
||||
Func<DateTime> dateTimeProvider)
|
||||
{
|
||||
return GetBikesAll(
|
||||
new BikesAvailableResponse(),
|
||||
bikesOccupiedResponse,
|
||||
mail,
|
||||
dateTimeProvider);
|
||||
}
|
||||
|
||||
/// <summary> Gets bikes occupied from copri server response. </summary>
|
||||
/// <param name="p_oBikesAvailable">Response to create bikes from.</param>
|
||||
/// <returns>New collection of occupied bikes.</returns>
|
||||
public static BikeCollection GetBikesAll(
|
||||
BikesAvailableResponse bikesAvailableResponse,
|
||||
BikesReservedOccupiedResponse bikesOccupiedResponse,
|
||||
string mail,
|
||||
Func<DateTime> dateTimeProvider)
|
||||
{
|
||||
var bikesDictionary = new Dictionary<string, BikeInfo>();
|
||||
var duplicates = new Dictionary<string, BikeInfo>();
|
||||
|
||||
// Get bikes from Copri/ file/ memory, ....
|
||||
if (bikesAvailableResponse != null
|
||||
&& bikesAvailableResponse.bikes != null)
|
||||
{
|
||||
foreach (var bikeInfoResponse in bikesAvailableResponse.bikes.Values)
|
||||
{
|
||||
var bikeInfo = BikeInfoFactory.Create(bikeInfoResponse);
|
||||
if (bikeInfo == null)
|
||||
{
|
||||
// Response is not valid.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bikesDictionary.ContainsKey(bikeInfo.Id))
|
||||
{
|
||||
// Duplicates are not allowed.
|
||||
Log.Error($"Duplicate bike with id {bikeInfo.Id} detected evaluating bikes available. Bike status is {bikeInfo.State.Value}.");
|
||||
|
||||
if (!duplicates.ContainsKey(bikeInfo.Id))
|
||||
{
|
||||
duplicates.Add(bikeInfo.Id, bikeInfo);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
bikesDictionary.Add(bikeInfo.Id, bikeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Get bikes from Copri/ file/ memory, ....
|
||||
if (bikesOccupiedResponse != null
|
||||
&& bikesOccupiedResponse.bikes_occupied != null)
|
||||
{
|
||||
foreach (var bikeInfoResponse in bikesOccupiedResponse.bikes_occupied.Values)
|
||||
{
|
||||
BikeInfo bikeInfo = BikeInfoFactory.Create(
|
||||
bikeInfoResponse,
|
||||
mail,
|
||||
dateTimeProvider);
|
||||
|
||||
if (bikeInfo == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bikesDictionary.ContainsKey(bikeInfo.Id))
|
||||
{
|
||||
// Duplicates are not allowed.
|
||||
Log.Error($"Duplicate bike with id {bikeInfo.Id} detected evaluating bikes occupied. Bike status is {bikeInfo.State.Value}.");
|
||||
if (!duplicates.ContainsKey(bikeInfo.Id))
|
||||
{
|
||||
duplicates.Add(bikeInfo.Id, bikeInfo);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
bikesDictionary.Add(bikeInfo.Id, bikeInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove entries which are not unique.
|
||||
foreach (var l_oDuplicate in duplicates)
|
||||
{
|
||||
bikesDictionary.Remove(l_oDuplicate.Key);
|
||||
}
|
||||
|
||||
return new BikeCollection(bikesDictionary);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructs bike info instances/ bike info derived instances.
|
||||
/// </summary>
|
||||
public static class BikeInfoFactory
|
||||
{
|
||||
public static BikeInfo Create(BikeInfoAvailable bikeInfo)
|
||||
{
|
||||
if (bikeInfo.GetIsManualLockBike())
|
||||
{
|
||||
// Manual lock bikes are no more supported.
|
||||
Log.Error(
|
||||
$"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. " +
|
||||
"Manual lock bikes are no more supported." +
|
||||
$"Bike number: {bikeInfo.bike}{(bikeInfo.station != null ? $"station number {bikeInfo.station}" : string.Empty)}."
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
switch (bikeInfo.GetState())
|
||||
{
|
||||
case InUseStateEnum.Disposable:
|
||||
break;
|
||||
|
||||
default:
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. Unexpected state {bikeInfo.GetState()} detected.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(bikeInfo.station))
|
||||
{
|
||||
// Bike available must always have a station id because bikes can only be returned at a station.
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. No station info set.");
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return !bikeInfo.GetIsBluetoothLockBike()
|
||||
? new BikeInfo(
|
||||
bikeInfo.bike,
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription) null),
|
||||
#endif
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description)
|
||||
: new Bike.BluetoothLock.BikeInfo(
|
||||
bikeInfo.bike,
|
||||
bikeInfo.GetBluetoothLockId(),
|
||||
bikeInfo.GetBluetoothLockGuid(),
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription)null),
|
||||
#endif
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description);
|
||||
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
// Contructor reported invalid arguemts (missing lock id, ....).
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. Invalid response detected. Available bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Creates a bike info object from copri response. </summary>
|
||||
/// <param name="bikeInfo">Copri response. </param>
|
||||
/// <param name="mailAddress">Mail address of user.</param>
|
||||
/// <param name="dateTimeProvider">Date and time provider function.</param>
|
||||
/// <returns></returns>
|
||||
public static BikeInfo Create(
|
||||
BikeInfoReservedOrBooked bikeInfo,
|
||||
string mailAddress,
|
||||
Func<DateTime> dateTimeProvider)
|
||||
{
|
||||
if (bikeInfo.GetIsManualLockBike())
|
||||
{
|
||||
// Manual lock bikes are no more supported.
|
||||
Log.Error(
|
||||
$"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. " +
|
||||
"Manual lock bikes are no more supported." +
|
||||
$"Bike number: {bikeInfo.bike}{(bikeInfo.station != null ? $", station number {bikeInfo.station}" : string.Empty)}."
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
// Check if bike is a bluetooth lock bike.
|
||||
var isBluetoothBike = bikeInfo.GetIsBluetoothLockBike();
|
||||
int lockSerial = bikeInfo.GetBluetoothLockId();
|
||||
Guid lockGuid = bikeInfo.GetBluetoothLockGuid();
|
||||
|
||||
switch (bikeInfo.GetState())
|
||||
{
|
||||
case InUseStateEnum.Reserved:
|
||||
try
|
||||
{
|
||||
return !isBluetoothBike
|
||||
? new BikeInfo(
|
||||
bikeInfo.bike,
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description,
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription)null),
|
||||
#endif
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.timeCode,
|
||||
dateTimeProvider)
|
||||
: new Bike.BluetoothLock.BikeInfo(
|
||||
bikeInfo.bike,
|
||||
lockSerial,
|
||||
lockGuid,
|
||||
bikeInfo.GetUserKey(),
|
||||
bikeInfo.GetAdminKey(),
|
||||
bikeInfo.GetSeed(),
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription)null),
|
||||
#endif
|
||||
dateTimeProvider,
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
// Contructor reported invalid arguemts (missing lock id, ....).
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoReservedOrBooked)} argument. Invalid response detected. Reserved bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
|
||||
case InUseStateEnum.Booked:
|
||||
try
|
||||
{
|
||||
return !isBluetoothBike
|
||||
? new BikeInfo(
|
||||
bikeInfo.bike,
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description,
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription)null),
|
||||
#endif
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.timeCode)
|
||||
: new Bike.BluetoothLock.BikeInfo(
|
||||
bikeInfo.bike,
|
||||
lockSerial,
|
||||
bikeInfo.GetBluetoothLockGuid(),
|
||||
bikeInfo.GetUserKey(),
|
||||
bikeInfo.GetAdminKey(),
|
||||
bikeInfo.GetSeed(),
|
||||
bikeInfo.GetFrom(),
|
||||
mailAddress,
|
||||
bikeInfo.station,
|
||||
bikeInfo.GetOperatorUri(),
|
||||
#if !NOTARIFFDESCRIPTION
|
||||
Create(bikeInfo.tariff_description),
|
||||
#else
|
||||
Create((TINK.Repository.Response.TariffDescription)null),
|
||||
#endif
|
||||
bikeInfo.GetIsDemo(),
|
||||
bikeInfo.GetGroup(),
|
||||
bikeInfo.GetWheelType(),
|
||||
bikeInfo.GetTypeOfBike(),
|
||||
bikeInfo.description);
|
||||
}
|
||||
catch (ArgumentException ex)
|
||||
{
|
||||
// Contructor reported invalid arguemts (missing lock id, ....).
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoReservedOrBooked)} argument. Invalid response detected. Booked bike with id {bikeInfo.bike} skipped. {ex.Message}");
|
||||
return null;
|
||||
}
|
||||
|
||||
default:
|
||||
Log.Error($"Can not create new {nameof(BikeInfo)}-object from {nameof(BikeInfoAvailable)} argument. Unexpected state {bikeInfo.GetState()} detected.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Bikes.Bike.TariffDescription Create(this TariffDescription tariffDesciption)
|
||||
{
|
||||
return new Bikes.Bike.TariffDescription
|
||||
{
|
||||
Name = tariffDesciption?.name,
|
||||
#if USCSHARP9
|
||||
Number = int.TryParse(tariffDesciption?.number, out int number) ? number : null,
|
||||
#else
|
||||
Number = int.TryParse(tariffDesciption?.number, out int number) ? number : (int?) null,
|
||||
#endif
|
||||
FreeTimePerSession = double.TryParse(tariffDesciption?.free_hours, NumberStyles.Any, CultureInfo.InvariantCulture, out double freeHours) ? TimeSpan.FromHours(freeHours) : TimeSpan.Zero,
|
||||
FeeEuroPerHour = double.TryParse(tariffDesciption?.eur_per_hour, NumberStyles.Any, CultureInfo.InvariantCulture, out double euroPerHour) ? euroPerHour : double.NaN,
|
||||
AboEuroPerMonth = double.TryParse(tariffDesciption?.abo_eur_per_month, NumberStyles.Any, CultureInfo.InvariantCulture, out double aboEuroPerMonth) ? aboEuroPerMonth : double.NaN,
|
||||
MaxFeeEuroPerDay = double.TryParse(tariffDesciption?.max_eur_per_day, NumberStyles.Any, CultureInfo.InvariantCulture, out double maxEuroPerDay) ? maxEuroPerDay : double.NaN,
|
||||
OperatorAgb = tariffDesciption?.operator_agb,
|
||||
TrackingInfo = tariffDesciption?.track_info
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary> Creates a booking finished object from response.</summary>
|
||||
/// <param name="response">Response to create survey object from.</param>
|
||||
public static BookingFinishedModel Create(this DoReturnResponse response)
|
||||
{
|
||||
var bookingFinished = new BookingFinishedModel
|
||||
{
|
||||
Co2Saving = response?.co2saving
|
||||
};
|
||||
|
||||
if (response?.user_miniquery == null)
|
||||
|
||||
{
|
||||
return bookingFinished;
|
||||
}
|
||||
|
||||
var miniquery = response.user_miniquery;
|
||||
bookingFinished.MiniSurvey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
|
||||
foreach (var question in miniquery?.questions?.OrderBy(x => x.Key) ?? new Dictionary<string, MiniSurveyResponse.Question>().OrderBy(x => x.Key))
|
||||
{
|
||||
if (string.IsNullOrEmpty(question.Key.Trim())
|
||||
|| question.Value.query == null)
|
||||
{
|
||||
// Skip invalid entries.
|
||||
continue;
|
||||
}
|
||||
|
||||
bookingFinished.MiniSurvey.Questions.Add(
|
||||
question.Key,
|
||||
new MiniSurveyModel.QuestionModel());
|
||||
}
|
||||
|
||||
return bookingFinished;
|
||||
}
|
||||
|
||||
/// <summary> Creates a survey object from response.</summary>
|
||||
/// <param name="response">Response to create survey object from.</param>
|
||||
public static MiniSurveyModel Create(this ReservationCancelReturnResponse response)
|
||||
{
|
||||
if (response?.user_miniquery == null)
|
||||
{
|
||||
return new MiniSurveyModel();
|
||||
}
|
||||
|
||||
var miniquery = response.user_miniquery;
|
||||
var survey = new MiniSurveyModel
|
||||
{
|
||||
Title = miniquery.title,
|
||||
Subtitle = miniquery.subtitle,
|
||||
Footer = miniquery.footer
|
||||
};
|
||||
|
||||
foreach (var question in miniquery?.questions?.OrderBy(x => x.Key) ?? new Dictionary<string, MiniSurveyResponse.Question>().OrderBy(x => x.Key))
|
||||
{
|
||||
if (string.IsNullOrEmpty(question.Key.Trim())
|
||||
|| question.Value.query == null)
|
||||
{
|
||||
// Skip invalid entries.
|
||||
continue;
|
||||
}
|
||||
|
||||
survey.Questions.Add(
|
||||
question.Key,
|
||||
new MiniSurveyModel.QuestionModel());
|
||||
}
|
||||
|
||||
return survey;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ using System.Threading;
|
|||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using Plugin.Permissions.Abstractions;
|
||||
using TINK.Services.BluetoothLock.Crypto;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
|
@ -155,6 +156,7 @@ namespace TINK.Model
|
|||
ISmartDevice device,
|
||||
ISpecialFolder specialFolder,
|
||||
ICipher cipher,
|
||||
IPermissions permissions = null,
|
||||
object arendiCentral = null,
|
||||
Func<bool> isConnectedFunc = null,
|
||||
Action<SendOrPostCallback, object> postAction = null,
|
||||
|
|
419
TINKLib/Model/TinkApp.cs.bak
Normal file
419
TINKLib/Model/TinkApp.cs.bak
Normal file
|
@ -0,0 +1,419 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using TINK.Model.Connector;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Settings;
|
||||
using TINK.Model.User.Account;
|
||||
using TINK.Model.Settings;
|
||||
using TINK.Model.Logging;
|
||||
using Serilog.Events;
|
||||
using Serilog.Core;
|
||||
using Serilog;
|
||||
using Plugin.Connectivity;
|
||||
using System.Threading;
|
||||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TINK.Model.Services.CopriApi.ServerUris;
|
||||
using TINK.Services.BluetoothLock.Crypto;
|
||||
using TINK.ViewModel.Map;
|
||||
using TINK.ViewModel.Settings;
|
||||
using TINK.Services;
|
||||
using TINK.Services.BluetoothLock.BLE;
|
||||
using Xamarin.Forms;
|
||||
using TINK.Model.Station;
|
||||
|
||||
namespace TINK.Model
|
||||
{
|
||||
[DataContract]
|
||||
public class TinkApp : ITinkApp
|
||||
{
|
||||
/// <summary> Delegate used by login view to commit user name and password. </summary>
|
||||
/// <param name="p_strMailAddress">Mail address used as id login.</param>
|
||||
/// <param name="p_strPassword">Password for login.</param>
|
||||
/// <returns>True if setting credentials succeeded.</returns>
|
||||
public delegate bool SetCredentialsDelegate(string p_strMailAddress, string p_strPassword);
|
||||
|
||||
/// <summary>Returns the id of the app (sharee.bike) to be identified by copri.</summary>
|
||||
public static string MerchantId => "oiF2kahH";
|
||||
|
||||
/// <summary>
|
||||
/// Holds status about whants new page.
|
||||
/// </summary>
|
||||
public WhatsNew WhatsNew { get; private set; }
|
||||
|
||||
/// <summary>Sets flag whats new page was already shown to true. </summary>
|
||||
public void SetWhatsNewWasShown() => WhatsNew = WhatsNew.SetWasShown();
|
||||
|
||||
/// <summary>Holds uris of copri servers. </summary>
|
||||
public CopriServerUriList Uris { get; }
|
||||
|
||||
/// <summary> Holds the filters loaded from settings. </summary>
|
||||
public IGroupFilterSettings FilterGroupSetting { get; set; }
|
||||
|
||||
/// <summary> Holds the filter which is applied on the map view. Either TINK or Konrad stations are displayed. </summary>
|
||||
private IGroupFilterMapPage m_oFilterDictionaryMapPage;
|
||||
|
||||
/// <summary> Holds the filter which is applied on the map view. Either TINK or Konrad stations are displayed. </summary>
|
||||
public IGroupFilterMapPage GroupFilterMapPage
|
||||
{
|
||||
get => m_oFilterDictionaryMapPage;
|
||||
set => m_oFilterDictionaryMapPage = value ?? new GroupFilterMapPage();
|
||||
}
|
||||
|
||||
/// <summary> Value indicating whether map is centerted to current position or not. </summary>
|
||||
public bool CenterMapToCurrentLocation { get; set; }
|
||||
|
||||
/// <summary> Holds the map area to display. </summary>
|
||||
public Xamarin.Forms.GoogleMaps.MapSpan MapSpan { get; set; }
|
||||
|
||||
/// <summary> Gets the minimum logging level. </summary>
|
||||
public LogEventLevel MinimumLogEventLevel { get; set; }
|
||||
|
||||
/// <summary> Gets a value indicating whether reporting level is verbose or not.</summary>
|
||||
public bool IsReportLevelVerbose { get; set; }
|
||||
|
||||
/// <summary> Holds the uri which is applied after restart. </summary>
|
||||
public Uri NextActiveUri { get; set; }
|
||||
|
||||
/// <summary> Saves object to file. </summary>
|
||||
public void Save()
|
||||
=> JsonSettingsDictionary.Serialize(
|
||||
SettingsFileFolder,
|
||||
new Dictionary<string, string>()
|
||||
.SetGroupFilterMapPage(GroupFilterMapPage)
|
||||
.SetCopriHostUri(NextActiveUri.AbsoluteUri)
|
||||
.SetPollingParameters(Polling)
|
||||
.SetGroupFilterSettings(FilterGroupSetting)
|
||||
.SetAppVersion(AppVersion)
|
||||
.SetMinimumLoggingLevel(MinimumLogEventLevel)
|
||||
.SetIsReportLevelVerbose(IsReportLevelVerbose)
|
||||
.SetExpiresAfter(ExpiresAfter)
|
||||
.SetWhatsNew(AppVersion)
|
||||
.SetActiveLockService(LocksServices.Active.GetType().FullName)
|
||||
.SetActiveGeolocationService(GeolocationServices.Active.GetType().FullName)
|
||||
.SetCenterMapToCurrentLocation(CenterMapToCurrentLocation)
|
||||
.SetLogToExternalFolder(LogToExternalFolder)
|
||||
.SetConnectTimeout(LocksServices.Active.TimeOut.MultiConnect)
|
||||
.SetIsSiteCachingOn(IsSiteCachingOn)
|
||||
.SetActiveTheme(Themes.Active.GetType().FullName));
|
||||
|
||||
/// <summary>
|
||||
/// Update connector from filters when
|
||||
/// - login state changes
|
||||
/// - view is toggled (TINK to Kornrad and vice versa)
|
||||
/// </summary>
|
||||
public void UpdateConnector()
|
||||
{
|
||||
// Create filtered connector.
|
||||
m_oConnector = FilteredConnectorFactory.Create(
|
||||
FilterGroupSetting.DoFilter(ActiveUser.DoFilter(GroupFilterMapPage.DoFilter())),
|
||||
m_oConnector.Connector);
|
||||
}
|
||||
|
||||
/// <summary>Polling periode.</summary>
|
||||
public PollingParameters Polling { get; set; }
|
||||
|
||||
public TimeSpan ExpiresAfter { get; set; }
|
||||
|
||||
/// <summary> Holds the version of the app.</summary>
|
||||
public Version AppVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Holds the default polling value.
|
||||
/// </summary>
|
||||
#if USCSHARP9
|
||||
public TimeSpan DefaultPolling => new (0, 0, 10);
|
||||
#else
|
||||
public TimeSpan DefaultPolling => new TimeSpan(0, 0, 10);
|
||||
#endif
|
||||
|
||||
/// <summary> Constructs TinkApp object. </summary>
|
||||
/// <param name="settings"></param>
|
||||
/// <param name="accountStore"></param>
|
||||
/// <param name="passwordValidator"></param>
|
||||
/// <param name="p_oConnectorFactory"></param>
|
||||
/// <param name="geolocationService">Null in productive context. Service to querry geoloation for testing purposes. Parameter can be made optional.</param>
|
||||
/// <param name="locksService">Null in productive context. Service to control locks/ get locks information for testing proposes. Parameter can be made optional.</param>
|
||||
/// <param name="device">Object allowing platform specific operations.</param>
|
||||
/// <param name="specialFolder"></param>
|
||||
/// <param name="p_oDateTimeProvider"></param>
|
||||
/// <param name="isConnectedFunc">True if connector has access to copri server, false if cached values are used.</param>
|
||||
/// <param name="currentVersion">Version of the app. If null version is set to a fixed dummy value (3.0.122) for testing purposes.</param>
|
||||
/// <param name="lastVersion">Version of app which was used before this session.</param>
|
||||
/// <param name="whatsNewShownInVersion"> Holds
|
||||
/// - the version when whats new info was shown last or
|
||||
/// - version of application used last if whats new functionality was not implemented in this version or
|
||||
/// - null if app is installed for the first time.
|
||||
/// /// </param>
|
||||
public TinkApp(
|
||||
Settings.Settings settings,
|
||||
IStore accountStore,
|
||||
Func<bool, Uri, string /* session cookie*/, string /* mail address*/, TimeSpan, IConnector> connectorFactory,
|
||||
IServicesContainer<IGeolocation> geolocationServicesContainer,
|
||||
ILocksService locksService,
|
||||
ISmartDevice device,
|
||||
ISpecialFolder specialFolder,
|
||||
ICipher cipher,
|
||||
object arendiCentral = null,
|
||||
Func<bool> isConnectedFunc = null,
|
||||
Action<SendOrPostCallback, object> postAction = null,
|
||||
Version currentVersion = null,
|
||||
Version lastVersion = null,
|
||||
Version whatsNewShownInVersion = null)
|
||||
{
|
||||
PostAction = postAction
|
||||
?? ((d, obj) => d(obj));
|
||||
|
||||
ConnectorFactory = connectorFactory
|
||||
?? throw new ArgumentException("Can not instantiate TinkApp- object. No connector factory object available.");
|
||||
|
||||
Cipher = cipher ?? new Cipher();
|
||||
|
||||
var locksServices = locksService != null
|
||||
? new HashSet<ILocksService> { locksService }
|
||||
: new HashSet<ILocksService> {
|
||||
new LockItByScanServiceEventBased(Cipher),
|
||||
new LockItByScanServicePolling(Cipher),
|
||||
new LockItByGuidService(Cipher),
|
||||
#if BLUETOOTHLE // Requires LockItBluetoothle library.
|
||||
new Bluetoothle.LockItByGuidService(Cipher),
|
||||
#endif
|
||||
#if ARENDI // Requires LockItArendi library.
|
||||
new Arendi.LockItByGuidService(Cipher, arendiCentral),
|
||||
new Arendi.LockItByScanService(Cipher, arendiCentral),
|
||||
#endif
|
||||
new LocksServiceInReach(),
|
||||
new LocksServiceOutOfReach(),
|
||||
};
|
||||
|
||||
LocksServices = new LocksServicesContainerMutable(
|
||||
lastVersion >= new Version(3, 0, 173) ? settings.ActiveLockService : LocksServicesContainerMutable.DefaultLocksservice,
|
||||
locksServices);
|
||||
|
||||
LocksServices.SetTimeOut(settings.ConnectTimeout);
|
||||
|
||||
Themes = new ServicesContainerMutable<object>(
|
||||
new HashSet<object> {
|
||||
new Themes.Konrad(),
|
||||
new Themes.ShareeBike(),
|
||||
new Themes.LastenradBayern()
|
||||
},
|
||||
settings.ActiveTheme);
|
||||
|
||||
GeolocationServices = geolocationServicesContainer
|
||||
?? throw new ArgumentException($"Can not instantiate {nameof(TinkApp)}- object. No geolocation services container object available.");
|
||||
|
||||
FilterGroupSetting = settings.GroupFilterSettings;
|
||||
GroupFilterMapPage = settings.GroupFilterMapPage;
|
||||
|
||||
CenterMapToCurrentLocation = settings.CenterMapToCurrentLocation;
|
||||
|
||||
MapSpan = settings.MapSpan;
|
||||
|
||||
SmartDevice = device
|
||||
?? throw new ArgumentException("Can not instantiate TinkApp- object. No device information provider available.");
|
||||
|
||||
if (specialFolder == null)
|
||||
{
|
||||
throw new ArgumentException("Can not instantiate TinkApp- object. No special folder provider available.");
|
||||
}
|
||||
|
||||
// Set logging level.
|
||||
Level.MinimumLevel = settings.MinimumLogEventLevel;
|
||||
|
||||
LogToExternalFolder = settings.LogToExternalFolder;
|
||||
|
||||
IsSiteCachingOn = settings.IsSiteCachingOn;
|
||||
|
||||
ExternalFolder = specialFolder.GetExternalFilesDir();
|
||||
|
||||
SettingsFileFolder = specialFolder.GetInternalPersonalDir();
|
||||
|
||||
ActiveUser = new User.User(
|
||||
accountStore.GetType().Name == "StoreLegacy" ? new Store() : accountStore,
|
||||
accountStore.Load().Result,
|
||||
device.Identifier);
|
||||
|
||||
this.isConnectedFunc = isConnectedFunc ?? (() => CrossConnectivity.Current.IsConnected);
|
||||
|
||||
ExpiresAfter = settings.ExpiresAfter;
|
||||
|
||||
// Create filtered connector for offline mode.
|
||||
m_oConnector = FilteredConnectorFactory.Create(
|
||||
FilterGroupSetting.DoFilter(GroupFilterMapPage.DoFilter()),
|
||||
ConnectorFactory(GetIsConnected(), settings.ActiveUri, ActiveUser.SessionCookie, ActiveUser.Mail, ExpiresAfter));
|
||||
|
||||
// Get uris from file.
|
||||
// Initialize all settings to defaults
|
||||
// Process uris.
|
||||
Uris = new CopriServerUriList(settings.ActiveUri);
|
||||
|
||||
NextActiveUri = Uris.ActiveUri;
|
||||
|
||||
Polling = settings.PollingParameters ??
|
||||
throw new ArgumentException("Can not instantiate TinkApp- object. Polling parameters must never be null.");
|
||||
|
||||
AppVersion = currentVersion ?? new Version(3, 0, 122);
|
||||
|
||||
MinimumLogEventLevel = settings.MinimumLogEventLevel;
|
||||
|
||||
IsReportLevelVerbose = settings.IsReportLevelVerbose;
|
||||
|
||||
WhatsNew = new WhatsNew(AppVersion, lastVersion, whatsNewShownInVersion);
|
||||
|
||||
if (Themes.Active.GetType().FullName == typeof(Themes.ShareeBike).FullName)
|
||||
{
|
||||
// Nothing to do.
|
||||
// Theme to activate is default theme.
|
||||
return;
|
||||
}
|
||||
|
||||
// Set active app theme
|
||||
ICollection<ResourceDictionary> mergedDictionaries = Application.Current.Resources.MergedDictionaries;
|
||||
if (mergedDictionaries == null)
|
||||
{
|
||||
Log.ForContext<TinkApp>().Error("No merged dictionary available.");
|
||||
return;
|
||||
}
|
||||
|
||||
mergedDictionaries.Clear();
|
||||
|
||||
if (Themes.Active.GetType().FullName == typeof(Themes.Konrad).FullName)
|
||||
{
|
||||
mergedDictionaries.Add(new Themes.Konrad());
|
||||
}
|
||||
else if (Themes.Active.GetType().FullName == typeof(Themes.LastenradBayern).FullName)
|
||||
{
|
||||
mergedDictionaries.Add(new Themes.LastenradBayern());
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.ForContext<TinkApp>().Debug($"No theme {Themes.Active} found.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Holds the user of the app. </summary>
|
||||
[DataMember]
|
||||
public User.User ActiveUser { get; }
|
||||
|
||||
/// <summary> Reference of object which provides device information. </summary>
|
||||
public ISmartDevice SmartDevice { get; }
|
||||
|
||||
/// <summary> Holds delegate to determine whether device is connected or not.</summary>
|
||||
private readonly Func<bool> isConnectedFunc;
|
||||
|
||||
/// <summary> Gets whether device is connected to internet or not. </summary>
|
||||
public bool GetIsConnected() => isConnectedFunc();
|
||||
|
||||
/// <summary> Holds the folder where settings files are stored. </summary>
|
||||
public string SettingsFileFolder { get; }
|
||||
|
||||
/// <summary> Holds folder parent of the folder where log files are stored. </summary>
|
||||
public string LogFileParentFolder => LogToExternalFolder && !string.IsNullOrEmpty(ExternalFolder) ? ExternalFolder : SettingsFileFolder;
|
||||
|
||||
/// <summary> Holds a value indicating whether to log to external or internal folder. </summary>
|
||||
public bool LogToExternalFolder { get; set; }
|
||||
|
||||
/// <summary> Holds a value indicating whether Site caching is on or off. </summary>
|
||||
public bool IsSiteCachingOn { get; set; }
|
||||
|
||||
/// <summary> External folder. </summary>
|
||||
public string ExternalFolder { get; }
|
||||
|
||||
public ICipher Cipher { get; }
|
||||
|
||||
/// <summary> Name of the station which is selected. </summary>
|
||||
public IStation SelectedStation { get; set; } = new NullStation();
|
||||
|
||||
/// <summary> Holds the stations availalbe. </summary>
|
||||
public IEnumerable<IStation> Stations { get; set; } = new List<Station.Station>();
|
||||
|
||||
/// <summary> Action to post to GUI thread.</summary>
|
||||
public Action<SendOrPostCallback, object> PostAction { get; }
|
||||
|
||||
/// <summary> Function which creates a connector depending on connected status.</summary>
|
||||
private Func<bool, Uri, string /*userAgent*/, string /*sessionCookie*/, TimeSpan, IConnector> ConnectorFactory { get; }
|
||||
|
||||
/// <summary> Holds the object which provides offline data.</summary>
|
||||
private IFilteredConnector m_oConnector;
|
||||
|
||||
/// <summary> Holds the system to copri.</summary>
|
||||
public IFilteredConnector GetConnector(bool isConnected)
|
||||
{
|
||||
if (m_oConnector.IsConnected == isConnected
|
||||
&& m_oConnector.Command.SessionCookie == ActiveUser.SessionCookie)
|
||||
{
|
||||
// Neither connection nor logged in stated changed.
|
||||
return m_oConnector;
|
||||
}
|
||||
|
||||
// Connected state changed. New connection object has to be created.
|
||||
m_oConnector = FilteredConnectorFactory.Create(
|
||||
FilterGroupSetting.DoFilter(ActiveUser.DoFilter(GroupFilterMapPage.DoFilter())),
|
||||
ConnectorFactory(
|
||||
isConnected,
|
||||
Uris.ActiveUri,
|
||||
ActiveUser.SessionCookie,
|
||||
ActiveUser.Mail,
|
||||
ExpiresAfter));
|
||||
|
||||
return m_oConnector;
|
||||
}
|
||||
|
||||
/// <summary> Manages the different types of LocksService objects.</summary>
|
||||
public LocksServicesContainerMutable LocksServices { get; set; }
|
||||
|
||||
/// <summary> Holds available app themes.</summary>
|
||||
public IServicesContainer<IGeolocation> GeolocationServices { get; }
|
||||
|
||||
/// <summary> Manages the different types of LocksService objects.</summary>
|
||||
public ServicesContainerMutable<object> Themes { get; }
|
||||
|
||||
/// <summary> Object to switch logging level. </summary>
|
||||
private LoggingLevelSwitch m_oLoggingLevelSwitch;
|
||||
|
||||
/// <summary>
|
||||
/// Object to allow swithing logging level
|
||||
/// </summary>
|
||||
public LoggingLevelSwitch Level
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_oLoggingLevelSwitch == null)
|
||||
{
|
||||
m_oLoggingLevelSwitch = new LoggingLevelSwitch
|
||||
{
|
||||
|
||||
// Set warning level to error.
|
||||
MinimumLevel = Settings.Settings.DEFAULTLOGGINLEVEL
|
||||
};
|
||||
}
|
||||
|
||||
return m_oLoggingLevelSwitch;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary> Updates logging level. </summary>
|
||||
/// <param name="p_oNewLevel">New level to set.</param>
|
||||
public void UpdateLoggingLevel(LogEventLevel p_oNewLevel)
|
||||
{
|
||||
if (Level.MinimumLevel == p_oNewLevel)
|
||||
{
|
||||
// Nothing to do.
|
||||
return;
|
||||
}
|
||||
|
||||
Log.CloseAndFlush(); // Close before modifying logger configuration. Otherwise a sharing vialation occurs.
|
||||
|
||||
Level.MinimumLevel = p_oNewLevel;
|
||||
|
||||
// Update logging
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.ControlledBy(Level)
|
||||
.WriteTo.Debug()
|
||||
.WriteTo.File(LogFileParentFolder, Logging.RollingInterval.Session)
|
||||
.CreateLogger();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,8 +7,5 @@ namespace TINK.Repository.Response
|
|||
/// </summary>
|
||||
public class ReservationCancelReturnResponse : BikesReservedOccupiedResponse
|
||||
{
|
||||
/// <summary> Mini survey.</summary>
|
||||
[DataMember]
|
||||
public MiniSurveyResponse user_miniquery { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
|
||||
namespace TINK.Repository.Response
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds the information about a cancel booking request and is used for deserialization of copri answer.
|
||||
/// </summary>
|
||||
public class ReservationCancelReturnResponse : BikesReservedOccupiedResponse
|
||||
{
|
||||
/// <summary> Mini survey.</summary>
|
||||
[DataMember]
|
||||
public MiniSurveyResponse user_miniquery { get; private set; }
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@
|
|||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Plugin.BLE" Version="2.1.2" />
|
||||
<PackageReference Include="Plugin.BluetoothLE" Version="6.3.0.19" />
|
||||
<PackageReference Include="Plugin.Permissions" Version="6.0.1" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
|
|
74
TINKLib/TINKLib.csproj.bak
Normal file
74
TINKLib/TINKLib.csproj.bak
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup Label="MultilingualAppToolkit">
|
||||
<MultilingualAppToolkitVersion>4.0</MultilingualAppToolkitVersion>
|
||||
<MultilingualFallbackLanguage>en-GB</MultilingualFallbackLanguage>
|
||||
<TranslationReport Condition="'$(Configuration)' == 'Release'">true</TranslationReport>
|
||||
<SuppressPseudoWarning Condition="'$(Configuration)' == 'Debug'">true</SuppressPseudoWarning>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<RootNamespace>TINK</RootNamespace>
|
||||
<ReleaseVersion>3.0</ReleaseVersion>
|
||||
<NeutralLanguage>en-GB</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;USEFLYOUT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
<DefineConstants>TRACE;USEFLYOUT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets" Label="MultilingualAppToolkit" Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\v$(MultilingualAppToolkitVersion)\Microsoft.Multilingual.ResxResources.targets')" />
|
||||
<Target Name="MATPrerequisite" BeforeTargets="PrepareForBuild" Condition="!Exists('$(MSBuildExtensionsPath)\Microsoft\Multilingual App Toolkit\Microsoft.Multilingual.ResxResources.targets')" Label="MultilingualAppToolkit">
|
||||
<Warning Text="$(MSBuildProjectFile) is Multilingual build enabled, but the Multilingual App Toolkit is unavailable during the build. If building with Visual Studio, please check to ensure that toolkit is properly installed." />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MonkeyCache" Version="1.5.2" />
|
||||
<PackageReference Include="MonkeyCache.FileStore" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Plugin.BLE" Version="2.1.2" />
|
||||
<PackageReference Include="Plugin.BluetoothLE" Version="6.3.0.19" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<PackageReference Include="System.Collections" Version="4.3.0" />
|
||||
<PackageReference Include="System.Net.Http" Version="4.3.4" />
|
||||
<PackageReference Include="System.Net.Primitives" Version="4.3.1" />
|
||||
<PackageReference Include="System.Net.Sockets" Version="4.3.0" />
|
||||
<PackageReference Include="System.Private.DataContractSerialization" Version="4.3.0" />
|
||||
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
|
||||
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
|
||||
<PackageReference Include="System.Xml.XDocument" Version="4.3.0" />
|
||||
<PackageReference Include="Xam.Plugin.Connectivity" Version="3.2.0" />
|
||||
<PackageReference Include="Xam.Plugins.Messaging" Version="5.2.0" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
|
||||
<PackageReference Include="Xamarin.Forms.GoogleMaps" Version="3.3.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Update="NETStandard.Library" Version="2.0.3" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Services\Permissions\Essentials\" />
|
||||
<Folder Include="Services\Permissions\Plugin\" />
|
||||
<Folder Include="ViewModel\Info\BikeInfo\" />
|
||||
<Folder Include="ViewModel\FeesAndBikes\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LockItBLE\LockItBLE.csproj" />
|
||||
<ProjectReference Include="..\LockItShared\LockItShared.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="MultilingualResources\AppResources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>AppResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="MultilingualResources\AppResources.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -207,7 +207,7 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
var l_oPin = new Pin
|
||||
{
|
||||
|
||||
|
||||
Position = new Xamarin.Forms.GoogleMaps.Position(station.Position.Latitude, station.Position.Longitude),
|
||||
Label = long.TryParse(station.Id, out long stationId) && stationId > CUSTOM_ICONS_COUNT
|
||||
? station.GetStationName()
|
||||
|
@ -231,13 +231,13 @@ namespace TINK.ViewModel.Map
|
|||
for (int pinIndex = 0; pinIndex < stationsColorList.Count; pinIndex++)
|
||||
{
|
||||
|
||||
var indexPartPrefix = int.TryParse(Pins[pinIndex].Tag.ToString(), out int stationId)
|
||||
var indexPartPrefix = int.TryParse(Pins[pinIndex].Tag.ToString(), out int stationId)
|
||||
&& stationId <= CUSTOM_ICONS_COUNT
|
||||
? $"{stationId}" // there is a station marker with index letter for given station id
|
||||
: "Open"; // there is no station marker. Use open marker.
|
||||
|
||||
var colorPartPrefix = GetRessourceNameColorPart(stationsColorList[pinIndex]);
|
||||
|
||||
|
||||
var l_iName = $"{indexPartPrefix.ToString().PadLeft(2, '0')}_{colorPartPrefix}{(DeviceInfo.Platform == DevicePlatform.Android ? ".png" : string.Empty)}";
|
||||
try
|
||||
{
|
||||
|
@ -292,7 +292,7 @@ namespace TINK.ViewModel.Map
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when page is shown.
|
||||
/// Invoked when page is shown.
|
||||
/// Starts update process.
|
||||
/// </summary>
|
||||
/// <param name="p_oFilterDictionaryMapPage">Holds map page filter settings.</param>
|
||||
|
@ -307,10 +307,10 @@ namespace TINK.ViewModel.Map
|
|||
Polling = TinkApp.Polling;
|
||||
|
||||
Log.ForContext<MapPageViewModel>().Information(
|
||||
$"{(Polling != null && Polling.IsActivated ? $"Map page is appearing. Update periode is {Polling.Periode.TotalSeconds} sec." : "Map page is appearing. Polling is off.")}" +
|
||||
$"{(Polling != null && Polling.IsActivated ? $"Map page is appearing. Update periode is {Polling.Periode.TotalSeconds} sec." : "Map page is appearing. Polling is off.")}" +
|
||||
$"Current UI language is {Thread.CurrentThread.CurrentUICulture.Name}.");
|
||||
|
||||
// Update map page filter
|
||||
// Update map page filter
|
||||
ActiveFilterMap = TinkApp.GroupFilterMapPage;
|
||||
|
||||
ActionText = AppResources.ActivityTextRequestingLocationPermissions;
|
||||
|
@ -383,9 +383,19 @@ namespace TINK.ViewModel.Map
|
|||
string.Format(AppResources.MessageAppVersionIsOutdated, ContactPageViewModel.GetAppName(TinkApp.Uris.ActiveUri)),
|
||||
AppResources.MessageAnswerOk);
|
||||
|
||||
Result<StationsAndBikesContainer> resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();
|
||||
Log.ForContext<MapPageViewModel>().Error($"Outdated version of app detected. Version expected is {resultStationsAndBikes.Response.StationsAll.CopriVersion}.");
|
||||
}
|
||||
|
||||
TinkApp.Stations = resultStationsAndBikes.Response.StationsAll;
|
||||
// Set pins to their positions on map.
|
||||
InitializePins(resultStationsAndBikes.Response.StationsAll);
|
||||
|
||||
Log.ForContext<MapPageViewModel>().Verbose("Update of pins done.");
|
||||
}
|
||||
|
||||
|
||||
if (resultStationsAndBikes.Exception?.GetType() == typeof(AuthcookieNotDefinedException))
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Map page is shown (probable for the first time after startup of app) and COPRI auth cookie is not defined. {@l_oException}", resultStationsAndBikes.Exception);
|
||||
|
||||
// COPRI reports an auth cookie error.
|
||||
await ViewService.DisplayAlert(
|
||||
|
@ -393,6 +403,9 @@ namespace TINK.ViewModel.Map
|
|||
AppResources.MessageMapPageErrorAuthcookieUndefined,
|
||||
AppResources.MessageAnswerOk);
|
||||
|
||||
await TinkApp.GetConnector(IsConnected).Command.DoLogout();
|
||||
TinkApp.ActiveUser.Logout();
|
||||
}
|
||||
|
||||
// Update pin colors.
|
||||
Log.ForContext<MapPageViewModel>().Verbose("Starting update pins color...");
|
||||
|
@ -431,12 +444,6 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
Log.ForContext<MapPageViewModel>().Verbose("Update pins color done.");
|
||||
|
||||
// Move and scale before getting stations and bikes which takes some time.
|
||||
ActionText = AppResources.ActivityTextCenterMap;
|
||||
await MoveMapToCurrentPositionOfUser(status);
|
||||
|
||||
m_oViewUpdateManager = CreateUpdateTask();
|
||||
|
||||
try
|
||||
{
|
||||
// Update bikes at station or my bikes depending on context.
|
||||
|
@ -510,7 +517,7 @@ namespace TINK.ViewModel.Map
|
|||
Log.ForContext<MapPageViewModel>().Error("Getting bikes and stations in polling context failed with exception {Exception}.", exception);
|
||||
}
|
||||
|
||||
// Check if there are alreay any pins to the map.
|
||||
// Check if there are alreay any pins to the map.
|
||||
// If no initialze pins.
|
||||
if (Pins.Count <= 0)
|
||||
{
|
||||
|
@ -555,7 +562,7 @@ namespace TINK.ViewModel.Map
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when pages is closed/ hidden.
|
||||
/// Invoked when pages is closed/ hidden.
|
||||
/// Stops update process.
|
||||
/// </summary>
|
||||
public async Task OnDisappearing()
|
||||
|
@ -576,7 +583,7 @@ namespace TINK.ViewModel.Map
|
|||
// Lock action to prevent multiple instances of "BikeAtStation" being opened.
|
||||
IsMapPageEnabled = false;
|
||||
|
||||
TinkApp.SelectedStation = TinkApp.Stations.FirstOrDefault(x => x.Id == selectedStationId)
|
||||
TinkApp.SelectedStation = TinkApp.Stations.FirstOrDefault(x => x.Id == selectedStationId)
|
||||
?? new Station(selectedStationId, new List<string>(), null); // Station might not be in list StationDictinaly because this list is not updatd in background task.
|
||||
|
||||
#if TRYNOTBACKSTYLE
|
||||
|
@ -847,14 +854,14 @@ namespace TINK.ViewModel.Map
|
|||
}
|
||||
}
|
||||
|
||||
// Do not use property .State to get bluetooth state due
|
||||
// to issue https://hausource.visualstudio.com/TINK/_workitems/edit/116 /
|
||||
// Do not use property .State to get bluetooth state due
|
||||
// to issue https://hausource.visualstudio.com/TINK/_workitems/edit/116 /
|
||||
// see https://github.com/xabre/xamarin-bluetooth-le/issues/112#issuecomment-380994887
|
||||
if (await BluetoothService.GetBluetoothState() != Plugin.BLE.Abstractions.Contracts.BluetoothState.On)
|
||||
{
|
||||
await ViewService.DisplayAlert(
|
||||
AppResources.MessageTitleHint,
|
||||
AppResources.MessageBikesManagementBluetoothActivation,
|
||||
AppResources.MessageBikesManagementBluetoothActivation,
|
||||
AppResources.MessageAnswerOk);
|
||||
IsMapPageEnabled = true;
|
||||
ActionText = "";
|
||||
|
@ -932,4 +939,4 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
public bool IsToggleVisible => tinkKonradToggleViewModel.IsToggleVisible;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,6 +51,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -103,6 +104,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -163,6 +165,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -217,6 +220,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -272,6 +276,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
|
@ -314,6 +319,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI // Requires LockItArendi library.
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
|
@ -358,6 +364,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
#if ARENDI // Requires LockItArendi library.
|
||||
Substitute.For<ICentral>(),
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace TestTINKLib.Fixtures.UseCases.Logout
|
|||
var locksService = Substitute.For<ILocksService>();
|
||||
var device = Substitute.For<ISmartDevice>();
|
||||
var specialFolder = Substitute.For<ISpecialFolder>();
|
||||
var permissions = Substitute.For<IPermissions>();
|
||||
var account = Substitute.For<IAccount>();
|
||||
|
||||
accountStore.Load().Returns(account);
|
||||
|
@ -48,6 +49,7 @@ namespace TestTINKLib.Fixtures.UseCases.Logout
|
|||
device,
|
||||
specialFolder,
|
||||
null, // Cipher
|
||||
permissions,
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
|
|
@ -9,6 +9,7 @@ using TINK.Model.Services.Geolocation;
|
|||
using TINK.Services.BluetoothLock;
|
||||
using TINK.Model.Device;
|
||||
using TINK.Model.User.Account;
|
||||
using Plugin.Permissions.Abstractions;
|
||||
using System.Threading.Tasks;
|
||||
using TestFramework.Repository;
|
||||
|
||||
|
@ -24,6 +25,7 @@ namespace TestShareeLib.UseCases.Login
|
|||
var locksService = Substitute.For<ILocksService>();
|
||||
var device = Substitute.For<ISmartDevice>();
|
||||
var specialFolder = Substitute.For<ISpecialFolder>();
|
||||
var permissions = Substitute.For<IPermissions>();
|
||||
|
||||
// No user logged in is initial state to verify.
|
||||
var l_oTinkApp = new TinkApp(
|
||||
|
@ -40,6 +42,7 @@ namespace TestShareeLib.UseCases.Login
|
|||
device,
|
||||
specialFolder,
|
||||
null, // Cipher
|
||||
permissions,
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173) /* Current app version. Must be larger or equal 3.0.173 to lastVersion*/);
|
||||
|
|
|
@ -1,403 +0,0 @@
|
|||
using TINK.Repository;
|
||||
|
||||
namespace TestShareeLib.Repository
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds some COPRI responses for testing purposes.
|
||||
/// </summary>
|
||||
/// <remarks> Holds some demo Meinkonrad and LastenradBayern bikes
|
||||
/// </remarks>
|
||||
public class CopriCallsMemory001 : CopriCallMemoryBase, ICopriServer
|
||||
{
|
||||
public CopriCallsMemory001(string sessionCookie = null) : base(
|
||||
bikesAvailableResponse: BikesAvailableResponse,
|
||||
bikesOccupiedResponse: BikesOccupiedResponse,
|
||||
authResponse: AuthResponse,
|
||||
authOutResponse: AuthOutResponse,
|
||||
sessionCookie: sessionCookie)
|
||||
{ }
|
||||
|
||||
private static string AuthResponse => @"{
|
||||
""shareejson"": {
|
||||
""clearing_cache"": ""0"",
|
||||
""privacy_html"": ""site/privacy.html"",
|
||||
""user_id"": ""javaminister@gmail.com"",
|
||||
""impress_html"": ""site/impress.html"",
|
||||
""tariff_info_html"": ""site/tariff_info_1.html"",
|
||||
""lang"": ""DE"",
|
||||
""last_used_operator"": {
|
||||
""operator_name"": ""sharee.bike | TeilRad GmbH"",
|
||||
""operator_hours"": ""Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr"",
|
||||
""operator_phone"": ""+49 761 45370097"",
|
||||
""operator_email"": ""hotline@sharee.bike"",
|
||||
""operator_color"": ""#009699""
|
||||
},
|
||||
""response"": ""authorization"",
|
||||
""agb_checked"": ""0"",
|
||||
""agb_html"": ""site/agb.html"",
|
||||
""response_text"": ""Herzlich willkommen im Fahrradmietsystem"",
|
||||
""bike_info_html"": ""site/bike_info.html"",
|
||||
""debuglevel"": ""1"",
|
||||
""uri_primary"": ""https://shareeapp-primary.copri.eu"",
|
||||
""response_state"": ""OK, nothing todo"",
|
||||
""new_authcoo"": ""1"",
|
||||
""user_tour"": [],
|
||||
""authcookie"": ""6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH"",
|
||||
""copri_version"": ""4.1.8.21"",
|
||||
""apiserver"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""user_group"": []
|
||||
}
|
||||
}";
|
||||
|
||||
private static string AuthOutResponse = @"{
|
||||
""shareejson"": {
|
||||
""copri_version"": ""4.1.8.21"",
|
||||
""authcookie"": ""1"",
|
||||
""user_tour"": [],
|
||||
""user_group"": null,
|
||||
""apiserver"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""debuglevel"": ""1"",
|
||||
""uri_primary"": ""https://shareeapp-primary.copri.eu"",
|
||||
""bike_info_html"": ""site/bike_info.html"",
|
||||
""response_state"": ""OK, logout"",
|
||||
""new_authcoo"": ""0"",
|
||||
""lang"": ""DE"",
|
||||
""last_used_operator"": {
|
||||
""operator_hours"": ""Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr"",
|
||||
""operator_name"": ""sharee.bike | TeilRad GmbH"",
|
||||
""operator_email"": ""hotline@sharee.bike"",
|
||||
""operator_phone"": ""+49 761 45370097"",
|
||||
""operator_color"": ""#009699""
|
||||
},
|
||||
""tariff_info_html"": ""site/tariff_info_1.html"",
|
||||
""impress_html"": ""site/impress.html"",
|
||||
""response_text"": ""Auf Wiedersehen."",
|
||||
""agb_html"": ""site/agb.html"",
|
||||
""response"": ""authout"",
|
||||
""agb_checked"": ""0"",
|
||||
""privacy_html"": ""site/privacy.html"",
|
||||
""clearing_cache"": ""0"",
|
||||
""user_id"": ""javaminister@gmail.com""
|
||||
}
|
||||
}";
|
||||
|
||||
private static string BikesOccupiedResponse => @"{
|
||||
""shareejson"": {
|
||||
""authcookie"": ""6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH"",
|
||||
""copri_version"": ""4.1.8.21"",
|
||||
""user_tour"": [],
|
||||
""user_group"": [
|
||||
""FR300103"",
|
||||
""FR300101""
|
||||
],
|
||||
""bikes_occupied"": {
|
||||
""157056"": {
|
||||
""K_seed"": ""[-20, -104, -112, -49, 3, -74, -43, -115, -53, 34, -48, -29, -64, -90, -26, -74]"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""bike"": ""FR1544"",
|
||||
""unit_price"": ""3.00"",
|
||||
""description"": ""Contributor-Paul"",
|
||||
""station"": ""FR103"",
|
||||
""request_time"": ""2021-11-06 18:57:20.034438+01"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2200544"",
|
||||
""total_price"": ""25.50"",
|
||||
""bike_group"": [
|
||||
""FR300103""
|
||||
],
|
||||
""K_u"": ""[43, -16, 72, -5, 23, -117, 43, 57, 124, -106, -115, 97, -93, -30, -34, -7, -21, 119, 109, 92, 0, 0, 0, 0]"",
|
||||
""computed_hours"": ""8.50"",
|
||||
""end_time"": ""2021-11-08 21:14:35"",
|
||||
""state"": ""occupied"",
|
||||
""tariff_description"": {
|
||||
""eur_per_hour"": ""3.00"",
|
||||
""number"": ""5494"",
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""name"": ""Tester Basic"",
|
||||
""free_hours"": ""0.50"",
|
||||
""track_info"": ""Ich stimme der Speicherung (Tracking) meiner Fahrstrecke zwecks wissenschaftlicher Auswertung und Berechnung der CO2-Einsparung zu!"",
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""lock_state"": ""locked"",
|
||||
""system"": ""Ilockit"",
|
||||
""gps"": {
|
||||
""latitude"": ""47.9994661873206"",
|
||||
""longitude"": ""7.7904340904206""
|
||||
},
|
||||
""real_hours"": ""50.2833333333333"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-dc969f648732"",
|
||||
""start_time"": ""2021-11-06 18:57:25.445447+01""
|
||||
},
|
||||
""157072"": {
|
||||
""bike"": ""FR1004"",
|
||||
""K_seed"": ""[-31, -81, -41, 95, 112, -113, -78, -22, 84, -112, -73, 31, -125, -49, 125, 10]"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""bike_group"": [
|
||||
""FR300103""
|
||||
],
|
||||
""total_price"": ""0.00"",
|
||||
""description"": ""Contributor-Recumbent"",
|
||||
""station"": ""FR103"",
|
||||
""request_time"": ""2021-11-08 21:10:24.829395+01"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2302373"",
|
||||
""unit_price"": ""3.00"",
|
||||
""end_time"": ""2021-11-08 21:10:00+01"",
|
||||
""state"": ""requested"",
|
||||
""tariff_description"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB)."",
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Tester Basic"",
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""eur_per_hour"": ""3.00"",
|
||||
""number"": ""5494""
|
||||
},
|
||||
""computed_hours"": ""0"",
|
||||
""K_u"": ""[126, -125, 125, 83, 104, -121, -80, 40, 77, -35, 81, 27, 89, -124, -37, 57, 118, -113, 71, -37, 0, 0, 0, 0]"",
|
||||
""start_time"": ""2021-11-08 21:10:24.829395+01"",
|
||||
""gps"": {
|
||||
""latitude"": ""47.9980777"",
|
||||
""longitude"": ""7.7848769""
|
||||
},
|
||||
""lock_state"": ""locked"",
|
||||
""system"": ""Ilockit"",
|
||||
""real_hours"": ""0"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-fe3962c08bcc""
|
||||
}
|
||||
},
|
||||
""apiserver"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""uri_primary"": ""https://shareeapp-primary.copri.eu"",
|
||||
""debuglevel"": ""1"",
|
||||
""bike_info_html"": ""site/bike_info.html"",
|
||||
""new_authcoo"": ""0"",
|
||||
""response_state"": ""OK, nothing todo"",
|
||||
""last_used_operator"": {
|
||||
""operator_color"": ""#008dd2"",
|
||||
""operator_phone"": ""+49 089 / 111111111"",
|
||||
""operator_email"": ""hotline@lastenraddemo.bayern"",
|
||||
""operator_hours"": ""Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr"",
|
||||
""operator_name"": ""Lastenrad Bayern"",
|
||||
""operator_logo"": """"
|
||||
},
|
||||
""lang"": ""DE"",
|
||||
""impress_html"": ""site/impress.html"",
|
||||
""tariff_info_html"": ""site/tariff_info_1.html"",
|
||||
""agb_html"": ""site/agb.html"",
|
||||
""response"": ""user_bikes_occupied"",
|
||||
""agb_checked"": ""1"",
|
||||
""privacy_html"": ""site/privacy.html"",
|
||||
""clearing_cache"": ""0"",
|
||||
""user_id"": ""ohauff@posteo.de""
|
||||
}
|
||||
}";
|
||||
|
||||
private static string BikesAvailableResponse => @"{
|
||||
""shareejson"": {
|
||||
""agb_checked"": ""1"",
|
||||
""response"": ""bikes_available"",
|
||||
""agb_html"": ""site/agb.html"",
|
||||
""impress_html"": ""site/impress.html"",
|
||||
""tariff_info_html"": ""site/tariff_info_1.html"",
|
||||
""lang"": ""DE"",
|
||||
""last_used_operator"": {
|
||||
""operator_color"": ""#008dd2"",
|
||||
""operator_email"": ""hotline@lastenraddemo.bayern"",
|
||||
""operator_phone"": ""+49 089 / 111111111"",
|
||||
""operator_name"": ""Lastenrad Bayern"",
|
||||
""operator_hours"": ""Bürozeiten: Montag, Mittwoch, Freitag 9-12 Uhr"",
|
||||
""operator_logo"": """"
|
||||
},
|
||||
""user_id"": ""ohauff@posteo.de"",
|
||||
""clearing_cache"": ""0"",
|
||||
""privacy_html"": ""site/privacy.html"",
|
||||
""bikes"": {
|
||||
""FR1543"": {
|
||||
""system"": ""Ilockit"",
|
||||
""gps"": {
|
||||
""longitude"": ""7.8255321"",
|
||||
""latitude"": ""47.9767121""
|
||||
},
|
||||
""lock_state"": ""locked"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-cc141a6f68bb"",
|
||||
""state"": ""available"",
|
||||
""tariff_description"": {
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Tester Basic"",
|
||||
""eur_per_hour"": ""3.00"",
|
||||
""number"": ""5494"",
|
||||
""1543"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""max_eur_per_day"": ""10.00""
|
||||
},
|
||||
""bike_group"": [
|
||||
""FR300103""
|
||||
],
|
||||
""station"": ""FR101"",
|
||||
""description"": ""Contributor-bike Dominik"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2200543"",
|
||||
""authed"": ""1"",
|
||||
""bike"": ""FR1543"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu""
|
||||
},
|
||||
""FR1003"": {
|
||||
""bike"": ""FR1003"",
|
||||
""authed"": ""1"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""bike_group"": [
|
||||
""FR300101""
|
||||
],
|
||||
""Ilockit_ID"": ""ISHAREIT-2200545"",
|
||||
""station"": ""FR101"",
|
||||
""description"": ""Stadtrad"",
|
||||
""tariff_description"": {
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""number"": ""5491"",
|
||||
""eur_per_hour"": ""2.00"",
|
||||
""1003"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Vauban Basic""
|
||||
},
|
||||
""state"": ""available"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-e38bf9d32234"",
|
||||
""system"": ""Ilockit"",
|
||||
""gps"": {
|
||||
""longitude"": ""7.8255772"",
|
||||
""latitude"": ""47.9765188""
|
||||
},
|
||||
""lock_state"": ""locked""
|
||||
},
|
||||
""FR1540"": {
|
||||
""bike_group"": [
|
||||
""FR300103""
|
||||
],
|
||||
""Ilockit_ID"": ""ISHAREIT-2200540"",
|
||||
""description"": ""Contributor-bike Dieter"",
|
||||
""station"": ""FR101"",
|
||||
""bike"": ""FR1540"",
|
||||
""authed"": ""1"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-fc3c002a2add"",
|
||||
""system"": ""Ilockit"",
|
||||
""gps"": {
|
||||
""longitude"": ""7.8256267"",
|
||||
""latitude"": ""47.976803""
|
||||
},
|
||||
""lock_state"": ""locked"",
|
||||
""tariff_description"": {
|
||||
""1540"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Tester Basic"",
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""eur_per_hour"": ""3.00"",
|
||||
""number"": ""5494""
|
||||
},
|
||||
""state"": ""available""
|
||||
},
|
||||
""FR1002"": {
|
||||
""bike_group"": [
|
||||
""FR300101""
|
||||
],
|
||||
""description"": ""Lasten-Dreirad"",
|
||||
""station"": ""FR101"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2200539"",
|
||||
""authed"": ""1"",
|
||||
""bike"": ""FR1002"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""gps"": {
|
||||
""latitude"": ""47.976552"",
|
||||
""longitude"": ""7.8255068""
|
||||
},
|
||||
""system"": ""Ilockit"",
|
||||
""lock_state"": ""locked"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-f0b4a692e169"",
|
||||
""state"": ""available"",
|
||||
""tariff_description"": {
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""1002"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""eur_per_hour"": ""2.00"",
|
||||
""number"": ""5491"",
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Vauban Basic""
|
||||
}
|
||||
},
|
||||
""FR1538"": {
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""authed"": ""1"",
|
||||
""bike"": ""FR1538"",
|
||||
""station"": ""FR105"",
|
||||
""description"": ""Contributor-bike Rainer"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2200538"",
|
||||
""bike_group"": [
|
||||
""FR300103""
|
||||
],
|
||||
""state"": ""available"",
|
||||
""tariff_description"": {
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""eur_per_hour"": ""3.00"",
|
||||
""number"": ""5494"",
|
||||
""1538"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
},
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Tester Basic""
|
||||
},
|
||||
""gps"": {
|
||||
""latitude"": ""47.9275957"",
|
||||
""longitude"": ""7.973976""
|
||||
},
|
||||
""lock_state"": ""locked"",
|
||||
""system"": ""Ilockit"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-db0319a2555b""
|
||||
},
|
||||
""FR1001"": {
|
||||
""bike_group"": [
|
||||
""FR300101""
|
||||
],
|
||||
""station"": ""FR101"",
|
||||
""description"": ""Lastenrad"",
|
||||
""Ilockit_ID"": ""ISHAREIT-2200536"",
|
||||
""authed"": ""1"",
|
||||
""bike"": ""FR1001"",
|
||||
""uri_operator"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""lock_state"": ""locked"",
|
||||
""gps"": {
|
||||
""latitude"": ""47.9765091"",
|
||||
""longitude"": ""7.8255631""
|
||||
},
|
||||
""system"": ""Ilockit"",
|
||||
""Ilockit_GUID"": ""00000000-0000-0000-0000-caa87760e53e"",
|
||||
""state"": ""available"",
|
||||
""tariff_description"": {
|
||||
""free_hours"": ""0.50"",
|
||||
""name"": ""Vauban Basic"",
|
||||
""eur_per_hour"": ""2.00"",
|
||||
""number"": ""5491"",
|
||||
""max_eur_per_day"": ""10.00"",
|
||||
""1001"": {
|
||||
""operator_agb"": ""Mit der Mietrad Anmietung wird folgender Betreiber <a href='https://shareeapp-fr01.copri.eu/site/agb.html'>AGB</a> zugestimmt (als Demo sharee AGB).""
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
""user_group"": [
|
||||
""FR300103"",
|
||||
""FR300101""
|
||||
],
|
||||
""apiserver"": ""https://shareeapp-fr01.copri.eu"",
|
||||
""user_tour"": [],
|
||||
""authcookie"": ""6103_112e96b36ba33de245943c5ffaf369cd_oiF2kahH"",
|
||||
""copri_version"": ""4.1.8.21"",
|
||||
""response_state"": ""OK, nothing todo"",
|
||||
""new_authcoo"": ""0"",
|
||||
""bike_info_html"": ""site/bike_info.html"",
|
||||
""debuglevel"": ""1"",
|
||||
""uri_primary"": ""https://shareeapp-primary.copri.eu""
|
||||
}
|
||||
}";
|
||||
}
|
||||
}
|
|
@ -49,6 +49,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -87,6 +88,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -126,6 +128,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -164,6 +167,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Offline
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -213,6 +217,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.Account
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Offline
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -124,6 +125,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -197,6 +199,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -265,6 +268,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173));
|
||||
|
@ -333,6 +337,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -415,6 +420,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
@ -498,6 +504,7 @@ namespace TestShareeLib.UseCases.Startup
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
|
|
@ -719,6 +719,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -791,6 +792,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -862,6 +864,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -934,6 +937,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Not connected.
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -1015,6 +1019,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Not connected.
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -1100,6 +1105,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Not connected.
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
|
|
@ -539,6 +539,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
@ -674,6 +675,7 @@ namespace TestTINKLib.Fixtures.ObjectTests.ViewModel
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => false, // Offline
|
||||
postAction: (d, obj) => d(obj),
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
|
|
|
@ -33,6 +33,7 @@ namespace TestTINKLib.Fixtures.UseCases.ConnectedOffline
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115), // Current app version
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
|
|
@ -45,6 +45,7 @@ namespace TestTINKLib.Fixtures.UseCases.SelectStation
|
|||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
new PermissionsMock(),
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
using NUnit.Framework;
|
||||
using TINK.Model;
|
||||
using TINK.Model.Connector;
|
||||
using System;
|
||||
using static TINK.Repository.CopriCallsMemory;
|
||||
using System.Collections.Generic;
|
||||
using TINK.Repository;
|
||||
using TINK.ViewModel.Settings;
|
||||
using NSubstitute;
|
||||
using TINK.Services;
|
||||
using TINK.Model.Services.Geolocation;
|
||||
using TestFramework.Model.Device;
|
||||
using TestFramework.Model.User.Account;
|
||||
using TestFramework.Model.Services.Geolocation;
|
||||
using TestFramework.Services.BluetoothLock;
|
||||
using TestFramework.Services.Permissions;
|
||||
|
||||
namespace TestTINKLib.Fixtures.UseCases.SelectStation
|
||||
{
|
||||
|
||||
[TestFixture]
|
||||
public class TestTinkApp
|
||||
{
|
||||
[Test]
|
||||
public void TestBikesAtStation_AccountStoreMock_NoUser_CopriMock_Set2()
|
||||
{
|
||||
var l_oConnector = new ConnectorCache(
|
||||
string.Empty,
|
||||
string.Empty,
|
||||
new CopriCallsMemory(SampleSets.Set2, 1));
|
||||
|
||||
var l_oTinkApp = new TinkApp(
|
||||
new TINK.Model.Settings.Settings(
|
||||
new TINK.ViewModel.Map.GroupFilterMapPage(new Dictionary<string, FilterState> { { "TINK", FilterState.On } }),
|
||||
new GroupFilterSettings(new Dictionary<string, FilterState> { { "TINK", FilterState.On }, { "Konrad", FilterState.On } }),
|
||||
new Uri("https://shareeapp-primary.copri-bike.de/APIjsonserver"),
|
||||
new TINK.Settings.PollingParameters(new TimeSpan(10000), true),
|
||||
Serilog.Events.LogEventLevel.Error,
|
||||
activeLockService: typeof(LocksServiceMock).FullName,
|
||||
activeGeolocationService: typeof(GeolocationMock).FullName),
|
||||
new StoreMock(),
|
||||
(isConnected, uri, sessionCookie, mail, expiresAfter) => new ConnectorCache(sessionCookie, mail, new CopriCallsMemory(SampleSets.Set2, 1)),
|
||||
Substitute.For<IServicesContainer<IGeolocation>>(),
|
||||
new LocksServiceMock(),
|
||||
new DeviceMock(),
|
||||
new SpecialFolderMock(),
|
||||
null, // Cipher
|
||||
isConnectedFunc: () => true,
|
||||
currentVersion: new Version(3, 2, 0, 115),
|
||||
lastVersion: new Version(3, 0, 173)); // Current app version. Must be larger or equal 3.0.173 to
|
||||
|
||||
Assert.AreEqual(0, TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count);
|
||||
|
||||
l_oTinkApp.SelectedStation = new TINK.Model.Station.Station("5", new List<string>(), null);
|
||||
Assert.AreEqual(3, TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count);
|
||||
Assert.AreEqual("25", TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.GetById("25").Id);
|
||||
Assert.AreEqual("11", TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.GetById("11").Id);
|
||||
Assert.AreEqual("2", TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.GetById("2").Id);
|
||||
|
||||
l_oTinkApp.SelectedStation = new TINK.Model.Station.Station("10", new List<string>(), null);
|
||||
|
||||
Assert.AreEqual(
|
||||
1,
|
||||
TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count);
|
||||
|
||||
Assert.AreEqual("18", TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.GetById("18").Id);
|
||||
|
||||
l_oTinkApp.SelectedStation = new TINK.Model.Station.Station("91345", new List<string>(), null);
|
||||
|
||||
Assert.AreEqual(0, TestHelper.GetBikesAtStation(l_oTinkApp.ActiveUser, l_oConnector, l_oTinkApp.SelectedStation.Id).Result.Count);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -210,4 +210,4 @@
|
|||
<Folder Include="Fixtures\UseCases\Startup\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
</Project>
|
Loading…
Reference in a new issue