Example #1
0
        private void RemoveHook()
        {
            if (s_hook == null)
            {
                return;
            }
            TreeHooks.Instance.RemoveHook("Combat_Main", s_hook);
            Navigator.NavigationProvider = s_prevNavigator;

            // Make sure maps for the previous navigator are up-to-date
            var meshNav = Navigator.NavigationProvider as MeshNavigator;

            if (meshNav != null)
            {
                meshNav.UpdateMaps();
            }

            s_prevNavigator = null;
            s_hook          = null;
            foreach (var kv in s_avoidDictionary)
            {
                AvoidanceManager.RemoveAvoid(kv.Value);
                QBCLog.DeveloperInfo("Removed the \"{0}\" avoidance definition", kv.Key);
            }
            s_avoidDictionary.Clear();
            BotEvents.OnPulse      -= BotEvents_OnPulse;
            BotEvents.OnBotStopped -= BotEvents_OnBotStopped;
            BotEvents.Profile.OnNewOuterProfileLoaded  -= Profile_OnNewOuterProfileLoaded;
            LootTargeting.Instance.RemoveTargetsFilter -= Instance_RemoveTargetsFilter;
            QBCLog.Info("Uninstalled avoidance system");
        }
Example #2
0
 protected void NavigateToInfo(MediaToolItem filePath)
 {
     if (filePath != null)
     {
         NavigationProvider.Navigate(NavigationSource.InfoPage, filePath);
     }
 }
Example #3
0
        public ActionResult Index(string suite)
        {
            ViewBag.Navigation = FilterEmptyCategories(NavigationProvider.SuiteWidgets(suite));
            ViewBag.SuiteTitle = SuiteTitles[suite];

            return(View());
        }
Example #4
0
 /// <summary>
 /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     this.Control           = NavigationProvider.Instance(this.ProviderName);
     this.Control.ControlID = string.Format("ctl{0}", this.ID);
     this.Control.Initialize();
 }
Example #5
0
        public virtual void UpdateRootPage(NavigationPage page)
        {
            if (_rootPage != null)
            {
                _rootPage.Pushed       -= OnPushed;
                _rootPage.Popped       -= OnPopped;
                _rootPage.PoppedToRoot -= OnPopped;
            }
            if (page != null)
            {
                page.Pushed       += OnPushed;
                page.Popped       += OnPopped;
                page.PoppedToRoot += OnPopped;
            }
            _rootPage = page;

            var currentPage = CurrentContent as Page ?? page;

            if (currentPage != null)
            {
                var context = currentPage.DataContext();
                if (context != null)
                {
                    currentPage.SetNavigationParameter(NavigationProvider.GenerateNavigationParameter(context.GetType(), string.Empty));
                }
                _threadManager.Invoke(ExecutionMode.AsynchronousOnUiThread, this, currentPage,
                                      (service, p) => service.RaiseNavigated(p, p.GetNavigationParameter() as string, NavigationMode.New),
                                      OperationPriority.Low);
            }
        }
Example #6
0
        public IActionResult Index()
        {
            // Retrieves a page from the Xperience database with the '/Home' node alias path
            TreeNode page = _pagesRetriever.Retrieve <TreeNode>(query => query
                                                                .Path("/Home", PathTypeEnum.Single))
                            .FirstOrDefault();

            // Responds with the HTTP 404 error when the page is not found
            if (page == null)
            {
                return(NotFound());
            }

            // Initializes the page data context (and the page builder) using the retrieved page
            _pageDataContextInitializer.Initialize(page);

            var homeSource = HomeProvider.GetHome(Guid.Parse(Home.NodeGuidId), "en-US", "HouseRestaurant");

            var menus  = NavigationProvider.GetMenuItems();
            var dishes = DishProvider.GetDishCategories();

            var vm = new HomeViewModel()
            {
                Id          = homeSource.First().HomeID,
                Description = homeSource.First().Description,
                Title       = homeSource.First().Title,
                MenuItems   = menus,
                Dishes      = dishes
            };


            return(View(vm));
        }
