コード例 #1
0
        private async Task AddModule(string ID)
        {
            await DispatcherHelper.ExecuteOnUIThreadAsync(async() =>
            {
                StackPanel Widget       = await new AddonReader(ID).GetAddonWidgetViaIDAsync(new SCEELibs.SCEELibs(ID), GlobalVariables.CurrentTheme);
                Widget.PointerReleased += ((e, f) =>
                {
                    MenuFlyout Flyout = new MenuFlyout();
                    MenuFlyoutItem UnpinButton = new MenuFlyoutItem {
                        Text = "Unpin this widget"
                    };
                    UnpinButton.Click += ((a, c) =>
                    {
                        ModulesPinned.RemoveModule(ID);
                    });

                    Flyout.Items.Add(UnpinButton);
                    Flyout.ShowAt((FrameworkElement)e);
                });

                ToolbarContent.Children.Add(Widget);
            });

            SCEELibs.SCEELibs Libs = new SCEELibs.SCEELibs(ID);
            await Task.Run(() => new AddonExecutor(ID, Libs).ExecuteDefaultFunction(AddonExecutorFuncTypes.whenModuleIsPinned));
        }
コード例 #2
0
        private async Task AddModule(string ID)
        {
            await DispatcherHelper.ExecuteOnUIThreadAsync(async() =>
            {
                ToolbarContent.Children.Add(await new AddonReader(ID).GetAddonWidgetViaIDAsync(new SCEELibs.SCEELibs(ID), GlobalVariables.CurrentTheme));
            });

            SCEELibs.SCEELibs Libs = new SCEELibs.SCEELibs(ID);
            await Task.Run(() => new AddonExecutor(ID, Libs).ExecuteDefaultFunction(AddonExecutorFuncTypes.whenModuleIsPinned));
        }
コード例 #3
0
 private async void ExecuteModulesFunction()
 {
     //onEditorViewReady
     foreach (InfosModule Module in ModulesAccessManager.GetModules(true))
     {
         if (Module.IsEnabled && Module.ModuleType == SerrisModulesServer.Type.ModuleTypesList.Addon)
         {
             SCEELibs.SCEELibs Libs = new SCEELibs.SCEELibs(Module.ID);
             await Task.Run(() => new AddonExecutor(Module.ID, Libs).ExecuteDefaultFunction(AddonExecutorFuncTypes.onEditorViewReady));
         }
     }
 }
コード例 #4
0
        private async void SetInterface()
        {
            switch (GlobalVariables.CurrentDevice)
            {
            case CurrentDevice.WindowsMobile:
                //UI modification for mobile
                PrincipalUI.VerticalAlignment                  = VerticalAlignment.Bottom;
                ColorPrincipalUI.VerticalAlignment             = VerticalAlignment.Bottom;
                BackgroundPrincipalUIControl.VerticalAlignment = VerticalAlignment.Bottom;
                Console.Height = 30;
                SheetViewSplit.OpenPaneLength = MasterGrid.ActualWidth - 40;
                Grid.SetColumnSpan(Toolbar, 1);
                TextInfoTitlebar.Margin      = new Thickness(0);
                ContentViewerGrid.Margin     = new Thickness(0, 0, 0, 75);
                SheetViewSplit.Margin        = new Thickness(0, 0, 0, 75);
                TextInfoTitlebar.Visibility  = Visibility.Collapsed;
                TopSheetViewSplit.Visibility = Visibility.Collapsed;

                ToolbarWidth.Width       = new GridLength(1, GridUnitType.Star);
                FocusTitlebarWidth.Width = new GridLength(0, GridUnitType.Pixel);

                StatusBar.GetForCurrentView().ProgressIndicator.Text = "Serris Code Editor MLV";
                UpdateUI(true, true);
                break;

            case CurrentDevice.Desktop:

                if (AppSettings.Values.ContainsKey("ui_extendedview"))
                {
                    if (!(bool)AppSettings.Values["ui_extendedview"])
                    {
                        ContentViewerGrid.Margin    = new Thickness(60, ColorPrincipalUI.ActualHeight, 0, 0);
                        DeployUIDetector.Visibility = Visibility.Visible;
                    }
                    else
                    {
                        ContentViewerGrid.Margin    = new Thickness(60, 0, 0, 0);
                        DeployUIDetector.Visibility = Visibility.Collapsed;
                    }
                }
                else
                {
                    ContentViewerGrid.Margin = new Thickness(60, ColorPrincipalUI.ActualHeight, 0, 0);
                }

                //CLOSE PANEL AUTOMATICALLY
                if (AppSettings.Values.ContainsKey("ui_closepanelauto"))
                {
                    ClosePanelAuto = (bool)AppSettings.Values["ui_closepanelauto"];
                }

                //LEFT PANE REDUCED SETTING
                if (AppSettings.Values.ContainsKey("ui_leftpanelength"))
                {
                    TopSheetViewSplit.Width          = (int)AppSettings.Values["ui_leftpanelength"];
                    SheetViewSplit.CompactPaneLength = (int)AppSettings.Values["ui_leftpanelength"];
                    ContentViewerGrid.Margin         = new Thickness((int)AppSettings.Values["ui_leftpanelength"], ContentViewerGrid.Margin.Top, 0, 0);
                }

                //LEFT PANE OPENED SETTING
                if (AppSettings.Values.ContainsKey("ui_leftpaneopenlength"))
                {
                    SheetViewSplit.OpenPaneLength = (int)AppSettings.Values["ui_leftpaneopenlength"];
                }

                SetTilebarText("");
                CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

                Window.Current.SetTitleBar(focus_titlebar);
                UpdateUI(false, true);
                break;
            }

            if (!EditorStartModulesEventsLaunched)
            {
                //onEditorStart
                foreach (InfosModule Module in ModulesAccessManager.GetModules(true))
                {
                    if (Module.IsEnabled && Module.ModuleType == SerrisModulesServer.Type.ModuleTypesList.Addon)
                    {
                        SCEELibs.SCEELibs Libs = new SCEELibs.SCEELibs(Module.ID);
                        await Task.Run(() => new AddonExecutor(Module.ID, Libs).ExecuteDefaultFunction(AddonExecutorFuncTypes.onEditorStart));
                    }
                }

                EditorStartModulesEventsLaunched = true;
            }
        }
