public static frmOfflineScriptEditor CreateScriptEditor(string caption, string script, int objType) { frmOfflineScriptEditor frm = new frmOfflineScriptEditor(); frm.InitializeScriptEditor(caption, script, objType); return(frm); }
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); }
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); } }