private static IList <SharedScriptsItemData> ShowOpenSharedScriptDialog_MultiSelect() { IList <SharedScriptsItemData> result = new List <SharedScriptsItemData>(); frmSharedScriptSelectDialog frm = new frmSharedScriptSelectDialog(); frm.Mode = SharedScriptSelectDialogMode.Open; if (!frm.SharedScriptsControl.LoadFromDefaultConnection(true) || (frm.ShowDialog() != DialogResult.OK)) { frm.Dispose(); frm = null; return(result); } foreach (MWTreeNodeWrapper nodeWrapper in frm.SharedScriptsControl.SelectedNodesRaw.Values) { SharedScriptsItemData data = SharedScriptsItemDataFactory.GetNodeData(nodeWrapper.Node); if (data == null) { continue; } result.Add(data); } return(result); }
private static SharedScriptsItemData ShowOpenSharedScriptDialog_SingleSelect() { frmSharedScriptSelectDialog frm = new frmSharedScriptSelectDialog(); frm.Mode = SharedScriptSelectDialogMode.Open; frm.ucSharedScripts1.tv.MultiSelect = TreeViewMultiSelect.NoMulti; if (!frm.SharedScriptsControl.LoadFromDefaultConnection(true) || (frm.ShowDialog() != DialogResult.OK)) { frm.Dispose(); frm = null; return(null); } return(frm.ucSharedScripts1.SelectedNodeData); }
private static SharedScriptsItemData ShowSaveSharedScriptDialog(string script, string itemName) { frmSharedScriptSelectDialog frm = new frmSharedScriptSelectDialog(); frm.Script = script; frm.Mode = SharedScriptSelectDialogMode.Save; frm.ItemName = itemName; if (!frm.SharedScriptsControl.LoadFromDefaultConnection(true) || (frm.ShowDialog() != DialogResult.OK)) { frm.Dispose(); frm = null; return(null); } return(frm.SavedItemData); }