Example #7
0
 public DDNavigationProvider(NavigationProvider original) : base(original)
 {
     Walls  = new Dictionary <uint, bool>();
     _traps = new List <uint>();
     Traps  = new List <Vector3>();
     _map   = new List <Vector3>();
 }
Example #8
0
        private void InitializeViewModelExecute()
        {
            this.BusyCount++;
            this.IsNoResponses      = false;
            this.IsResponsesVisible = false;
            Locator.NavigationStatic.NavigateToQuestionsCommand.RaiseCanExecuteChanged();

            _surveyInfoLoader        = new BackgroundWorker();
            this.CurrentSurvey       = new Survey();
            this.SubmittedResponses  = new ObservableCollection <ResponseSet>();
            this.InProgressResponses = new ObservableCollection <ResponseSet>();
            this.CompletedResponses  = new ObservableCollection <ResponseSet>();
            this.surveyRepository    = new SurveyRepository();
            var pageParameters = NavigationProvider.GetNavigationParameters();

            if (pageParameters.ContainsKey(SURVEY_ID))
            {
                this.currentSurveyId = int.Parse(pageParameters[SURVEY_ID]);

                this.CurrentSurvey = surveyRepository.GetSurveyByID(this.currentSurveyId);
            }

            _surveyInfoLoader.DoWork += new DoWorkEventHandler(LoadSurveyInformation);
            this.IsNoResponses        = this.CurrentSurvey.ResponseSet.Count == 0;
            this.IsResponsesVisible   = !this.IsNoResponses;
            _surveyInfoLoader.RunWorkerAsync();
        }
        public ActionResult Solutions()
        {
            var solutionsNames = new[] { "dlja-servernyh-komnat-i-6kafov", "udaljonnoe-upravlenie-jelektropitaniem", "re6enija-na-osnove-POE" };
            var model          = new ProductsModel
            {
                ActiveSection =
                    NavigationProvider.GetAllSections().First(s => s.Url == "solutions")
            };
            var devices = new List <Device>();

            foreach (var solutionName in solutionsNames)
            {
                var sub = _repository.Devices.FirstOrDefault(d => d.Url == solutionName);
                if (sub != null)
                {
                    devices.AddRange(_repository.Devices.Where(d => !d.Name.IsGroup() && d.Name.IsUnderOther(sub.Name)));
                }
            }

            model.Devices = devices;
            model.ActiveSection.IsSelected = true;
            var sections = NavigationProvider.GetAllSections().Where(m => m.Url != model.ActiveSection.Url);

            sections.ForEach(m => model.Sections.Add(m));


            //return View(model);

            return(View("Adaptive_Index", model));
        }
        private void OpenDuplicateExecute(int responseSetId)
        {
            string navigationString = string.Format(Constants.RESPONSESET_PAGE_SOURCE, responseSetId);

            navigationString += "&" + CategoryViewModel.OPEN_DUPLICATE + "=true";
            NavigationProvider.Navigate(new System.Uri(navigationString, System.UriKind.Relative));
        }
Example #11
0
        public ActionResult <object> GetNavigation()
        {
            var           navigation = new NavigationProvider().SetNavigation();
            Robj <object> obj        = new Robj <object>();

            obj.Succ(navigation);
            return(obj);
        }
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     this.m_objControl      = NavigationProvider.Instance(this.ProviderName);
     this.Control.ControlID = "ctl" + this.ID;
     this.Control.Initialize();
     this.spActions.Controls.Add(this.Control.NavigationControl);
 }
