示例#1
0
        protected override void ComposeTree(TreeComposer composer)
        {
            switch (this.Engine.State)
            {
            case ExecutionState.Paused:
            {
                Actions.Action(composer, "nextline", EditorResources.Actions_NextLine, () =>
                    {
                        this.Engine.Continue(pauseAtNextLine: true);
                        return(Task.CompletedTask);
                    });

                Actions.Action(composer, "continue", EditorResources.Actions_Continue, () =>
                    {
                        this.Engine.Continue(pauseAtNextLine: false);
                        return(JSInterop.Monaco.RemoveDecorations());
                    });

                break;
            }

            case ExecutionState.Running:
            {
                Actions.Action(composer, "pause", EditorResources.Actions_Pause, () =>
                    {
                        this.Engine.Pause();
                        return(Task.CompletedTask);
                    });

                break;
            }
            }
        }
示例#2
0
 protected override void ComposeLeftActions(TreeComposer composer)
 {
     Actions.Action(composer, "back", EditorResources.Actions_Back, () =>
     {
         NavigationStore.NagivateTo(NavigationStore.PageId.Edit);
         return(Task.CompletedTask);
     });
 }
示例#3
0
 protected override void ComposeLeftActions(TreeComposer composer)
 {
     Actions.Action(composer, "new", EditorResources.Actions_New, onClick: () => JSInterop.Monaco.ClearEditor(EditorResources.Actions_ClearEverythingConfirmation));
     Actions.Separator(composer);
     Actions.Action(composer, "save", EditorResources.Actions_Save, onClick: JSInterop.Monaco.SaveToFile);
     Actions.Action(composer, "open", EditorResources.Actions_Open, onClick: () => JSInterop.Monaco.OpenFile(EditorResources.Actions_ClearEverythingConfirmation));
     Actions.DisabledAction(composer, "import", EditorResources.Actions_Import, message: EditorResources.Actions_DisabledMessage_ComingSoon);
     Actions.DisabledAction(composer, "publish", EditorResources.Actions_Publish, message: EditorResources.Actions_DisabledMessage_ComingSoon);
     Actions.Separator(composer);
     Actions.Action(composer, "cut", EditorResources.Actions_Cut, onClick: JSInterop.Monaco.Cut);
     Actions.Action(composer, "copy", EditorResources.Actions_Copy, onClick: JSInterop.Monaco.Copy);
     Actions.Action(composer, "paste", EditorResources.Actions_Paste, onClick: JSInterop.Monaco.Paste);
     Actions.Separator(composer);
     Actions.Action(composer, "undo", EditorResources.Actions_Undo, onClick: JSInterop.Monaco.Undo);
     Actions.Action(composer, "redo", EditorResources.Actions_Redo, onClick: JSInterop.Monaco.Redo);
 }
示例#4
0
        protected override void ComposeTree(TreeComposer composer)
        {
            if (CompilationStore.Compilation.Diagnostics.Any())
            {
                string message = string.Format(CultureInfo.CurrentCulture, EditorResources.Errors_Count, CompilationStore.Compilation.Diagnostics.Count);
                Actions.DisabledAction(composer, "debug", EditorResources.Actions_Debug, message: message);
                Actions.DisabledAction(composer, "run", EditorResources.Actions_Run, message: message);
            }
            else
            {
                Actions.Action(composer, "debug", EditorResources.Actions_Debug, onClick: () =>
                {
                    NavigationStore.NagivateTo(NavigationStore.PageId.Debug);
                    return(Task.CompletedTask);
                });

                Actions.Action(composer, "run", EditorResources.Actions_Run, onClick: () =>
                {
                    NavigationStore.NagivateTo(NavigationStore.PageId.Run);
                    return(Task.CompletedTask);
                });
            }
        }