コード例 #5
0
        private async void SetInterface()
        {
            switch (GlobalVariables.CurrentDevice)
            {
            case CurrentDevice.WindowsMobile:
                //UI modification for mobile
                PrincipalUI.VerticalAlignment                  = VerticalAlignment.Bottom;
                ColorPrincipalUI.VerticalAlignment             = VerticalAlignment.Bottom;
                BackgroundPrincipalUIControl.VerticalAlignment = VerticalAlignment.Bottom;
                Console.Height = 30;
                SheetViewSplit.OpenPaneLength = MasterGrid.ActualWidth - 40;
                Grid.SetColumnSpan(Toolbar, 1);
                //Toolbar.HorizontalAlignment = HorizontalAlignment.Stretch;
                TextInfoTitlebar.Margin      = new Thickness(0);
                ContentViewerGrid.Margin     = new Thickness(0, 0, 0, 75);
                TextInfoTitlebar.Visibility  = Visibility.Collapsed;
                TopSheetViewSplit.Visibility = Visibility.Collapsed;

                StatusBar.GetForCurrentView().ProgressIndicator.Text = "Serris Code Editor MLV";
                UpdateUI(true);
                break;

            case CurrentDevice.Desktop:

                if (AppSettings.Values.ContainsKey("ui_extendedview"))
                {
                    if (!(bool)AppSettings.Values["ui_extendedview"])
                    {
                        ContentViewerGrid.Margin           = new Thickness(60, 73, 0, 0);
                        BackgroundPrincipalUIControl.Color = Colors.Transparent;
                    }
                    else
                    {
                        ContentViewerGrid.Margin           = new Thickness(60, 0, 0, 0);
                        DeployUIDetector.Visibility        = Visibility.Collapsed;
                        BackgroundPrincipalUIControl.Color = Colors.Black;
                    }
                }
                else
                {
                    ContentViewerGrid.Margin           = new Thickness(60, 73, 0, 0);
                    BackgroundPrincipalUIControl.Color = Colors.Transparent;
                }

                //CLOSE PANEL AUTOMATICALLY
                if (AppSettings.Values.ContainsKey("ui_closepanelauto"))
                {
                    ClosePanelAuto = (bool)AppSettings.Values["ui_closepanelauto"];
                }

                TextInfoTitlebar.Text = "Serris Code Editor - " + SCEELibs.SCEInfos.versionName;
                CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
                CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;

                Window.Current.SetTitleBar(focus_titlebar);
                UpdateUI(false);
                break;
            }


            //onEditorStart
            foreach (InfosModule Module in await ModulesAccessManager.GetModulesAsync(true))
            {
                if (Module.IsEnabled && Module.ModuleType == SerrisModulesServer.Type.ModuleTypesList.Addon)
                {
                    SCEELibs.SCEELibs Libs = new SCEELibs.SCEELibs(Module.ID);
                    await Task.Run(() => new AddonExecutor(Module.ID, Libs).ExecuteDefaultFunction(AddonExecutorFuncTypes.onEditorStart));
                }
            }
        }