Beispiel #1
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));
         }
     }
 }
Beispiel #2
0
        public IList <ModuleInfo> getAddonsAvailable(bool system_addons)
        {
            IList <ModuleInfo> list_addons_final = new List <ModuleInfo>();
            List <InfosModule> list_addons       = ModulesAccessManager.GetModules(system_addons);

            foreach (InfosModule theme in list_addons.Where(n => n.ModuleType == SerrisModulesServer.Type.ModuleTypesList.Addon).ToList())
            {
                list_addons_final.Add(new ModuleInfo {
                    ID = theme.ID, moduleSystem = theme.ModuleSystem, moduleName = theme.ModuleName, moduleAuthor = theme.ModuleAuthor, moduleDescription = theme.ModuleDescription, moduleWebsiteLink = theme.ModuleWebsiteLink, containMonacoTheme = theme.ContainMonacoTheme, isEnabled = theme.IsEnabled, isPinnedToToolbar = theme.CanBePinnedToToolBar, moduleVersion = new ModuleInfoVersion {
                        major = theme.ModuleVersion.Major, minor = theme.ModuleVersion.Minor, revision = theme.ModuleVersion.Revision
                    }
                });
            }

            return(list_addons_final);
        }
Beispiel #3
0
        private async void LoadModules()
        {
            ListModules.Items.Clear();
            int IDThemeMonaco = ModulesAccessManager.GetCurrentThemeMonacoID(), IDTheme = ModulesAccessManager.GetCurrentThemeID();

            switch (currentSelectedButton)
            {
            default:
                ListModules.SelectionMode = ListViewSelectionMode.Single;
                break;

            case 2:
            case 3:
                ListModules.SelectionMode = ListViewSelectionMode.None;
                break;
            }

            foreach (InfosModule module in ModulesAccessManager.GetModules(true))
            {
                ModuleInfosShow ModuleInfos = new ModuleInfosShow {
                    Module = module, StrokeThickness = 0
                };
                ModuleInfos.Thumbnail = await ModulesAccessManager.GetModuleDefaultLogoViaIDAsync(ModuleInfos.Module.ID, ModuleInfos.Module.ModuleSystem);

                switch (module.ModuleType)
                {
                case ModuleTypesList.Templates when currentSelectedButton == 3:
                case ModuleTypesList.ProgrammingLanguage when currentSelectedButton == 2:
                case ModuleTypesList.Addon when currentSelectedButton == 0:
                    ListModules.Items.Add(ModuleInfos);
                    break;

                case ModuleTypesList.Theme when currentSelectedButton == 1:
                    if (IDTheme == ModuleInfos.Module.ID || IDThemeMonaco == ModuleInfos.Module.ID)
                    {
                        ModuleInfos.StrokeThickness = 2;
                    }

                    ListModules.Items.Add(ModuleInfos);
                    break;
                }
            }
        }
Beispiel #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;
            }
        }