Пример #1
0
        public RouteStack(ObservableCollection <Route> menuRoutes, IRouteFactory routeFactory,
                          IRouteErrorListener routeErrorListener, IContext synchronizationContext)
        {
            if (routeFactory == null || routeErrorListener == null || synchronizationContext == null)
            {
                throw new ArgumentNullException();
            }

            this.MenuRoutes             = menuRoutes ?? new ObservableCollection <Route>();
            this.RouteFactory           = routeFactory;
            this.RouteErrorListener     = routeErrorListener;
            this.SynchronizationContext = synchronizationContext;
            this.stack = new Stack <RouteItem>();
        }
Пример #2
0
        public static void TryOnRouteEventException(this IRouteErrorListener listener, Route route,
                                                    RouteEventType eventType, Exception exception)
        {
            if (listener == null)
            {
                return;
            }

            try
            {
                listener.OnRouteEventException(route, eventType, exception);
            }
            catch
            {
                // ignored
            }
        }