예제 #1
0
        public App()
        {
            InitializeComponent();

            MainPage = new ShellPage();
            MainPage.Navigation.PushModalAsync(new LoginPage());
        }
예제 #2
0
        public PowerLauncherViewModel()
        {
            callback = (PowerLauncherSettings settings) =>
            {
                // Propagate changes to Power Launcher through IPC
                ShellPage.DefaultSndMSGCallback(
                    string.Format("{{ \"powertoys\": {{ \"{0}\": {1} }} }}", PowerLauncherSettings.POWERTOYNAME, JsonSerializer.Serialize(settings)));
            };
            if (SettingsUtils.SettingsExists(PowerLauncherSettings.POWERTOYNAME))
            {
                settings = SettingsUtils.GetSettings <PowerLauncherSettings>(PowerLauncherSettings.POWERTOYNAME);
            }
            else
            {
                settings = new PowerLauncherSettings();
                settings.properties.open_powerlauncher.Alt    = true;
                settings.properties.open_powerlauncher.Code   = (int)Windows.System.VirtualKey.Space;
                settings.properties.maximum_number_of_results = 4;
                callback(settings);
            }

            if (SettingsUtils.SettingsExists())
            {
                generalSettings = SettingsUtils.GetSettings <GeneralSettings>();
            }
            else
            {
                generalSettings = new GeneralSettings();
            }
        }
        private void Page_Load(object sender, EventArgs e)
        {
            Assert.ArgumentNotNull(sender, "sender");
            Assert.ArgumentNotNull(e, "e");
            if (!ShellPage.IsLoggedIn())
            {
                return;
            }
            var s = string.Empty;

            switch (WebUtil.GetQueryString("cmd").ToLowerInvariant())
            {
            case "gettreeviewchildren":
                s = GetTreeViewChildren();
                break;

            case "expandtreeviewtonode":
                s = ExpandTreeViewToNode();
                break;

            case "getcontextualtabs":
                s = GetContextualTabs();
                break;

            case "convert":
                s = DesignTimeConvert();
                break;

            case "treeviewcontent":
                s = GetTreeViewContent();
                break;
            }
            Response.Write(s);
        }
예제 #4
0
        protected override UIElement CreateShell(Frame rootFrame)
        {
            ShellPage shell = this.Container.Resolve <ShellPage>();

            shell.SetRootFrame(rootFrame);
            return(shell);
        }
예제 #5
0
 private static void SpawnSecondaryPanel(GameObject secondaryPanel)
 {
     songItemPanel = secondaryPanel.GetComponent <ShellPage>();
     songItemPanel.SetPageActive(true, true);
     songItemPanel.gameObject.transform.GetChild(0).GetChild(1).gameObject.SetActive(false);             // Removes the back button
     MelonCoroutines.Start(WaitForSpawningMenu(secondaryPanel));
 }
예제 #6
0
        public static void CreatePanel()
        {
            panelCreated = true;
            GameObject HMXshellpage = GameObject.Find("ShellPage_Settings");

            shellInstance      = GameObject.Instantiate(HMXshellpage, DebugTextPosition, Quaternion.Euler(0, 100, 0));
            shellInstance.name = "Custom_Page";
            SP = shellInstance.GetComponent <ShellPage>();

            Transform page = shellInstance.transform.GetChild(0);

            for (int i = 0; i < page.childCount; i++)
            {
                Transform child = page.GetChild(i);
                if (child.gameObject.name.Contains("backParent"))
                {
                    child.gameObject.SetActive(false);
                }
            }

            Transform ShellPanelCenter = page.transform.GetChild(0);
            Transform Settings         = ShellPanelCenter.transform.GetChild(2);
            Transform Options          = Settings.transform.GetChild(0);

            OM = Options.GetComponent <OptionsMenu>();

            MelonCoroutines.Start(SetPanelActive(true));
        }
예제 #7
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var shell = new ShellPage();

            Window.Current.Content = shell;
            Window.Current.Activate();
        }
예제 #8
0
        private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
        {
            // Hook up x:Bind source.
            WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
            ShellPage       shellPage       = windowsXamlHost.GetUwpInternalObject() as ShellPage;

            if (shellPage != null)
            {
                // send IPC Message
                shellPage.SetDefaultSndMessageCallback(msg =>
                {
                    //IPC Manager is null when launching runner directly
                    Program.GetTwoWayIPCManager()?.Send(msg);
                });

                // send IPC Message
                shellPage.SetRestartAdminSndMessageCallback(msg =>
                {
                    Program.GetTwoWayIPCManager().Send(msg);
                    System.Windows.Application.Current.Shutdown(); // close application
                });

                shellPage.SetElevationStatus(Program.IsElevated);
                shellPage.Refresh();
            }
        }
