Beispiel #1
0
        /// <summary>
        /// 写日志到指定文件
        /// </summary>
        /// <param name="fileName">文件名</param>
        /// <param name="txt">内容</param>
        public static void WriteToFile(string fileName, string txt)
        {
            if (fileName == "")
            {
                fileName = "Log";
            }
            string text = BrowserTool.GetAppPath();

            string text2 = text;

            text = string.Concat(new string[] { text2, "/Log/", fileName, "_", DateTime.Now.ToString("yyyyMMdd"), ".log" });

            Log.Write(text, "/*******************************************************************************************************");
            Log.Write(text, string.Concat(new string[] { "* DateTime: ", DateTime.Now.ToString(), "\t\tIP: ", BrowserTool.GetIp(), "\t\tBrower: ", BrowserTool.GetOS(), "  ", BrowserTool.GetBrowser() }));
            Log.Write(text, "* Url : " + BrowserTool.GetUrl());

            Log.Write(text, txt);
            Log.Write(text, "*******************************************************************************************************/");
            Log.Write(text, "");
        }
Beispiel #2
0
        /// <inheritdoc/>
        public override IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var dataTool = new DataTool
            {
                Id    = nameof(DataTool),
                Title = "Data"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLeft",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftTop",
                        Proportion  = double.NaN,
                        CurrentView = projectTool,
                        Views       = new ObservableCollection <IView>
                        {
                            projectTool,
                            optionsTool,
                            imagesTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorLeftBottom",
                        Proportion  = double.NaN,
                        CurrentView = groupsTool,
                        Views       = new ObservableCollection <IView>
                        {
                            groupsTool,
                            databasesTool,
                            scriptTool,
                            browserTool
                        }
                    }
                }
            };

            var rightPane = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorRight",
                Orientation = Orientation.Vertical,
                Proportion  = 0.17,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightTop",
                        Proportion  = double.NaN,
                        CurrentView = stylesTool,
                        Views       = new ObservableCollection <IView>
                        {
                            stylesTool,
                            templatesTool,
                            containerTool,
                            zoomTool
                        }
                    },
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightTopSplitter"
                    },
                    new ToolDock
                    {
                        Id          = nameof(IToolDock),
                        Title       = "EditorRightBottom",
                        Proportion  = double.NaN,
                        CurrentView = shapeTool,
                        Views       = new ObservableCollection <IView>
                        {
                            shapeTool,
                            toolsTool,
                            dataTool,
                            styleTool,
                            templateTool
                        }
                    }
                }
            };

            var documentsPane = new DocumentDock
            {
                Id          = nameof(IDocumentDock),
                Title       = "DocumentsPane",
                Proportion  = double.NaN,
                CurrentView = pageDocument,
                Views       = new ObservableCollection <IView>
                {
                    pageDocument
                }
            };

            // Editor

            var editorLayout = new LayoutDock
            {
                Id          = nameof(ILayoutDock),
                Title       = "EditorLayout",
                Orientation = Orientation.Horizontal,
                Proportion  = double.NaN,
                CurrentView = null,
                Views       = new ObservableCollection <IView>
                {
                    leftPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "LeftSplitter"
                    },
                    documentsPane,
                    new SplitterDock()
                    {
                        Id    = nameof(ISplitterDock),
                        Title = "RightSplitter"
                    },
                    rightPane
                }
            };

            // Views

            var editorView = new EditorView
            {
                Id          = nameof(EditorView),
                Title       = "Editor",
                CurrentView = editorLayout,
                Views       = new ObservableCollection <IView>
                {
                    editorLayout
                }
            };

            var aboutView = new AboutView
            {
                Id    = nameof(AboutView),
                Title = "About"
            };

            var browserView = new BrowserView
            {
                Id    = nameof(BrowserView),
                Title = "Browser"
            };

            var scriptView = new ScriptView
            {
                Id    = nameof(ScriptView),
                Title = "Script"
            };

            var documentView = new DocumentView
            {
                Id    = nameof(DocumentView),
                Title = "Document"
            };

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            // Root

            var layout = new RootDock
            {
                Id          = nameof(IRootDock),
                Title       = "Root",
                CurrentView = dashboardView,
                DefaultView = dashboardView,
                Views       = new ObservableCollection <IView>
                {
                    dashboardView,
                    editorView,
                    aboutView,
                    browserView,
                    scriptView,
                    documentView
                }
            };

            return(layout);
        }
