コード例 #1
0
 protected void BuildLabelList(string typename)
 {
     this.LblLabelList.Text = string.Empty;
     foreach (LabelManageInfo info in LabelManage.GetLabelList(typename))
     {
         string text = this.LblLabelList.Text;
         this.LblLabelList.Text = text + "<div onclick=\"cit()\" outype=\"1\" class=\"spanfixdiv\" alt=\"" + info.Intro + "\">" + info.Name + "</div>";
     }
 }
コード例 #2
0
 protected void BtnSearch_Click(object sender, EventArgs e)
 {
     this.LblLabelList.Text = string.Empty;
     foreach (LabelManageInfo info in LabelManage.GetLabelList(1, 0, this.LabelSearch.Text, string.Empty))
     {
         string text = this.LblLabelList.Text;
         this.LblLabelList.Text = text + "<div onclick=\"cit()\" outype=\"1\" class=\"spanfixdiv\" alt=\"" + info.Intro + "\">" + info.Name + "</div>";
     }
 }
コード例 #3
0
        protected void BtnFinal_Click(object sender, EventArgs e)
        {
            bool flag = true;

            if (!string.IsNullOrEmpty(this.ReplaceSource.Text))
            {
                if (string.Compare(this.RbtSearType.SelectedValue, "type", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    if (!string.IsNullOrEmpty(this.RbtLabelType.SelectedValue))
                    {
                        foreach (LabelManageInfo info in LabelManage.GetLabelList(this.RbtLabelType.SelectedValue))
                        {
                            if (!this.ReplaceProc(info.Name))
                            {
                                flag = false;
                                break;
                            }
                        }
                    }
                }
                else if (string.Compare(this.RbtSearType.SelectedValue, "keyword", StringComparison.OrdinalIgnoreCase) == 0)
                {
                    if (!string.IsNullOrEmpty(this.KeyWord.Text))
                    {
                        foreach (LabelManageInfo info2 in LabelManage.GetLabelList(1, 1, this.KeyWord.Text, ""))
                        {
                            if (!this.ReplaceProc(info2.Name))
                            {
                                flag = false;
                                break;
                            }
                        }
                    }
                }
                else
                {
                    foreach (LabelManageInfo info3 in LabelManage.GetLabelList(string.Empty))
                    {
                        if (!this.ReplaceProc(info3.Name))
                        {
                            flag = false;
                            break;
                        }
                    }
                }
                if (flag)
                {
                    BasePage.ResponseRedirect("LabelManage.aspx");
                }
                else
                {
                    base.Response.Write("处理错误");
                }
            }
        }
コード例 #4
0
        protected void BtnDW_Click(object sender, EventArgs e)
        {
            string str2 = HttpContext.Current.Server.MapPath("~/" + SiteConfig.SiteOption.LabelDir);

            if (!FileSystemObject.IsExist(str2 + @"\Dreamweaver", FsoMethod.Folder))
            {
                FileSystemObject.Create(str2 + @"\Dreamweaver", FsoMethod.Folder);
                if (!FileSystemObject.IsExist(str2 + @"\Dreamweaver\_folderinfo.txt", FsoMethod.File))
                {
                    FileSystemObject.Create(str2 + @"\Dreamweaver\_folderinfo.txt", FsoMethod.File);
                    FileSystemObject.WriteFile(str2 + @"\Dreamweaver\_folderinfo.txt", "PE2007标签");
                }
            }
            foreach (LabelManageInfo info in LabelManage.GetLabelList(string.Empty))
            {
                StringBuilder builder = new StringBuilder();
                IList <LabelAttributeInfo> attributeList = LabelManage.GetAttributeList(str2 + @"\" + info.Name + ".config");
                if (!FileSystemObject.IsExist(str2 + @"\Dreamweaver\" + info.Name + ".csn", FsoMethod.File))
                {
                    FileSystemObject.Create(str2 + @"\Dreamweaver\" + info.Name + ".csn", FsoMethod.File);
                }
                builder.Append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
                builder.Append("<snippet name = \"" + info.Name + "\" description = \"" + info.Intro + "\" preview=\"code\" type=\"block\">\n");
                builder.Append("<insertText location=\"beforeSelection\">\n");
                builder.Append("<![CDATA[{PE.Label ");
                builder.Append("id=\"" + info.Name + "\"");
                foreach (LabelAttributeInfo info2 in attributeList)
                {
                    builder.Append(" " + info2.AttributeName + "=\"" + info2.DefaultValue + "\"");
                }
                builder.Append(" /}]]>\n");
                builder.Append("</insertText>\n");
                builder.Append("<insertText location=\"afterSelection\"><![CDATA[]]>\n");
                builder.Append("</insertText>\n");
                builder.Append("</snippet>\n");
                FileSystemObject.WriteFile(str2 + @"\Dreamweaver\" + info.Name + ".csn", builder.ToString());
            }
            PackFiles(str2 + @"\Dreamweaver.zip", str2 + @"\Dreamweaver");
            if (!ResponseFile(this.Page.Request, this.Page.Response, "PE2007_DwPlus.zip", str2 + @"\Dreamweaver.zip", 0xfa000L))
            {
                base.Response.Write("下载文件出错!");
            }
        }