Ejemplo n.º 1
0
        public frmMain()
        {
            InitializeComponent();

            PipelineHelper.DefaultInit();

            builder = new ContentBuilder(null);
            builder.BuildStatusChanged += Builder_BuildStatusChanged;
            builder.ItemProgress       += Builder_ItemProgress;
            builder.BuildMessage       += Builder_BuildMessage;
            treeMap = new Dictionary <ContentItem, TreeNode>();

            treeContentFiles.NodeMouseClick += TreeContentFilesOnNodeMouseClick;

            this.newFolderMenuItem.Click        += (o, e) => AddNewFolder.Execute(GetSelectedItem(), CurrentProject.File);
            this.existingFolderMenuItem.Click   += (o, e) => AddExistingFolder.Execute(GetSelectedItem(), CurrentProject.File);
            this.existingItemMenuItem.Click     += (o, e) => AddExistingItem.Execute(GetSelectedItem(), CurrentProject.File);
            this.deleteMenuItem.Click           += (o, e) => DeleteItem.Execute(GetSelectedItem());
            this.deleteToolStripMenuItem.Click  += (o, e) => DeleteItem.Execute(GetSelectedItem());
            this.deleteToolStripMenuItem1.Click += (o, e) => DeleteItem.Execute(GetSelectedItem());
            this.renameMenuItem.Click           += (o, e) => RenameItem.Execute(GetSelectedItem(), treeMap);
            this.renameToolStripMenuItem.Click  += (o, e) => RenameItem.Execute(GetSelectedItem(), treeMap);
            this.renameToolStripMenuItem1.Click += (o, e) => RenameItem.Execute(GetSelectedItem(), treeMap);
            this.buildToolStripMenuItem.Click   += (o, e) => BuildItem.Execute(GetSelectedItem(), builder);
            this.buildToolStripMenuItem1.Click  += (o, e) => BuildItem.Execute(GetSelectedItem(), builder);
            this.buildToolStripMenuItem2.Click  += (o, e) => BuildItem.Execute(GetSelectedItem(), builder);
        }
Ejemplo n.º 2
0
        public frmMain()
        {
            InitializeComponent();

            PipelineHelper.DefaultInit();

            builder = new ContentBuilder(null);
            builder.BuildStatusChanged += Builder_BuildStatusChanged;
            builder.ItemProgress       += Builder_ItemProgress;
            builder.BuildMessage       += Builder_BuildMessage;
            treeMap = new Dictionary <ContentItem, TreeNode>();
        }
Ejemplo n.º 3
0
        private static string getProcessor(string name)
        {
            var tp = PipelineHelper.GetImporterType(System.IO.Path.GetExtension(name));

            if (tp != null)
            {
                foreach (var attr in tp.GetCustomAttributes(true).Select(x => x as engenious.Content.Pipeline.ContentImporterAttribute))
                {
                    if (attr == null)
                    {
                        continue;
                    }
                    return(attr.DefaultProcessor);
                }
            }
            return("");
        }
Ejemplo n.º 4
0
        private void treeContentFiles_AfterSelect(object sender, TreeViewEventArgs e)
        {
            prpItem.SelectedObject = e.Node.Tag;
            panel_editor.Controls.Clear();
            ContentFile file = e.Node.Tag as ContentFile;

            if (file == null || file.Importer == null || file.Processor == null)
            {
                return;
            }
            var editorWrap = PipelineHelper.GetContentEditor(Path.GetExtension(file.Name), file.Importer.ExportType, file.Processor.ExportType);

            if (editorWrap == null)
            {
                return;
            }
            var absPath      = Path.Combine(Path.GetDirectoryName(CurrentProject.File), file.getPath());
            var importValue  = file.Importer.Import(absPath, new ContentImporterContext());
            var processValue = file.Processor.Process(importValue, absPath,
                                                      new ContentProcessorContext());

            editorWrap.Open(importValue, processValue);
            panel_editor.Controls.Add(editorWrap.Editor.MainControl);
        }