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

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

            CommandExec.ExecuteCommandAsynch("EditQuery");
        }
Example #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);
        }
Example #5
0
    public bool RunStep()
    {
        if (_p >= _cmdList.Count)
        {
            return(false);
        }

        var cmd = _cmdList[_p];

        _p++;
        CommandExec.Execute(this, cmd);
        return(true);
    }
Example #6
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;
        }
Example #7
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);
        }
Example #8
0
        public void Execute(string command)
        {
            try
            {
                command = command.Replace("%20", " ");                 // convert any special URL characters (todo: more complete translation)
                DebugLog.Message("MobiusClientIntegrationPoint Command: " + Lex.AddDoubleQuotes(command));
                CommandExec.PostCommand(command);
            }

            catch (Exception ex)
            {
                string msg =
                    "Error executing external command: " + command + "\n\n" +
                    DebugLog.FormatExceptionMessage(ex);

                ServicesLog.Message(msg);
                MessageBoxMx.ShowError(msg);
            }
        }
Example #9
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);
            }
        }
Example #10
0
        /// <summary>
        /// Read a compound id list given an internal list name (e.g. FOLDER_123.name or LIST_1234)
        /// </summary>
        /// <param name="name"></param>
        /// <param name="mt"></param>
        /// <returns></returns>

        public static CidList Read(
            string internalName,
            MetaTable mt,
            bool allowLocalRead)
        {
            UserObject uo, uo2;
            string     fileName, cn;
            int        i1;

            uo = UserObjectUtil.ParseInternalUserObjectName(internalName, UserObjectType.CnList);
            if (uo == null)
            {
                return(null);
            }

            if (allowLocalRead && UserObject.IsCurrentObjectInternalName(internalName))             // get from the current query
            {
                return(ReadCurrentListLocal());
            }

            uo2 = UserObjectDao.Read(uo);             // get from the server side
            if (uo2 == null)
            {
                MessageBoxMx.ShowError(
                    "Unable to find list: " + internalName + "\r\n\r\n" +
                    CommandExec.GetUserObjectReadAccessErrorMessage(uo.Id, "list"));
                return(null);
            }

            CidList cnList = CidList.Deserialize(uo2, mt);

            if (UserObject.IsCurrentObjectInternalName(internalName))             // if current list store keys with query
            {
                SessionManager.CurrentResultKeys = cnList.ToStringList();
            }

            return(cnList);
        }
Example #11
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;
            }
        }
Example #12
0
 private void CnPopupShowStbView_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowStbViewForCompound " + SelectedCid);
 }
Example #13
0
 private void CnPopupAllData_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("SelectAllCompoundData " + SelectedCid);
 }
Example #14
0
 private void CnPopupCopyStructure_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("CopyCompoundIdStructure " + SelectedCid);
 }
Example #15
0
 private void menuAddToQuery_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("AddTableToQuery " + AddToQueryArg);
 }
Example #16
0
 private void menuShowDescription_Click(object sender, System.EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTableDescription " + ShowDescriptionArg);
 }
Example #17
0
 private void RunQuerySingleTableMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryTablesRunQuerySingleTable");
     CommandExec.ExecuteCommandAsynch("RunQuerySingleTable " + CurrentQt.MetaTable.Name);
 }
Example #18
0
 private void ShowTargetAssayDataMenuItem_Click_1(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowAllTargetUnsummarizedAssayData " + SelectedTarget);
 }
Example #19
0
 private void RenameQueryMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("RenameQuery");
 }
Example #20
0
 private void menuExistingAnnotation_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsAddExistingAnnotation");
     CommandExec.ExecuteCommandAsynch("ExistingAnnotation");
 }
Example #21
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);
            }
        }
Example #22
0
 private void RunQueryBrowseMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("QueryTablesRunQueryBrowsePreviousResults");
     CommandExec.ExecuteCommandAsynch("Browse");
 }
Example #23
0
        private void RunQueryDetachedMenuItem_Click(object sender, EventArgs e)
        {
            SessionManager.LogCommandUsage("QueryTablesRunQueryInBackground");

            CommandExec.ExecuteCommandAsynch("SpawnQueryInBackground");
        }
Example #24
0
 private void ShowTargetDescriptionMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTargetDescription " + SelectedTarget);
 }
Example #25
0
 private void ShowTargetAssayListMenuItem_Click(object sender, EventArgs e)
 {
     CommandExec.ExecuteCommandAsynch("ShowTargetAssayList " + SelectedTarget);
 }
Example #26
0
 private void EditQueryBut_Click(object sender, EventArgs e)
 {
     CommandExec.Execute("EditQuery");
 }
Example #27
0
 private void OpenUserDatabaseMenuItem_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsOpenUserDatabase");
     CommandExec.ExecuteCommandAsynch("OpenUserDatabase");
 }
Example #28
0
        ////////////////////////////////////////////////////////////////////////////
        // Project
        ////////////////////////////////////////////////////////////////////////////

        private void menuSelectDefaultProject_Click(object sender, EventArgs e)
        {
            SessionManager.LogCommandUsage("ContentsProjectSelectDefaultProject");
            CommandExec.ExecuteCommandAsynch("SelectDefaultProject " + QbContentsTree.CurrentContentsMetaTreeNode.Target);
        }
Example #29
0
 private void menuOpenCalcField_Click(object sender, EventArgs e)
 {
     SessionManager.LogCommandUsage("ContentsOpenCalcField");
     CommandExec.ExecuteCommandAsynch("OpenCalcField");
 }
Example #30
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");
        }