Ejemplo n.º 1
0
        private bool OnExecute(TemplateDisplaySurface surface)
        {
            try
            {
                if (surface.GatherUserInput())
                {
                    Hashtable ht = surface.CacheUserInput();

                    if (this.projectTree.SelectedNode != null && this.projectTree.SelectedNode.Tag != null)
                    {
                        ProjectNodeData tag = this.projectTree.SelectedNode.Tag as ProjectNodeData;
                        tag.Input = ht;
                    }
                    else
                    {
                        AddRecordedTemplate(surface, true);
                        isDirty = true;
                    }
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                throw;
                this.MainWindow.ShowError(ex);
                return(false);
            }

            return(true);
        }
        private bool OnExecute(TemplateDisplaySurface surface)
        {
            try
            {
                if (surface.GatherUserInput())
                {
                    Template temp = new Template();
                    temp.Execute(surface.esMeta, surface.Template.Header.FullFileName);

                    surface.CacheUserInput();

                    this.MainWindow.ShowStatusMessage("Template '" + surface.Template.Header.Title + "' generated successfully.");
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                this.MainWindow.ShowError(ex);
                return(false);
            }

            return(true);
        }
Ejemplo n.º 3
0
        public void AddRecordedTemplate(TemplateDisplaySurface surface, bool beginEdit)
        {
            try
            {
                TreeNode node = this.projectTree.SelectedNode;

                if (node == null)
                {
                    node = this.projectTree.Nodes[0];
                }

                if (node != null)
                {
                    TreeNode recordedTemplate = new TreeNode(surface.Template.Header.Title);
                    recordedTemplate.ImageIndex         = 2;
                    recordedTemplate.SelectedImageIndex = 2;
                    recordedTemplate.ContextMenuStrip   = menuTemplate;
                    node.Nodes.Add(recordedTemplate);

                    ProjectNodeData tag = new ProjectNodeData();
                    tag.Template         = surface.Template;
                    tag.Input            = surface.CacheUserInput();
                    tag.Settings         = Settings.Clone();
                    recordedTemplate.Tag = tag;

                    node.Expand();
                    isDirty = true;

                    this.projectTree.SelectedNode = recordedTemplate;

                    if (beginEdit)
                    {
                        recordedTemplate.BeginEdit();
                    }
                }
            }
            catch (Exception ex)
            {
                this.MainWindow.ShowError(ex);
            }
        }
        private bool OnExecute(TemplateDisplaySurface surface)
        {
            try
            {
                if (surface.GatherUserInput())
                {
                    Template temp = new Template();
                    temp.Execute(surface.esMeta, surface.Template.Header.FullFileName);

                    surface.CacheUserInput();

                    this.MainWindow.ShowStatusMessage("Template '" + surface.Template.Header.Title + "' generated successfully.");
                }
                else return false;
            }
            catch (Exception ex)
            {
                this.MainWindow.ShowError(ex);
                return false;
            }

            return true;
        }
        public void AddRecordedTemplate(TemplateDisplaySurface surface, bool beginEdit)
        {
            try
            {
                TreeNode node = this.projectTree.SelectedNode;

                if (node == null)
                {
                    node = this.projectTree.Nodes[0];
                }

                if (node != null)
                {
                    TreeNode recordedTemplate = new TreeNode(surface.Template.Header.Title);
                    recordedTemplate.ImageIndex = 2;
                    recordedTemplate.SelectedImageIndex = 2;
                    recordedTemplate.ContextMenuStrip = menuTemplate;
                    node.Nodes.Add(recordedTemplate);

                    ProjectNodeData tag = new ProjectNodeData();
                    tag.Template = surface.Template;
                    tag.Input = surface.CacheUserInput();
                    tag.Settings = Settings.Clone();
                    recordedTemplate.Tag = tag;
        
                    node.Expand();
                    isDirty = true;

                    this.projectTree.SelectedNode = recordedTemplate;

                    if (beginEdit)
                    {
                        recordedTemplate.BeginEdit();
                    }
                }
            }
            catch (Exception ex)
            {
                this.MainWindow.ShowError(ex);
            }
        }
        private bool OnExecute(TemplateDisplaySurface surface)
        {
            try
            {
                if (surface.GatherUserInput())
                {
                    Hashtable ht = surface.CacheUserInput();

                    if (this.projectTree.SelectedNode != null && this.projectTree.SelectedNode.Tag != null)
                    {
                        ProjectNodeData tag = this.projectTree.SelectedNode.Tag as ProjectNodeData;
                        tag.Input = ht;
                    }
                    else
                    {
                        AddRecordedTemplate(surface, true);
                        isDirty = true;
                    }
                }
                else return false;
            }
            catch (Exception ex)
            {
                throw;
                this.MainWindow.ShowError(ex);
                return false;
            }

            return true;
        }