Beispiel #1
0
        private void RefreshTemplateEditor(string uniqueId)
        {
            foreach (DockContent cont in dockManager.Contents)
            {
                if (cont is TemplateEditor)
                {
                    TemplateEditor editor = cont as TemplateEditor;
                    if (uniqueId.ToLower() == editor.UniqueID.ToLower())
                    {
                        if (MessageBox.Show(this,
                            "Template [" + editor.Title + "] has been updated outside of the Template Editor.\r\nWould you like to refresh it?",
                            "Refresh Updated Template?",
                            MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            string filename = editor.CompleteFilePath;
                            editor.Close();

                            if (File.Exists(filename))
                            {
                                editor = new TemplateEditor(this);
                                editor.FileOpen(filename);
                                editor.Show(dockManager);
                            }
                        }

                        break;
                    }
                }
            }
        }
Beispiel #2
0
 private TemplateEditor OpenTemplateEditor()
 {
     TemplateEditor edit = new TemplateEditor(this);
     edit.FileNew("ENGINE", ZeusConstants.Engines.DOT_NET_SCRIPT, "LANGUAGE", ZeusConstants.Languages.CSHARP);
     edit.Show(dockManager);
     return edit;
 }
Beispiel #3
0
        private TemplateEditor OpenTemplateEditor(string filename)
        {
            TemplateEditor edit = null;

            if (File.Exists(filename))
            {
                bool isopen = IsTemplateOpen(filename);

                if (!isopen)
                {
                    edit = new TemplateEditor(this);
                    edit.FileOpen(filename);
                    edit.Show(dockManager);
                }
                else
                {
                    edit = GetTemplateEditor(filename);
                    edit.Activate();
                }
            }
            else
            {
                edit = OpenTemplateEditor();
            }

            return edit;
        }
Beispiel #4
0
 private TemplateEditor OpenTemplateEditor(string engine, string language)
 {
     TemplateEditor template = new TemplateEditor(this);
     template.FileNew("ENGINE", engine, "LANGUAGE", language);
     template.Show(dockManager);
     return template;
 }