Esempio n. 1
0
        /// <summary>
        /// Edit list
        /// </summary>
        /// <returns></returns>

        public static CidList Edit(
            CidList inList,
            MetaTable rootTable)
        {
            if (Instance == null)
            {
                Instance = new CidListEditor();
            }

            if (!Instance.Setup(inList, rootTable))
            {
                return(null);
            }

            DialogResult dr = Instance.ShowDialog(SessionManager.ActiveForm);

            if (dr == DialogResult.OK)
            {
                return(Instance.CidList);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private void EditList_Click(object sender, EventArgs e)
        {
            string        listText = CidListString.Trim();
            List <string> al       = Csv.SplitCsvString(listText);
            CidList       cnList   = new CidList(al, true);

            cnList.UserObject.Name = "Criteria List";
            cnList.UserObject.Id   = CidListEditor.EditInMemoryOnlyUoId;           // indicate not to be persisted to user object
            cnList = CidListEditor.Edit(cnList, Qc.MetaColumn.MetaTable.Root);
            if (cnList == null)
            {
                return;
            }

            CidListString = CidList.BuildListCsvStringOfFormattedCids(Qc, cnList.ToStringList());
            SetCidListDisplay();
            if (CidListDisplayIsEditable() && CidListString.Length > 0)             // no text selected
            {
                CidListDisplay.Select(0, 0);
            }
            else
            {
                InList.Focus();
            }
        }
Esempio n. 3
0
/// <summary>
/// Edit a saved list
/// </summary>
/// <returns></returns>

        static string EditSaved()
        {
            UserObject uo = SelectListDialog("Edit List");

            if (uo == null)
            {
                return("");
            }
            CidList cnList = CidListEditor.Edit(uo.InternalName);

            return("");
//			if (cnList==null) return "";
//			else return "List " + cnList.UserObject.Name + " now contains " + cnList.Count.ToString() +
//						 " " + SS.I.CompoundIdLabel + "s";
        }
Esempio n. 4
0
        private void EditSaved_Click(object sender, EventArgs e)
        {
            string internalName = ResolveSavedListUo();

            if (internalName == null)
            {
                return;                                   // nonexistant
            }
            CidList cnList = CidListEditor.Edit(internalName);

            if (cnList != null)             // set any new name
            {
                ListName.Text = cnList.UserObject.Name;
                SavedListUo   = cnList.UserObject;
            }
        }
Esempio n. 5
0
/// <summary>
/// Edit current list
/// </summary>
/// <returns></returns>

        public static string EditTemp(
            string tempListName)
        {
            tempListName = GetInternalTempListName(tempListName);

            CidList cnList = Read(tempListName);

            if (cnList == null)           // create empty current if needed
            {
                cnList = new CidList();
                UserObject uo = UserObject.ParseInternalUserObjectName(tempListName, UserObjectType.CnList, SS.I.UserName);
                Write(cnList, uo);
            }
            CidListEditor.Edit(tempListName);
            return("");
        }
Esempio n. 6
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);
            }
        }
Esempio n. 7
0
 static string CreateNewList()
 {
     CidListEditor.Edit("");             // create new list
     return("");
 }
Esempio n. 8
0
 private void EditCurrent_Click(object sender, EventArgs e)
 {
     CidListCommand.ReadCurrentListRemote();             // get the current list from server
     CidListEditor.Edit("Current");
     return;
 }