예제 #9
0
        public static IEnumerator GameplaySettingsMenuCoroutine()
        {
            if (shellInstance == null)
            {
                GameObject HMXshellpage = GameObject.Find("ShellPage_Settings");
                shellInstance      = GameObject.Instantiate(HMXshellpage, DebugTextPosition, Quaternion.Euler(0, 100, 0));
                shellInstance.name = "Custom_Page";
                SP = shellInstance.GetComponent <ShellPage>();

                Transform page = shellInstance.transform.GetChild(0);

                for (int i = 0; i < page.childCount; i++)
                {
                    Transform child = page.GetChild(i);
                    if (child.gameObject.name.Contains("backParent"))
                    {
                        child.gameObject.SetActive(false);
                    }
                }

                Transform ShellPanelCenter = page.transform.GetChild(0);
                Transform Settings         = ShellPanelCenter.transform.GetChild(2);
                Transform Options          = Settings.transform.GetChild(0);
                OM = Options.GetComponent <OptionsMenu>();
            }


            SP.SetPageActive(true, true);

            yield return(new WaitForSeconds(0.005f));

            OM.ShowPage(OptionsMenu.Page.Gameplay);
        }
예제 #10
0
        public override UIElement CreateRootElement(IStartArgsEx e)
        {
            var shellPage = new ShellPage();

            shellPage.MainNavView.Frame.RegisterNavigationService();
            return(shellPage);
        }
        public void RaisePropertyChanged([CallerMemberName] string propertyName = null)
        {
            OnPropertyChanged(propertyName);
            SndFancyZonesSettings outsettings = new SndFancyZonesSettings(Settings);
            SndModuleSettings <SndFancyZonesSettings> ipcMessage = new SndModuleSettings <SndFancyZonesSettings>(outsettings);

            ShellPage.DefaultSndMSGCallback(ipcMessage.ToJsonString());
        }
예제 #12
0
 public void NavigateToSection(Type type)
 {
     if (inst != null)
     {
         Activate();
         ShellPage.Navigate(type);
     }
 }
예제 #13
0
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            var shell = new ShellPage();

            Services.NavigationService.Setup(shell.MainNavigationView);
            Window.Current.Content = shell;
            Window.Current.Activate();
        }
예제 #14
0
        private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
        {
            // Hook up x:Bind source.
            WindowsXamlHost windowsXamlHost = sender as WindowsXamlHost;
            ShellPage       shellPage       = windowsXamlHost.GetUwpInternalObject() as ShellPage;

            if (shellPage != null)
            {
                // send IPC Message
                shellPage.SetDefaultSndMessageCallback(msg =>
                {
                    // IPC Manager is null when launching runner directly
                    Program.GetTwoWayIPCManager()?.Send(msg);
                });

                // send IPC Message
                shellPage.SetRestartAdminSndMessageCallback(msg =>
                {
                    Program.GetTwoWayIPCManager().Send(msg);
                    System.Windows.Application.Current.Shutdown(); // close application
                });

                // send IPC Message
                shellPage.SetCheckForUpdatesMessageCallback(msg =>
                {
                    Program.GetTwoWayIPCManager().Send(msg);
                });

                // receive IPC Message
                Program.IPCMessageReceivedCallback = (string msg) =>
                {
                    if (ShellPage.ShellHandler.IPCResponseHandleList != null)
                    {
                        try
                        {
                            JsonObject json = JsonObject.Parse(msg);
                            foreach (Action <JsonObject> handle in ShellPage.ShellHandler.IPCResponseHandleList)
                            {
                                handle(json);
                            }
                        }
                        catch (Exception)
                        {
                        }
                    }
                };

                shellPage.SetElevationStatus(Program.IsElevated);
                shellPage.SetIsUserAnAdmin(Program.IsUserAnAdmin);
                shellPage.Refresh();
            }

            // XAML Islands: If the window is open, explicity force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
            if (isOpen)
            {
                Show();
            }
        }
예제 #15
0
        public void RaisePropertyChanged([CallerMemberName] string propertyName = null)
        {
            // Notify UI of property change
            OnPropertyChanged(propertyName);

            OutGoingGeneralSettings outsettings = new OutGoingGeneralSettings(GeneralSettingsConfigs);

            ShellPage.DefaultSndMSGCallback(outsettings.ToString());
        }
        private void entranceInApp()
        {
            var shellPage = new ShellPage();

            NavigationServiceFactory(shellPage);

            NavigationService.Navigating += shellPage.NavigationService_Navigating;
            NavigationService.Navigated  += shellPage.NavigationService_Navigated;
        }