Example #13
0
        protected virtual void InitializeRootPage(IViewModel viewModel, IDataContext context)
        {
            var mainPage       = (Page)ViewManager.GetOrCreateView(viewModel, true, context);
            var navigationPage = mainPage as NavigationPage;

            if (WrapToNavigationPage)
            {
                navigationPage = CreateNavigationPage(mainPage);
            }

            var isRoot = navigationPage == null || ReferenceEquals(mainPage, navigationPage);

            if (navigationPage != null)
            {
                INavigationService navigationService;
                if (!ServiceProvider.TryGet(out navigationService))
                {
                    navigationService = CreateNavigationService();
                    ServiceProvider.IocContainer.BindToConstant(navigationService);
                }

                //Activating navigation provider if need
                INavigationProvider provider;
                ServiceProvider.TryGet(out provider);

                navigationService.UpdateRootPage(navigationPage, viewModel);
                mainPage = navigationPage;
            }
            Application.Current.MainPage = mainPage;

            EventHandler <Page, CancelEventArgs> handler = OnBackButtonPressed;

            XamarinFormsToolkitExtensions.BackButtonPressed -= handler;

            var mode = NavigationMode.New;

            if (isRoot)
            {
                XamarinFormsToolkitExtensions.BackButtonPressed += handler;

                if (viewModel.Settings.State.Contains(IsRootConstant))
                {
                    mode = NavigationMode.Refresh;
                }
                else
                {
                    viewModel.Settings.State.AddOrUpdate(IsRootConstant, null);
                }
                viewModel.Settings.Metadata.AddOrUpdate(ViewModelConstants.CanCloseHandler, CanCloseRootViewModel);
                NavigationDispatcher.OnNavigated(new NavigationContext(NavigationType.Page, mode, null, viewModel, this, context));
            }
            else
            {
                mainPage.SetNavigationParameter(NavigationProvider.GenerateNavigationParameter(viewModel));
                ServiceProvider.Get <INavigationProvider>().Restore(context);
            }
        }
Example #14
0
        public override void Close(IMvxViewModel viewModel)
        {
            if (NavigationProvider == null)
            {
                return;
            }

            NavigationProvider.Pop();
        }
Example #15
0
 /// -----------------------------------------------------------------------------
 /// <summary>
 /// OnInit runs during the controls initialisation phase
 /// </summary>
 /// -----------------------------------------------------------------------------
 protected override void OnInit(EventArgs e)
 {
     _ProviderControl = NavigationProvider.Instance(ProviderName);
     ProviderControl.PopulateOnDemand += ProviderControl_PopulateOnDemand;
     base.OnInit(e);
     ProviderControl.ControlID = "ctl" + ID;
     ProviderControl.Initialize();
     Controls.Add(ProviderControl.NavigationControl);
 }
Example #16
0
        public IActionResult Index()
        {
            var widgets = NavigationProvider.SuiteWidgets(HostingEnvironment.WebRootFileProvider)
                          .Where(widget => widget.ShouldInclude);

            ViewBag.Navigation = widgets;

            return(View());
        }
 protected override void OnInit()
 {
     ThreadManager.ImmediateInvokeAsync           = true;
     ThreadManager.ImmediateInvokeOnUiThread      = true;
     ThreadManager.ImmediateInvokeOnUiThreadAsync = true;
     base.OnInit();
     NavigationService       = new NavigationServiceMock();
     ViewPageMappingProvider = new ViewPageMappingProviderMock();
     NavigationProvider      = new NavigationProvider(NavigationService, ThreadManager, ViewPageMappingProvider, ViewManager, ViewModelProvider, NavigationDispatcher, new EventAggregator());
 }
Example #18
0
        protected override void OnInit(EventArgs e)
        {
            m_objControl              = NavigationProvider.Instance(this.ProviderName);
            Control.PopulateOnDemand += new NavigationProvider.PopulateOnDemandEventHandler(Control_PopulateOnDemand);

            base.OnInit(e);
            Control.ControlID = "ctl" + this.ID;
            Control.Initialize();
            this.Controls.Add(Control.NavigationControl);
        }
 public NavigationService(
     NavigationProvider navigationProvider,
     ICompositeNavigationPerformer navigationPerformer,
     IViewModelBuilder viewModelBuilder,
     IPageBuilder pageBuilder)
 {
     _navigationProvider  = navigationProvider;
     _navigationPerformer = navigationPerformer;
     _pageBuilder         = pageBuilder;
     _viewModelBuilder    = viewModelBuilder;
 }
