示例#1
0
        public static frmOfflineScriptEditor CreateScriptEditor(string caption, string script, int objType)
        {
            frmOfflineScriptEditor frm = new frmOfflineScriptEditor();

            frm.InitializeScriptEditor(caption, script, objType);
            return(frm);
        }
示例#2
0
        public static frmOfflineScriptEditor OpenSharedScriptInScriptEditor(SharedScriptsItemData itemData)
        {
            string caption = String.Empty;
            string script  = String.Empty;

            if (itemData == null)
            {
                throw new NullParameterException("ItemData is null!");
            }

            caption = itemData.Name + "{Shared script}";
            script  = itemData.Script;

            frmOfflineScriptEditor frm = new frmOfflineScriptEditor();

            frm.Icon                 = PragmaSQL.Properties.Resources.sharedScript;
            frm.ContentProvider      = new SharedScriptContentProvider();
            frm.ContentProvider.Data = itemData;
            frm.ContentProvider.Hint = "This is a shared script: " + itemData.Name;
            frm.ContentInfo          = frm.ContentProvider.Hint;

            frm.ContentProvider.ContentName = itemData.Name;
            frm.InitializeScriptEditor(caption, script, DBObjectType.None);
            return(frm);
        }
示例#3
0
        public static void ShowScriptEditor(frmOfflineScriptEditor frm)
        {
            if (frm == null)
            {
                return;
            }

            if (Program.MainForm.DockPanel.DocumentStyle == DocumentStyles.SystemMdi)
            {
                frm.MdiParent = Program.MainForm;
                frm.Show();
            }
            else if (Program.MainForm.DockPanel.DocumentStyle == DocumentStyles.DockingWindow)
            {
                frm.Show();
            }
            else
            {
                frm.Show(Program.MainForm.DockPanel);
            }
        }