예제 #17
0
 public static async Task FillCaches()
 {
     ShellPage.SetSpinner(LoadingState.Loading);
     if (cloud != null)
     {
         await FaultReportAccess.FillCaches();
     }
     ShellPage.SetSpinner(LoadingState.Finished);
 }
        protected override void OnLoad(EventArgs e)
        {
            Assert.ArgumentNotNull((object)e, nameof(e));
            ShellPage.IsLoggedIn(true);
            base.OnLoad(e);
            ComponentArtGridHandler <PublishActivityItem> .Manage(this.PublishActivityGrid, (IGridSource <PublishActivityItem>) new GridSource <PublishActivityItem>(repository.GetAllPublishingItems()), this.RebindRequired);

            this.PublishActivityGrid.LocalizeGrid();
            this.WriteLanguageAndBrowserCssClass();
        }
예제 #19
0
        public MainWindow(MainViewModel viewModel, ShellPage shellPage, IServiceProvider serviceProvider)
        {
            ViewModel = viewModel;

            InitializeComponent();

            _shellPage       = shellPage;
            _serviceProvider = serviceProvider;

            this.Activated += MainWindow_Activated;
        }
예제 #20
0
        public void ConfigureAppPhase()
        {
            var shellPage = new ShellPage();

            NavigationServiceFactory(shellPage);

            NavigationService.Navigating += shellPage.NavigationService_Navigating;
            NavigationService.Navigated  += shellPage.NavigationService_Navigated;

            shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Dashboard); //Replace with better logic...
        }
예제 #21
0
        private void RaisePropertyChanged([CallerMemberName] string propertyName = null)
        {
            // Notify UI of property change
            OnPropertyChanged(propertyName);

            if (ShellPage.DefaultSndMSGCallback != null)
            {
                SndPowerPreviewSettings snd = new SndPowerPreviewSettings(Settings);
                SndModuleSettings <SndPowerPreviewSettings> ipcMessage = new SndModuleSettings <SndPowerPreviewSettings>(snd);
                ShellPage.DefaultSndMSGCallback(ipcMessage.ToJsonString());
            }
        }
예제 #22
0
파일: App.xaml.cs 프로젝트: Hoorge/MvpApi
        public override UIElement CreateRootElement(IActivatedEventArgs e)
        {
            var service = NavigationServiceFactory(BackButton.Attach, ExistingContent.Exclude);

            ShellPage = new ShellPage(service);

            return(new ModalDialog
            {
                DisableBackButtonWhenModal = true,
                Content = ShellPage
            });
        }
예제 #23
0
        public async Task InitAsync()
        {
            ShellPage.SetSpinner(LoadingState.Loading);
            Templates = await faultReportAccess.GetFaultReportTemplates();

            var triggers = await triggerAccess.GetSensorTriggersFor(Sensor.Id);

            Triggers = new ObservableCollection <SensorTriggerViewModel>(
                triggers.Select(t => new SensorTriggerViewModel(Sensor, t)));
            SelectedTrigger = Triggers.FirstOrDefault();
            ShellPage.SetSpinner(LoadingState.Finished);
        }
예제 #24
0
        // callback function to launch the URL to check for updates.
        private async void CheckForUpdates_Click()
        {
            GeneralSettings settings = SettingsUtils.GetSettings <GeneralSettings>(string.Empty);

            settings.CustomActionName = "check_for_updates";

            OutGoingGeneralSettings     outsettings  = new OutGoingGeneralSettings(settings);
            GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings);

            if (ShellPage.CheckForUpdatesMsgCallback != null)
            {
                ShellPage.CheckForUpdatesMsgCallback(customaction.ToString());
            }
        }
예제 #25
0
        public void Restart_Elevated()
        {
            GeneralSettings settings = SettingsUtils.GetSettings <GeneralSettings>(string.Empty);

            settings.CustomActionName = "restart_elevation";

            OutGoingGeneralSettings     outsettings  = new OutGoingGeneralSettings(settings);
            GeneralSettingsCustomAction customaction = new GeneralSettingsCustomAction(outsettings);

            if (ShellPage.SndRestartAsAdminMsgCallback != null)
            {
                ShellPage.SndRestartAsAdminMsgCallback(customaction.ToString());
            }
        }
예제 #26
0
        public App()
        {
            BackgroundAggregatorService.Add(() => new PeriodicSevice(3));

            //Start the background service
            BackgroundAggregatorService.StartBackgroundService();

            InitializeComponent();

            MainViewModel.GetInstance().About  = new AboutViewModel();
            MainViewModel.GetInstance().Search = new SearchViewModel();

            DependencyService.Register <MockDataStore>();
            //MainPage = new MainPage();
            MainPage = new ShellPage();
        }