Example #20
0
 protected override void OnInit()
 {
     ThreadManager.ImmediateInvokeAsync           = true;
     ThreadManager.ImmediateInvokeOnUiThread      = true;
     ThreadManager.ImmediateInvokeOnUiThreadAsync = true;
     base.OnInit();
     NavigationService       = new NavigationServiceMock();
     ViewPageMappingProvider = new ViewPageMappingProviderMock();
     NavigationProvider      = new NavigationProvider(NavigationService, ThreadManager, ViewPageMappingProvider,
                                                      ViewManager, ViewModelProvider, OperationCallbackManager);
 }
Example #21
0
        /// <summary>
        /// Starts intialization of view model.
        /// </summary>
        private void InitializeViewModeExecute()
        {
            if (!this.wasInitialization)
            {
                this.wasInitialization = true;
                using (var settingsRepository = new SettingsRepository())
                {
                    if (!IsolatedStorageSettings.ApplicationSettings.Contains(_firstLaunchKey))
                    {
                        IsolatedStorageSettings.ApplicationSettings[_firstLaunchKey] = wasInitialization;
                        var result          = MessageBox.Show("Would you like this application to use your phone's GPS function?", "GPS", MessageBoxButton.OKCancel);
                        var currentSettings = settingsRepository.GetCurrentSettings();
                        currentSettings.IsGpsEnabled = result == MessageBoxResult.OK;
                        settingsRepository.UpdateCurrentSettings(currentSettings);
                    }

                    bool userAcceptedEula = false;
                    var  store            = IsolatedStorageSettings.ApplicationSettings;
                    if (store.Contains(EULA_KEY))
                    {
                        userAcceptedEula = (bool)store[EULA_KEY];
                    }

                    if (!userAcceptedEula)
                    {
                        NotificationTool.Show(
                            "Privacy Policy",
                            "NDG",
                            new NotificationAction("Accept", () => { AcceptedPrivacy(); }),
                            new NotificationAction("Decline", () => { DeclinedPrivacy(); }));
                    }

                    GpsTracker.Instance.GpsAllowed = settingsRepository.GetCurrentSettings().IsGpsEnabled;
                    GpsTracker.Instance.StartTracking();
                }
            }

            if (Membership.CurrentUser == null)
            {
                this.Login    = string.Empty;
                this.Password = string.Empty;
                using (var settingsRepository = new SettingsRepository())
                    this.ServerPath = settingsRepository.GetCurrentSettings().Server.Address;
            }

            var pageParameters = NavigationProvider.GetNavigationParameters();

            if (pageParameters.ContainsKey(SEVER_PATH_PARAMETER))
            {
                this.ServerPath = pageParameters[SEVER_PATH_PARAMETER];
            }
        }
Example #22
0
        public FlightEnabledNavigator(
            NavigationProvider innerNavigator,
            IFlightEnabledPlayerMover playerMover,
            IFlightNavigationArgs flightNavigationArgs) : base(innerNavigator)
        {
            logger                       = new Logger(new FlightEnabledNavigatorLogColors(), "FlightNav");
            this.playerMover             = playerMover;
            this.flightNavigationArgs    = flightNavigationArgs;
            Navigator.NavigationProvider = this;
            CurrentPath                  = new FlightPath(Vector3.Zero, Vector3.Zero, flightNavigationArgs);

            logger.Verbose(Localization.Localization.FlightEnabledNavigator_Enabled);
        }
Example #23
0
        public async Task <UserMenu> GetMenuAsync()
        {
            if (!_ancSession.UserId.HasValue)
            {
                throw new AncAuthorizationException("请登陆");
            }
            var permissions = await _permissionService.GetAllPermissionsAsync(_ancSession.UserId.Value);

            MenuDefinition menuDefinition = NavigationProvider.GetNavigation();
            UserMenu       userMenu       = new UserMenu(menuDefinition);

            CheckPermission(permissions, menuDefinition.Items, userMenu.Items);
            return(userMenu);
        }
