示例#1
0
/// <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;
        }
示例#2
0
        private void SaveTempListMenuItem_Click(object sender, EventArgs e)
        {
            string listName = ((ToolStripMenuItem)sender).Text;

            CommandExec.ExecuteCommandAsynch("List SaveCurrentToTemp " + Lex.AddDoubleQuotes(listName));
            UpdateNode(listName);
        }
示例#3
0
        private void EditQueryBut_Click(object sender, EventArgs e)
        {
            if (ViewManager.TryCallCustomExitingQueryResultsCallback(PivotGridPanel, ExitingQueryResultsType.EditQuery))
            {
                return;
            }

            CommandExec.ExecuteCommandAsynch("EditQuery");
        }
示例#4
0
        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);
        }
示例#5
0
        /// <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;
        }
示例#6
0
        ////////////////////////////////////////////////////////////////////////////
        // 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);
        }
示例#7
0
        /// <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);
            }
        }
示例#8
0
// 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;
            }
        }
示例#9
0
 private void CnPopupCopyStructure_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("CopyCompoundIdStructure " + SelectedCid);
 }
示例#10
0
 private void menuShowDescription_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTableDescription " + ShowDescriptionArg);
 }
示例#11
0
 private void menuAddToQuery_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("AddTableToQuery " + AddToQueryArg);
 }
示例#12
0
        /// <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");
        }
示例#13
0
 private void DuplicateMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryDuplicate");
     CommandExec.ExecuteCommandAsynch("DuplicateQuery");
 }
示例#14
0
 private void ShowTargetDescriptionMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTargetDescription " + SelectedTarget);
 }
示例#15
0
 private void ShowTargetAssayDataMenuItem_Click_1(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowAllTargetUnsummarizedAssayData " + SelectedTarget);
 }
示例#16
0
 private void QueryOptionsMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryOptions");
     CommandExec.ExecuteCommandAsynch("QueryOptions");
 }
示例#17
0
 private void menuExistingAnnotation_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsAddExistingAnnotation");
     CommandExec.ExecuteCommandAsynch("ExistingAnnotation");
 }
示例#18
0
        private void RunQueryDetachedMenuItem_Click(object sender, EventArgs e)
        {
            SessionManager.LogCommandUsage("QueryTablesRunQueryInBackground");

            CommandExec.ExecuteCommandAsynch("SpawnQueryInBackground");
        }
示例#19
0
 private void RunQueryBrowseMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryTablesRunQueryBrowsePreviousResults");
     CommandExec.ExecuteCommandAsynch("Browse");
 }
示例#20
0
 private void RunQuerySingleTableMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryTablesRunQuerySingleTable");
     CommandExec.ExecuteCommandAsynch("RunQuerySingleTable " + CurrentQt.MetaTable.Name);
 }
示例#21
0
 private void QueryClearMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ClearQuery");
 }
示例#22
0
 private void RenameQueryMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("RenameQuery");
 }
示例#23
0
 private void CnPopupAllData_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("SelectAllCompoundData " + SelectedCid);
 }
示例#24
0
 private void menuOpenCalcField_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsOpenCalcField");
     CommandExec.ExecuteCommandAsynch("OpenCalcField");
 }
示例#25
0
 private void CnPopupShowStbView_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowStbViewForCompound " + SelectedCid);
 }
示例#26
0
 private void OpenUserDatabaseMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsOpenUserDatabase");
     CommandExec.ExecuteCommandAsynch("OpenUserDatabase");
 }
示例#27
0
 private void ShowTargetAssayListMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTargetAssayList " + SelectedTarget);
 }
示例#28
0
 private void QueryRemoveAllCriteriaMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryRemoveAllCriteria");
     CommandExec.ExecuteCommandAsynch("RemoveAllCriteria");
 }
示例#29
0
        /// <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);
            }
        }
示例#30
0
        ////////////////////////////////////////////////////////////////////////////
        // Project
        ////////////////////////////////////////////////////////////////////////////

        private void menuSelectDefaultProject_Click(object sender, EventArgs e)
        {
            SessionManager.LogCommandUsage("ContentsProjectSelectDefaultProject");
            CommandExec.ExecuteCommandAsynch("SelectDefaultProject " + QbContentsTree.CurrentContentsMetaTreeNode.Target);
        }