Beispiel #3
0
        /// <inheritdoc/>
        public override DM.IDock CreateLayout()
        {
            // Documents

            var pageDocument = new PageDocument
            {
                Id    = nameof(PageDocument),
                Title = "Page"
            };

            // Tools

            var projectTool = new ProjectTool
            {
                Id    = nameof(ProjectTool),
                Title = "Project"
            };

            var optionsTool = new OptionsTool
            {
                Id    = nameof(OptionsTool),
                Title = "Options"
            };

            var imagesTool = new ImagesTool
            {
                Id    = nameof(ImagesTool),
                Title = "Images"
            };

            var groupsTool = new GroupsTool
            {
                Id    = nameof(GroupsTool),
                Title = "Groups"
            };

            var databasesTool = new DatabasesTool
            {
                Id    = nameof(DatabasesTool),
                Title = "Databases"
            };

            var scriptTool = new ScriptTool
            {
                Id    = nameof(ScriptTool),
                Title = "Script"
            };

            var exportTool = new ExportTool
            {
                Id    = nameof(ExportTool),
                Title = "Export"
            };

            var browserTool = new BrowserTool
            {
                Id    = nameof(BrowserTool),
                Title = "Browser"
            };

            var documentTool = new DocumentTool
            {
                Id    = nameof(DocumentTool),
                Title = "Document"
            };

            var stylesTool = new StylesTool
            {
                Id    = nameof(StylesTool),
                Title = "Styles"
            };

            var templatesTool = new TemplatesTool
            {
                Id    = nameof(TemplatesTool),
                Title = "Templates"
            };

            var scriptsTool = new ScriptsTool
            {
                Id    = nameof(ScriptsTool),
                Title = "Scripts"
            };

            var containerTool = new ContainerTool
            {
                Id    = nameof(ContainerTool),
                Title = "Container"
            };

            var zoomTool = new ZoomTool
            {
                Id    = nameof(ZoomTool),
                Title = "Zoom"
            };

            var rendererTool = new RendererTool
            {
                Id    = nameof(RendererTool),
                Title = "Renderer"
            };

            var shapeTool = new ShapeTool
            {
                Id    = nameof(ShapeTool),
                Title = "Shape"
            };

            var toolsTool = new ToolsTool
            {
                Id    = nameof(ToolsTool),
                Title = "Tools"
            };

            var recordTool = new RecordTool
            {
                Id    = nameof(RecordTool),
                Title = "Record"
            };

            var propertiesTool = new PropertiesTool
            {
                Id    = nameof(PropertiesTool),
                Title = "Properties"
            };

            var styleTool = new StyleTool
            {
                Id    = nameof(StyleTool),
                Title = "Style"
            };

            var templateTool = new TemplateTool
            {
                Id    = nameof(TemplateTool),
                Title = "Template"
            };

            // Panes

            var leftPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLeft",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.17,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = projectTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        projectTool,
                        optionsTool,
                        rendererTool,
                        imagesTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorLeftBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = groupsTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        groupsTool,
                        databasesTool,
                        toolsTool,
                        scriptsTool
                                       )
                }
                                   )
            };

            var rightPane = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorRight",
                Orientation      = DM.Orientation.Vertical,
                Proportion       = 0.20,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightTop",
                    Proportion       = double.NaN,
                    ActiveDockable   = stylesTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        stylesTool,
                        containerTool,
                        templatesTool,
                        templateTool
                                       )
                },
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightTopSplitter"
                },
                    new DMC.ToolDock
                {
                    Id               = nameof(DMC.IToolDock),
                    Title            = "EditorRightBottom",
                    Proportion       = double.NaN,
                    ActiveDockable   = shapeTool,
                    VisibleDockables = CreateList <DM.IDockable>
                                       (
                        shapeTool,
                        propertiesTool,
                        recordTool,
                        styleTool,
                        zoomTool
                                       )
                }
                                   )
            };

            var documentsPane = new DMC.DocumentDock
            {
                Id               = nameof(DMC.IDocumentDock),
                Title            = "DocumentsPane",
                IsCollapsable    = false,
                Proportion       = double.NaN,
                ActiveDockable   = pageDocument,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    pageDocument,
                    documentTool,
                    scriptTool,
                    exportTool,
                    browserTool
                                   )
            };

            // Editor

            var editorLayout = new DMC.ProportionalDock
            {
                Id               = nameof(DMC.IProportionalDock),
                Title            = "EditorLayout",
                Orientation      = DM.Orientation.Horizontal,
                Proportion       = double.NaN,
                ActiveDockable   = null,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    leftPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "LeftSplitter"
                },
                    documentsPane,
                    new DMC.SplitterDock()
                {
                    Id    = nameof(DMC.ISplitterDock),
                    Title = "RightSplitter"
                },
                    rightPane
                                   )
            };

            // Views

            var dashboardView = new DashboardView
            {
                Id    = nameof(DashboardView),
                Title = "Dashboard"
            };

            var editorView = new EditorView
            {
                Id               = nameof(EditorView),
                Title            = "Editor",
                ActiveDockable   = editorLayout,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    editorLayout
                                   )
            };

            // Root

            var root = new DMC.RootDock
            {
                Id               = nameof(DMC.IRootDock),
                Title            = "Root",
                IsCollapsable    = false,
                ActiveDockable   = dashboardView,
                DefaultDockable  = dashboardView,
                VisibleDockables = CreateList <DM.IDockable>
                                   (
                    dashboardView,
                    editorView
                                   )
            };

            root.Top              = CreatePinDock();
            root.Top.Alignment    = DM.Alignment.Top;
            root.Bottom           = CreatePinDock();
            root.Bottom.Alignment = DM.Alignment.Bottom;
            root.Left             = CreatePinDock();
            root.Left.Alignment   = DM.Alignment.Left;
            root.Right            = CreatePinDock();
            root.Right.Alignment  = DM.Alignment.Right;

            return(root);
        }