Example #24
0
 private void NavigateToSaveResponsesExecute()
 {
     if (Locator.CategoryStatic.currentResponsesSetId == 0 || Locator.CategoryStatic.currentResponseSet.IsSubmitted)
     {
         Locator.CategoryStatic.SaveResponseSetCommand.RaiseCanExecuteChanged();
         Locator.CategoryStatic.ResponseSetName = string.Empty;
         NavigationProvider.Navigate(new Uri(Constants.SAVE_RESPONSES_PAGE_SOURCE, UriKind.Relative));
     }
     else
     {
         var responseSet = Locator.CategoryStatic.responseSetGovernor.UpdateResponseSetWithAnswers(Locator.CategoryStatic.Categories, Locator.CategoryStatic.currentResponsesSetId);
         Locator.CategoryStatic.UploadToService();
     }
 }
Example #25
0
        protected override void OnInit(EventArgs e)
        {
            using (new DNNContext(this))
            {
                base.OnInit(e);

                this.navProvider           = (DDRMenuNavigationProvider)NavigationProvider.Instance("DDRMenuNavigationProvider");
                this.navProvider.ControlID = "ctl" + this.ID;
                this.navProvider.MenuStyle = this.MenuStyle;
                this.navProvider.Initialize();

                this.Controls.Add(this.navProvider.NavigationControl);
            }
        }
Example #26
0
        private void InstallHook()
        {
            s_prevNavigator = Navigator.NavigationProvider;
            var avoidNavigator = new AvoidanceNavigationProvider();;

            Navigator.NavigationProvider = avoidNavigator;
            avoidNavigator.UpdateMaps();
            s_hook = new ActionRunCoroutine(ctx => HookHelpers.ExecuteHook(this, HookHandler));
            TreeHooks.Instance.InsertHook("Combat_Main", 0, s_hook);
            BotEvents.OnPulse      += BotEvents_OnPulse;
            BotEvents.OnBotStopped += BotEvents_OnBotStopped;
            BotEvents.Profile.OnNewOuterProfileLoaded  += Profile_OnNewOuterProfileLoaded;
            LootTargeting.Instance.RemoveTargetsFilter += Instance_RemoveTargetsFilter;
            QBCLog.Info("Installed avoidance system");
        }
        public ActionResult Development()
        {
            var devices = _repository.Devices.Where(d => !d.Name.IsGroup() && d.Name.Path.Contains("Development"));

            var model = new ProductsModel
            {
                ActiveSection =
                    NavigationProvider.GetAllSections().FirstOrDefault(m => m.Url == "development")
            };

            ViewBag.Title = ViewBag.Description = ViewBag.Keywords = model.ActiveSection.FormattedTitle;

            model.Devices = devices;

            return(View("Adaptive_Index", model));
        }
Example #28
0
 private void InitializeViewModelExecute()
 {
     this.BusyCount++;
     this.IsSaveButtonVisible = true;
     Locator.NavigationStatic.NavigateToSaveResponsesCommand.RaiseCanExecuteChanged();
     this.categoriesWorker      = new BackgroundWorker();
     this.CurrentPageIndex      = QuestionPageIndexes.Questions;
     this.CurrentSurvey         = new Survey();
     this.currentResponsesSetId = 0;
     this.Categories            = new ObservableCollection <Category>();
     this.surveyRepository      = new SurveyRepository();
     this.categoryRepository    = new CategoryRepository();
     this.responseSetRepository = new ResponseSetRepository();
     pageParameters             = NavigationProvider.GetNavigationParameters();
     categoriesWorker.DoWork   += this.LoadContent;
     categoriesWorker.RunWorkerAsync();
 }
