/// <summary> /// Process queued command /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Timer_Tick(object sender, EventArgs e) { string arg; int i1; Timer.Stop(); string cmd = CommandToExecute; if (String.IsNullOrEmpty(cmd)) { return; } else if (MoleculeGridControl.IsShowContextMenuCommand(cmd, "ShowContextMenu:TargetContextMenu", out arg)) { SelectedTarget = arg; Point ptCursor = Cursor.Position; ptCursor = PointToClient(ptCursor); TargetContextMenu.Show(ParentControl, ptCursor); // show on panel since events lost if on WebBrowser control } else if ((i1 = Lex.IndexOf(cmd, "ClickFunction")) >= 0) { cmd = cmd.Substring(i1 + "ClickFunction".Length + 1); // get function name ClickFunctions.Process(cmd, null); } else { CommandExec.ExecuteCommandAsynch(cmd); } return; }
private void SaveTempListMenuItem_Click(object sender, EventArgs e) { string listName = ((ToolStripMenuItem)sender).Text; CommandExec.ExecuteCommandAsynch("List SaveCurrentToTemp " + Lex.AddDoubleQuotes(listName)); UpdateNode(listName); }
private void EditQueryBut_Click(object sender, EventArgs e) { if (ViewManager.TryCallCustomExitingQueryResultsCallback(PivotGridPanel, ExitingQueryResultsType.EditQuery)) { return; } CommandExec.ExecuteCommandAsynch("EditQuery"); }
private void ContentsEditProjectDefinition_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsEditProject"); string path = QbContentsTree.QbContentsTreeCtl.GetMetaTreeNodePath(QbContentsTree.CurrentContentsTreeListNode); if (Lex.IsUndefined(path)) { path = QbContentsTree.CurrentContentsMetaTreeNode.Name; } CommandExec.ExecuteCommandAsynch("ContentsEdit " + path); }
/// <summary> /// Get table view of all data /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AllDataButton_Click(object sender, EventArgs e) { if (!Lex.IsDefined(Cid)) { return; } HideQuickSearchPopup(); PreviousInput = ""; // avoid any additional QuickDisplays CommandExec.ExecuteCommandAsynch("SelectAllCompoundData " + Cid); return; }
//////////////////////////////////////////////////////////////////////////// // Favorites context menu - Used when rt-clicking on folder item in Favorites menu //////////////////////////////////////////////////////////////////////////// private void OpenFavoriteMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsFavoritesOpen"); MetaTreeNode node = QbContentsTree.CurrentContentsMetaTreeNode; if (node == null) { return; } if (String.IsNullOrEmpty(node.Target)) { return; } CommandExec.ExecuteCommandAsynch("OpenFavorite " + node.Target); }
/// <summary> /// This method is called to send a ContentsTree node click command with object type & name /// </summary> /// <param name="command"></param> internal void ExecuteContentsTreeCommand( string command) { // This indicates the user has come from the QuickSearch Menu. Either nothing is selected in the Tree // or the node we are trying to act upon is not ne in the tree selection. if (CurrentContentsMetaTreeNodes == null || !CurrentContentsMetaTreeNodes.Contains(CurrentContentsMetaTreeNode)) { CommandExec.ExecuteCommandAsynch(command + " " + CurrentContentsMetaTreeNode.Target); } else if (CurrentContentsMetaTreeNodes != null && CurrentContentsMetaTreeNodes.Length >= 1) { command += " "; foreach (var treeNode in CurrentContentsMetaTreeNodes) { command += treeNode.Target + ";"; } char[] lastSemicolon = { ';' }; command = command.TrimEnd(lastSemicolon); CommandExec.ExecuteCommandAsynch(command); } }
// Back to edit query internal void EditQueryBut_Click(object sender, EventArgs e) { ContainerControl cc; if (ViewManager.TryCallCustomExitingQueryResultsCallback(MoleculeGridPanel, ExitingQueryResultsType.EditQuery)) { return; } if (ViewManager.IsControlContainedInQueriesControl(MoleculeGridPanel)) { CommandExec.ExecuteCommandAsynch("EditQuery"); } else if (ViewManager.IsControlContainedInPopupResultsControl(MoleculeGridPanel)) { string msg = "Do you want to create a new query from the currently displayed results?"; DialogResult dr = MessageBoxMx.Show(msg, "Create New Query", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dr != DialogResult.Yes) { return; } Query q = MoleculeGrid.Query.Clone(); // make copy of query QbUtil.AddQuery(q); QbUtil.EditQuery(); return; } else { MessageBoxMx.ShowError("Unable to edit query. Not contained in a recognized container type"); return; } }
private void CnPopupCopyStructure_Click(object sender, System.EventArgs e) { CommandExec.ExecuteCommandAsynch("CopyCompoundIdStructure " + SelectedCid); }
private void menuShowDescription_Click(object sender, System.EventArgs e) { CommandExec.ExecuteCommandAsynch("ShowTableDescription " + ShowDescriptionArg); }
private void menuAddToQuery_Click(object sender, System.EventArgs e) { CommandExec.ExecuteCommandAsynch("AddTableToQuery " + AddToQueryArg); }
/// <summary> /// Handle click on progress button in statusbar /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void RetrievalProgressButton_ItemClick(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("List EditTemp Current"); }
private void DuplicateMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryDuplicate"); CommandExec.ExecuteCommandAsynch("DuplicateQuery"); }
private void ShowTargetDescriptionMenuItem_Click(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("ShowTargetDescription " + SelectedTarget); }
private void ShowTargetAssayDataMenuItem_Click_1(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("ShowAllTargetUnsummarizedAssayData " + SelectedTarget); }
private void QueryOptionsMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryOptions"); CommandExec.ExecuteCommandAsynch("QueryOptions"); }
private void menuExistingAnnotation_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsAddExistingAnnotation"); CommandExec.ExecuteCommandAsynch("ExistingAnnotation"); }
private void RunQueryDetachedMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryTablesRunQueryInBackground"); CommandExec.ExecuteCommandAsynch("SpawnQueryInBackground"); }
private void RunQueryBrowseMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryTablesRunQueryBrowsePreviousResults"); CommandExec.ExecuteCommandAsynch("Browse"); }
private void RunQuerySingleTableMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryTablesRunQuerySingleTable"); CommandExec.ExecuteCommandAsynch("RunQuerySingleTable " + CurrentQt.MetaTable.Name); }
private void QueryClearMenuItem_Click(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("ClearQuery"); }
private void RenameQueryMenuItem_Click(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("RenameQuery"); }
private void CnPopupAllData_Click(object sender, System.EventArgs e) { CommandExec.ExecuteCommandAsynch("SelectAllCompoundData " + SelectedCid); }
private void menuOpenCalcField_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsOpenCalcField"); CommandExec.ExecuteCommandAsynch("OpenCalcField"); }
private void CnPopupShowStbView_Click(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("ShowStbViewForCompound " + SelectedCid); }
private void OpenUserDatabaseMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsOpenUserDatabase"); CommandExec.ExecuteCommandAsynch("OpenUserDatabase"); }
private void ShowTargetAssayListMenuItem_Click(object sender, EventArgs e) { CommandExec.ExecuteCommandAsynch("ShowTargetAssayList " + SelectedTarget); }
private void QueryRemoveAllCriteriaMenuItem_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("QueryRemoveAllCriteria"); CommandExec.ExecuteCommandAsynch("RemoveAllCriteria"); }
/// <summary> /// Open the specified target /// </summary> /// <param name="mtn"></param> public static void OpenMetaTreeNode( MetaTreeNode mtn) { UserObject uo; string tok; int i1; if (mtn == null) { return; } MetaTreeNodeType nodeType = mtn.Type; string target = mtn.Target; //if (!Permissions.UserHasReadAccess(SS.I.UserName, target)) //{ // MessageBoxMx.ShowError("You are not authorized to open: " + mtn.Label); // return; //} if (nodeType == MetaTreeNodeType.MetaTable || // data table types nodeType == MetaTreeNodeType.CalcField || nodeType == MetaTreeNodeType.Annotation || nodeType == MetaTreeNodeType.ResultsView) { QbUtil.AddAndRenderTables(target); //.CallCurrentProcessTreeItemOperationMethod("Open", target); } else if (nodeType == MetaTreeNodeType.CondFormat) { uo = ParseAndReadUserObject(mtn.Name); if (uo == null) { return; } tok = uo.InternalName; CondFormatEditor.EditUserObject(uo.InternalName); } else if (MetaTreeNode.IsFolderNodeType(nodeType)) { if (Lex.StartsWith(target, "USERDATABASE_")) // edit a user compound database { uo = ParseAndReadUserObject(target); if (uo == null) { return; } UserData.OpenExistingUserDatabase(uo); } } else if (nodeType == MetaTreeNodeType.Url) { // open url or execute click function if ((i1 = Lex.IndexOf(target, "ClickFunction")) >= 0) { string cmd = target.Substring(i1 + "ClickFunction".Length + 1); // get function name ClickFunctions.Process(cmd, null); } else if (Lex.Contains(target, "SpotfireWeb")) // link to Spotfire webplayer { SpotfireLinkUI.OpenLink(target); } else { SystemUtil.StartProcess(target); // open in default user browser } } else if (nodeType == MetaTreeNodeType.Action) { // execute action CommandLine.Execute(mtn.Target); } else if (nodeType == MetaTreeNodeType.CnList) // open list { uo = ParseAndReadUserObject(target); if (uo == null) { return; } tok = uo.InternalName; CidListEditor.Edit(tok); } else if (nodeType == MetaTreeNodeType.Query) // open query { uo = ParseAndReadUserObject(target); if (uo == null) { return; } if (uo.Type == UserObjectType.Query) // normal query { tok = uo.InternalName; string nextCommand = QbUtil.OpenQuery(tok); while (!(String.IsNullOrEmpty(nextCommand))) { nextCommand = CommandExec.ExecuteCommand(nextCommand); } } else if (uo.Type == UserObjectType.MultiTable) // multitable query { QbUtil.AddAndRenderTables(target); } } else if (nodeType == MetaTreeNodeType.Library) { CommandExec.ExecuteCommandAsynch("ContentsViewLibAsList " + mtn.Name); } }
//////////////////////////////////////////////////////////////////////////// // Project //////////////////////////////////////////////////////////////////////////// private void menuSelectDefaultProject_Click(object sender, EventArgs e) { SessionManager.LogCommandUsage("ContentsProjectSelectDefaultProject"); CommandExec.ExecuteCommandAsynch("SelectDefaultProject " + QbContentsTree.CurrentContentsMetaTreeNode.Target); }