Exemplo n.º 1
0
 protected void OnContentResolver(object sender, ContentLoadedEventArgs e)
 {
     switch (e.Metadata.LeftOf(","))
     {
     case FlowSharpCodeServiceInterfaces.Constants.META_EDITOR:
         Panel pnlEditor = new Panel()
         {
             Dock = DockStyle.Fill, Tag = FlowSharpCodeServiceInterfaces.Constants.META_EDITOR
         };
         e.DockContent.Controls.Add(pnlEditor);
         e.DockContent.Text  = "Editor";
         csCodeEditorService = ServiceManager.Get <IFlowSharpCodeEditorService>();
         csCodeEditorService.CreateEditor(pnlEditor);
         csCodeEditorService.AddAssembly("Clifton.Core.dll");
         break;
     }
 }
Exemplo n.º 2
0
        protected void OnFlowSharpInitialized(object sender, EventArgs args)
        {
            IDockingFormService dockingService = ServiceManager.Get <IDockingFormService>();
            Panel   dock      = dockingService.DockPanel;
            Control docCanvas = FindDocument(dockingService, FlowSharpServiceInterfaces.Constants.META_CANVAS);

            Control csDocEditor     = dockingService.CreateDocument(docCanvas, DockAlignment.Bottom, "C# Editor", FlowSharpCodeServiceInterfaces.Constants.META_EDITOR, 0.50);
            Control pnlCsCodeEditor = new Panel()
            {
                Dock = DockStyle.Fill
            };

            csDocEditor.Controls.Add(pnlCsCodeEditor);

            csCodeEditorService = ServiceManager.Get <IFlowSharpCodeEditorService>();
            csCodeEditorService.CreateEditor(pnlCsCodeEditor);
            csCodeEditorService.AddAssembly("Clifton.Core.dll");
        }
Exemplo n.º 3
0
        protected void OnContentResolver(object sender, ContentLoadedEventArgs e)
        {
            switch (e.Metadata.LeftOf(","))
            {
            case FlowSharpCodeServiceInterfaces.Constants.META_CSHARP_EDITOR:
                Panel pnlEditor = new Panel()
                {
                    Dock = DockStyle.Fill, Tag = FlowSharpCodeServiceInterfaces.Constants.META_CSHARP_EDITOR
                };
                e.DockContent.Controls.Add(pnlEditor);
                e.DockContent.Text = "C# Editor";
                IFlowSharpCodeEditorService csCodeEditorService = ServiceManager.Get <IFlowSharpCodeEditorService>();
                csCodeEditorService.CreateEditor(pnlEditor);
                csCodeEditorService.AddAssembly("Clifton.Core.dll");
                break;

            case FlowSharpCodeServiceInterfaces.Constants.META_OUTPUT:
                Panel pnlOutputWindow = new Panel()
                {
                    Dock = DockStyle.Fill, Tag = FlowSharpCodeServiceInterfaces.Constants.META_OUTPUT
                };
                e.DockContent.Controls.Add(pnlOutputWindow);
                e.DockContent.Text = "Output";
                IFlowSharpCodeOutputWindowService outputWindowService = ServiceManager.Get <IFlowSharpCodeOutputWindowService>();
                outputWindowService.CreateOutputWindow(pnlOutputWindow);
                break;

            case FlowSharpCodeServiceInterfaces.Constants.META_SCINTILLA_EDITOR:
                string language      = e.Metadata.RightOf(",");
                Panel  pnlCodeEditor = new Panel()
                {
                    Dock = DockStyle.Fill, Tag = language
                };
                e.DockContent.Controls.Add(pnlCodeEditor);
                e.DockContent.Text = language.CamelCase() + " Editor";

                IFlowSharpScintillaEditorService scintillaEditorService = ServiceManager.Get <IFlowSharpScintillaEditorService>();
                scintillaEditorService.CreateEditor(pnlCodeEditor, language);
                break;
            }
        }
Exemplo n.º 4
0
        protected IDockDocument CreateCSharpEditor()
        {
            IDockingFormService dockingService = ServiceManager.Get <IDockingFormService>();
            // Panel dock = dockingService.DockPanel;
            Control d = FindDocument(dockingService, FlowSharpCodeServiceInterfaces.Constants.META_SCINTILLA_EDITOR);

            if (d == null)
            {
                Control docCanvas = FindDocument(dockingService, FlowSharpServiceInterfaces.Constants.META_CANVAS);

                if (docCanvas == null)
                {
                    csDocEditor = dockingService.CreateDocument(DockState.Document, "C# Editor", FlowSharpCodeServiceInterfaces.Constants.META_CSHARP_EDITOR);
                }
                else
                {
                    csDocEditor = dockingService.CreateDocument(docCanvas, DockAlignment.Bottom, "C# Editor", FlowSharpCodeServiceInterfaces.Constants.META_CSHARP_EDITOR, 0.50);
                }
            }
            else
            {
                csDocEditor = dockingService.CreateDocument(d, DockState.Document, "C# Editor", FlowSharpCodeServiceInterfaces.Constants.META_CSHARP_EDITOR);
            }

            Control pnlCsCodeEditor = new Panel()
            {
                Dock = DockStyle.Fill
            };

            csDocEditor.Controls.Add(pnlCsCodeEditor);

            IFlowSharpCodeEditorService csCodeEditorService = ServiceManager.Get <IFlowSharpCodeEditorService>();

            csCodeEditorService.CreateEditor(pnlCsCodeEditor);
            csCodeEditorService.AddAssembly("Clifton.Core.dll");

            return((IDockDocument)csDocEditor);
        }