예제 #1
0
        public DepartureBoardScripting(HybridWebView view, DepartureBoardResultsPage page) : base(view)
        {
            this.page = page;

            view.RegisterCallback(nameof(ShowDepartureDetail), arg => { ShowDepartureDetail(int.Parse(arg)); return(string.Empty); });
            view.RegisterCallback(nameof(ShowMap), arg => { ShowMap(arg == null ? 0 : int.Parse(arg)); return(string.Empty); });
        }
예제 #2
0
        public JourneyScripting(HybridWebView view, FindJourneyResultsPage page) : base(view)
        {
            this.page = page;

            view.RegisterCallback(nameof(ShowJourneyDetail), arg => { ShowJourneyDetail(int.Parse(arg)); return(string.Empty); });
            view.RegisterCallback(nameof(ShowMap), arg => { ShowMap(arg == null ? 0 : int.Parse(arg)); return(string.Empty); });
        }
예제 #3
0
        /// <summary>
        /// Sets JS callbacks for given HybridWebView.
        /// </summary>
        /// <param name="view">HybridWebView.</param>
        public Scripting(HybridWebView view) : base(Settings.Localization, true)
        {
            this.view = view;

            view.RegisterCallback(nameof(Iso8601ToSimpleString), Iso8601ToSimpleString);
            view.RegisterCallback(nameof(IsMobileVersion), _ => IsMobileVersion().ToString());
            view.RegisterCallback(nameof(TransferStringConstant), _ => TransferStringConstant());
            view.RegisterCallback(nameof(TotalTransfersToString), arg => TotalTransfersToString(int.Parse(arg)));
            view.RegisterCallback(nameof(TotalDurationToString), TotalDurationToString);
            view.RegisterCallback(nameof(LeavingTimeToString), LeavingTimeToString);
            view.RegisterCallback(nameof(ReplaceIdWithName), arg => ReplaceIdWithName(int.Parse(arg)));
            view.RegisterCallback(nameof(MapStringConstant), _ => MapStringConstant());
            view.RegisterCallback(nameof(DetailStringConstant), _ => DetailStringConstant());
            view.RegisterCallback(nameof(PrintStringConstant), _ => PrintStringConstant());
            view.RegisterCallback(nameof(OutdatedStringConstant), _ => OutdatedStringConstant());
            view.RegisterCallback(nameof(EditParametersStringConstant), _ => EditParametersStringConstant());
            view.RegisterCallback(nameof(PrintListStringConstant), _ => PrintListStringConstant());
        }