Ejemplo n.º 1
0
        private string FormatTips(string text)
        {
            int i, j;
            int slnid = 0;

            try
            {
                slnid = int.Parse(ddlSolution.Text);
            }
            catch
            {
            }
            Hashtable     ht = Mainfun.LoadEnumApplication(slnid, false);
            StringBuilder sb = new StringBuilder();

            while (true)
            {
                i = text.IndexOfAny(new char[] { '[', '【' });
                if (i != -1)
                {
                    j = text.IndexOfAny(new char[] { ']', '】' });
                    if (j != -1)
                    {
                        sb.Append(text.Substring(0, i));
                        string innertext = text.Substring(i, j - i + 1);
                        text      = text.Substring(j + 1);
                        innertext = innertext.Replace('[', '【').Replace(']', '】');
                        if (ht.Contains(innertext))
                        {
                            sb.Append(string.Format("<a href='addenum.aspx?enum={2}&id={0}&slnid={1}' onmouseover='ShowPrompt(event, \"{3}\")'>{2}</a>", DropGetList.Text, ddlSolution.Text, innertext,
                                                    ht[innertext].ToString().Replace("\r", "").Replace("\n", "<br>")));
                        }
                        else
                        {
                            sb.Append(string.Format("<a href='addenum.aspx?enum={2}&id={0}&slnid={1}' onmouseover='ShowPrompt(event, \"{3}\")'>{2}</a>", DropGetList.Text, ddlSolution.Text, innertext,
                                                    "暂无此枚举信息,请点击连接进行定义"));
                        }
                    }
                    else
                    {
                        sb.Append(text);
                    }
                }
                else
                {
                    sb.Append(text);
                    break;
                }
            }
            return(sb.ToString());
        }
Ejemplo n.º 2
0
 protected void btRefreshCache_Click(object sender, EventArgs e)
 {
     Mainfun.LoadEnumApplication(SlnID, true);
 }