Example #29
0
 public AuthorizedNavigationServiceDecorator(
     PageNavigationTypeHolder pageNavigationTypeHolder,
     ViewModelNavigationTypeHolder viewModelNavigationTypeHolder,
     NavigationProvider navigationProvider,
     IUserDialogs userDialogs,
     IAuthorizationService authorizationService,
     IAuthorizationHolder authorizationHolder,
     INavigationService decoreeService)
 {
     _userDialogs                   = userDialogs;
     _navigationProvider            = navigationProvider;
     _authorizationService          = authorizationService;
     _pageNavigationTypeHolder      = pageNavigationTypeHolder;
     _viewModelNavigationTypeHolder = viewModelNavigationTypeHolder;
     _navigationService             = decoreeService;
     _authorizationHolder           = authorizationHolder;
 }
Example #30
0
        protected virtual void InitializeRootPage(IViewModel viewModel, IDataContext context)
        {
            var mainPage = (Page)ServiceProvider.ViewManager.GetOrCreateView(viewModel, true, context);

            mainPage.SetNavigationParameter(NavigationProvider.GenerateNavigationParameter(viewModel));
            NavigationPage navigationPage = mainPage as NavigationPage;

            if (WrapToNavigationPage)
            {
                navigationPage = CreateNavigationPage(mainPage);
            }

            bool isRoot = ReferenceEquals(mainPage, navigationPage);

            if (navigationPage != null)
            {
                INavigationService navigationService;
                if (!IocContainer.TryGet(out navigationService))
                {
                    navigationService = CreateNavigationService();
                    IocContainer.BindToConstant(navigationService);
                }

                //Activating navigation provider if need
                INavigationProvider provider;
                IocContainer.TryGet(out provider);

                navigationService.UpdateRootPage(navigationPage, viewModel);
                mainPage = navigationPage;
            }
            Application.Current.MainPage = mainPage;

            NavigationMode mode = NavigationMode.New;

            if (isRoot)
            {
                if (viewModel.Settings.State.Contains(IsRootConstant))
                {
                    mode = NavigationMode.Refresh;
                }
                viewModel.Settings.State.AddOrUpdate(IsRootConstant, null);
            }
            IocContainer.Get <INavigationDispatcher>().OnNavigated(new NavigationContext(NavigationType.Page, mode, null, viewModel, this, context));
        }
 public CloseCommandWrapper(ICommand nestedCommand, NavigationProvider provider, IViewModel viewModel)
 {
     NestedCommand = nestedCommand;
     _provider = provider;
     _reference = ToolkitExtensions.GetWeakReference(viewModel);
 }
 private static bool OnViewModelClosed(IViewModel viewModel, object parameter, NavigationProvider provider, bool completeCallback)
 {
     if (provider.CachePolicy != null)
         provider.CachePolicy.Invalidate(viewModel, parameter as IDataContext);
     var closeableViewModel = viewModel as ICloseableViewModel;
     if (closeableViewModel != null)
     {
         var wrapper = closeableViewModel.CloseCommand as CloseCommandWrapper;
         if (wrapper != null)
             closeableViewModel.CloseCommand = wrapper.NestedCommand;
         closeableViewModel.Closed -= provider._closeViewModelHandler;
     }
     if (completeCallback && provider.CurrentViewModel != viewModel)
     {
         provider.CompleteOperationCallback(viewModel, parameter as IDataContext ?? DataContext.Empty);
         return true;
     }
     return false;
 }
 protected override void OnInit()
 {
     ThreadManager.ImmediateInvokeAsync = true;
     ThreadManager.ImmediateInvokeOnUiThread = true;
     ThreadManager.ImmediateInvokeOnUiThreadAsync = true;
     base.OnInit();
     NavigationService = new NavigationServiceMock();
     ViewPageMappingProvider = new ViewPageMappingProviderMock();
     NavigationProvider = new NavigationProvider(NavigationService, ThreadManager, ViewPageMappingProvider,
         ViewManager, ViewModelProvider, OperationCallbackManager);
 }
Example #34
0
        private static void Start()
        {
            //if (SingularSettings.Debug)
            //    DebugNavigationProvider.Install();

            _origNavigation = Navigator.NavigationProvider;
            _origPlayerMover = Navigator.PlayerMover;
            _origStuckHandler = Navigator.NavigationProvider.StuckHandler;
            Update();
        }