예제 #27
0
        private static void InstallSensorFaultHandler()
        {
            SensorAccess.Faulted += async(sensor, fault, timestamp) =>
            {
                ShellPage.SetSpinner(LoadingState.Loading);
                var report = await SendFaultReport(sensor, fault, timestamp);

                ShellPage.SetSpinner(LoadingState.Finished);
                if (report == null)
                {
                    return;
                }

                string shortDescription = "Sensor Triggered";
                string longDescription  = "Sensor has entered Triggered State!\n\n" + sensor.FaultString(fault);

                ShellPage.Current.AddNotificatoin(NotificationType.Warning, shortDescription, longDescription);
            };
        }
예제 #28
0
        public override async Task OnStartAsync(IStartArgs args)
        {
            if (args.StartKind == StartKinds.Launch &&
                args.Arguments is ILaunchActivatedEventArgs e &&
                e != null)
            {
                var shell = new ShellPage(e.SplashScreen);
                Window.Current.Content = shell;
                Window.Current.Activate();

                await Task.Delay(1000);

                var frame = shell.MainFrame;
                var nav   = NavigationFactory.Create(frame)
                            .AttachGestures(Window.Current, Gesture.Refresh);

                await nav.NavigateAsync(nameof(SettingsPage));
            }
        }
        /// <summary>
        /// Checks the security.
        /// </summary>
        /// <exception cref="AccessDeniedException">
        /// Application access denied.
        /// </exception>
        protected virtual void CheckSecurity()
        {
            ShellPage.IsLoggedIn();

            var user = Context.User;

            if (user.IsAdministrator)
            {
                return;
            }

            var isDeveloping   = user.IsInRole("sitecore\\Sitecore Client Developing");
            var isMaintaining  = user.IsInRole("sitecore\\Sitecore Client Maintaining");
            var isAccessDenied = !isDeveloping && !isMaintaining;

            if (isAccessDenied)
            {
                throw new AccessDeniedException("Application access denied.");
            }
        }
예제 #30
0
        public async Task ConfigureAppPhase()
        {
            try
            {
                var shellPage = new ShellPage();

                NavigationServiceFactory(shellPage);

                NavigationService.Navigating += shellPage.NavigationService_Navigating;
                NavigationService.Navigated  += shellPage.NavigationService_Navigated;

                //cliente
                if (Helpers.Settings.DisplayUserRole == UserRole.Client.ToString() || Helpers.Settings.DisplayUserRole == UserRole.Guest.ToString())
                {
                    await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Home);
                }

                //gerente
                if (Helpers.Settings.DisplayUserRole == UserRole.Manager.ToString())
                {
                    if (string.IsNullOrEmpty(Helpers.Settings.DisplayUserCompany))
                    {
                        await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.Empresas);
                    }
                    else
                    {
                        await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.ClientList);
                    }
                }

                if (Helpers.Settings.DisplayUserRole == UserRole.Employee.ToString())
                {
                    await shellPage.Vm.NavigateToSelectedMenuItem(MenuListData.OrdersOpen);
                }
            }
            catch (Exception ex)
            {
                ex.ToString();
            }
        }
예제 #31
0
파일: App.xaml.cs 프로젝트: stephgou/Thot
        /// <summary>
        /// Invoked when the application is launched normally by the end user.  Other entry points
        /// will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override void OnLaunched(LaunchActivatedEventArgs e)
        {
            #if DEBUG
            if (System.Diagnostics.Debugger.IsAttached)
            {
                //   this.DebugSettings.EnableFrameRateCounter = true;
            }
            #endif

            Frame rootFrame = Window.Current.Content as Frame;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            ShellPage shellPage = Window.Current.Content as ShellPage;

            if (shellPage == null)
            {
                shellPage = new ShellPage();

                if (rootFrame == null)
                {
                    rootFrame = new Frame();
                    rootFrame.Language = Windows.Globalization.ApplicationLanguages.Languages[0];

                    rootFrame.NavigationFailed += OnNavigationFailed;

                    if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
                    {
                    }
                }

                shellPage.DataContext = rootFrame;

                Window.Current.Content = shellPage;
            }

            if (rootFrame.Content == null)
            {
                // When the navigation stack isn't restored navigate to the first page,
                // configuring the new page by passing required information as a navigation
                // parameter
                rootFrame.Navigate(typeof(WelcomePage));
            }
            // Ensure the current window is active
            Window.Current.Activate();
        }