Ejemplo n.º 1
0
        /// <summary>
        /// Initialize this module via standard PRISM MEF procedure
        /// </summary>
        private void Initialize(IAvalonDockLayoutViewModel avLayout,
                                IToolWindowRegistry toolRegistry,
                                IDocumentTypeManager documentTypeManager)
        {
            this.RegisterDataTemplates(avLayout.ViewProperties.SelectPanesTemplate);
            this.RegisterStyles(avLayout.ViewProperties.SelectPanesStyle);

            toolRegistry.RegisterTool(new Log4NetToolViewModel());
            toolRegistry.RegisterTool(new Log4NetMessageToolViewModel());

            var docType = documentTypeManager.RegisterDocumentType
                              (Log4NetViewModel.DocumentKey,
                              Log4NetViewModel.Description,
                              Log4NetViewModel.FileFilterName,
                              Log4NetViewModel.DefaultFilter,
                              Log4NetViewModel.LoadFile,
                              null,             // Log4Net Grid Viewer is a readonly viewer
                              typeof(Log4NetViewModel), 40);

            if (docType != null)
            {
                var t = docType.CreateItem("log4net XML output", new List <string>()
                {
                    "log4j", "log", "txt", "xml"
                }, 35);
                docType.RegisterFileTypeItem(t);
            }
        }
Ejemplo n.º 2
0
        private void RegisterEdiTextEditor(IDocumentTypeManager documentTypeManager)
        {
            // Register these patterns for the build in AvalonEdit text editor
            // All Files (*.*)|*.*
            var docType = documentTypeManager.RegisterDocumentType(EdiViewModel.DocumentKey,
                                                                   EdiViewModel.Description,
                                                                   EdiViewModel.FileFilterName,
                                                                   EdiViewModel.DefaultFilter,
                                                                   EdiViewModel.LoadFile,
                                                                   EdiViewModel.CreateNewDocument,
                                                                   typeof(EdiViewModel),
                                                                   10);

            if (docType != null)             // Lets register some sub-types for editing with Edi's text editor
            {
                // Text Files (*.txt)|*.txt
                // C# Files (*.cs)|*.cs
                // HTML Files (*.htm,*.html,*.css,*.js)|*.htm;*.html;*.css;*.js
                // Structured Query Language (*.sql) |*.sql
                var t = docType.CreateItem("Text Files", new List <string>()
                {
                    "txt"
                }, 12);
                docType.RegisterFileTypeItem(t);

                t = docType.CreateItem("C# Files", new List <string>()
                {
                    "cs", "xaml", "config"
                }, 14);
                docType.RegisterFileTypeItem(t);

                t = docType.CreateItem("HTML Files", new List <string>()
                {
                    "htm", "html", "css", "js"
                }, 16);
                docType.RegisterFileTypeItem(t);

                t = docType.CreateItem("Structured Query Language", new List <string>()
                {
                    "sql"
                }, 18);
                docType.RegisterFileTypeItem(t);
            }
        }
Ejemplo n.º 3
0
        private void RegisterMiniUml(IDocumentTypeManager documentTypeManager)
        {
            // Unified Modeling Language (*.uml,*.xml)|*.uml;*.xml
            var docType = documentTypeManager.RegisterDocumentType(MiniUmlViewModel.DocumentKey,
                                                                   MiniUmlViewModel.Description,
                                                                   MiniUmlViewModel.FileFilterName,
                                                                   MiniUmlViewModel.DefaultFilter,
                                                                   MiniUmlViewModel.LoadFile,
                                                                   null,
                                                                   typeof(MiniUmlViewModel),
                                                                   90);

            if (docType != null)             // Lets register some sub-types for editing with Edi's text editor
            {
                var t = docType.CreateItem("UML Files", new List <string>()
                {
                    "uml", "xml"
                }, 92);
                docType.RegisterFileTypeItem(t);
            }
        }