Пример #1
0
 static IronOre()
 {
     _id = ItemID.IronOre;
     _name = "鐵礦";
     _description = "";
     _type = MineralType.Mine;
 }
Пример #2
0
 static RawRubber()
 {
     _id = ItemID.Rubber;
     _name = "生橡膠";
     _description = "";
     _type = PlantType.Product;
 }
Пример #3
0
        public ItemRow(ItemID id)
        {
            ItemId = id;
            var str = id.ToString();

            switch (str)
            {
                case "RawStart":
                    Name = "RawSoil";
                    break;
                case "RawEnd":
                    Name = "RawHide";
                    break;
                case "FoodStart":
                    Name = "Fruit";
                    break;
                case "FoodEnd":
                    Name = "Sandwich";
                    break;
                case "DrinkStart":
                    Name = "Milk";
                    break;
                case "DrinkEnd":
                    Name = "Beer";
                    break;
                case "StorageStart":
                    Name = "Crate";
                    break;
                case "StorageEnd":
                    Name = "Bag";
                    break;
                case "FurnitureStart":
                    Name = "WoodDoor";
                    break;
                case "FurnitureEnd":
                    Name = "Statue";
                    break;
                case "WeaponStart":
                    Name = "Sword";
                    break;
                case "WeaponEnd":
                    Name = "Torch";
                    break;
                case "EquipmentStart":
                    Name = "Helmet";
                    break;
                case "EquipmentEnd":
                    Name = "LeatherBoot";
                    break;
                case "ToolStart":
                    Name = "Pickaxe";
                    break;
                case "ToolEnd":
                    Name = "FellingAxe";
                    break;
                default:
                    Name = str;
                    break;
            }
        }
Пример #4
0
 static Brine()
 {
     _id = ItemID.Brine;
     _name = "海水";
     _description = "海水敘述";
     _type = LiquidType.Water;
 }
Пример #5
0
 static Bamboo()
 {
     _id = ItemID.Bamboo;
     _name = "竹子";
     _description = "";
     _type = PlantType.Wood;
 }
Пример #6
0
        //internal ItemID self;
        internal Item(ItemID item)
        {
            name = getItemName(item);;
            //Buff b;
            string d;

            switch(item){
            case ItemID.blade:
                //TODO add buff
                d = "assassin wep";
                break;
            case ItemID.bow:
                d = "archer wep";
                break;
            case ItemID.gloves:
                d = "pyro wep";
                break;
            case ItemID.mace:
                d = "vang wep";
                break;
            case ItemID.staff:
                d = "puri wep";
                break;
            case ItemID.blend:
                d = "bard wep";
                break;
            default:
                throw new Exception("no item?");
            }
            //buff = b;
            description = d;
        }
Пример #7
0
 static Cotton()
 {
     _id = ItemID.Cotton;
     _name = "棉花";
     _description = "";
     _type = PlantType.Product;
 }
Пример #8
0
 static Coal()
 {
     _id = ItemID.Coal;
     _name = "煤礦";
     _description = "";
     _type = MineralType.Fossil;
 }
Пример #9
0
 static Coconut()
 {
     _id = ItemID.Coconut;
     _name = "椰子";
     _description = "";
     _type = PlantType.Product;
 }
Пример #10
0
 static Water()
 {
     _id = ItemID.Water;
     _name = "淡水";
     _description = "淡水敘述";
     _type = LiquidType.Water;
 }
Пример #11
0
 static CopperOre()
 {
     _id = ItemID.CopperOre;
     _name = "銅礦";
     _description = "";
     _type = MineralType.Mine;
 }
Пример #12
0
 static Sand()
 {
     _id = ItemID.Sand;
     _name = "沙";
     _description = "";
     _type = MineralType.Stone;
 }
Пример #13
0
 static Log()
 {
     _id = ItemID.Log;
     _name = "木頭";
     _description = "";
     _type = PlantType.Wood;
 }
Пример #14
0
 static Rock()
 {
     _id = ItemID.Rock;
     _name = "石頭";
     _description = "";
     _type = MineralType.Stone;
 }
Пример #15
0
 static Hemp()
 {
     _id = ItemID.Hemp;
     _name = "麻草";
     _description = "";
     _type = PlantType.Herb;
 }
Пример #16
0
 static Clay()
 {
     _id = ItemID.Clay;
     _name = "黏土";
     _description = "";
     _type = (int)MineralType.Soil;
 }
Пример #17
0
    private static Item CreatItemLegendary(ItemID itemID, int amount)
    {
        Item legendaryItem = new Item();
        legendaryItem.Name = Enum.GetName(typeof(ItemID), itemID);
        legendaryItem.CurAmount = amount;
        legendaryItem.MaxAmount = MAX_AMOUNT_LEGENDARY;

        switch(itemID) {
        case ItemID.WingsBoots :
            legendaryItem.Point = 500;
            break;
        case ItemID.WandOfTruth :
            legendaryItem.Point = 700;
            break;
        case ItemID.FeatherPen :
            legendaryItem.Point = 900;
            break;
        case ItemID.LightCrystal :
            legendaryItem.Point = 1500;
            break;
        case ItemID.MixColor :
            legendaryItem.Point = 300;
            break;
        case ItemID.Gemstone :
            legendaryItem.Point = 2000;
            break;
        case ItemID.PhilosopherMap :
            legendaryItem.Point = 1000;
            break;
        default:break;
        }

        return legendaryItem;
    }
Пример #18
0
 static Oak()
 {
     _id = ItemID.Oak;
     _name = "橡木";
     _description = "";
     _type = PlantType.Wood;
 }
Пример #19
0
 static Cypress()
 {
     _id = ItemID.Cypress;
     _name = "檜木";
     _description = "";
     _type = PlantType.Wood;
 }
Пример #20
0
 internal ChampItemPair(PlayerClassNum p, ItemID i)
 {
     hero = p;
     item = i;
     id = sID++;
     if (sID > 16)
         throw new Exception();
 }
Пример #21
0
 public Item()
 {
     Id = new ItemID();
     X = 0;
     Y = 0;
     Z = 0;
     Hue = 0;
 }
Пример #22
0
    public void SetItemVisibility(ItemID aItemID, bool aVisible = true)
    {
        PlayerItem item = FindPlayerItem(aItemID);

        if (item != null)
        {
            item.MakeVisible(aVisible);
        }
    }
    public void DiscardItem(ItemID discardItemID, int discardCount)
    {
        var parameter = new Dictionary<byte, object> {
                             { (byte)DiscardItemParameterItem.ItemID, discardItemID},
                             { (byte)DiscardItemParameterItem.DiscardCount, discardCount }
                        };

        peer.OpCustom((byte)OperationType.DiscardItem, parameter, true, 0, true);
    }
Пример #24
0
 public Item()
 {
     _name = "Name";
     _id = ItemID.None;
     _point = 0;
     _type = ItemTypes.Misc;
     _detail = "Detail";
     _maxDur = 50;
     _curDur = _maxDur;
 }
Пример #25
0
    public bool checkIngredient(int recipeIndex, ItemID itemID)
    {
        //_recipeList[recipeIndex]._itemIngredient[.Equals()

        bool flag = false;
        for(int i = 0; i < _recipeList[recipeIndex]._itemIngredient.Length; i++) {
            if(_recipeList[recipeIndex]._itemIngredient[i] == itemID)
                flag = true;
        }
        return flag;
    }
Пример #26
0
    public int getIndexIngredientAmount(int recipeIndex, ItemID itemID)
    {
        //_recipeList[recipeIndex]._itemIngredient[.Equals()

        int index = 0;
        for(int i = 0; i < _recipeList[recipeIndex]._itemIngredient.Length; i++) {
            if(_recipeList[recipeIndex]._itemIngredient[i] == itemID)
                index = i;
        }
        return index;
    }
Пример #27
0
 /****************************************************/
 /*INVENTORY ITEM*/
 /****************************************************/
 public static bool checkSameItemInventory(ItemID itemID)
 {
     bool haveItem = false;
     for(int i=0; i < _inventory.Count; i++)
     {
         if(_inventory[i].Id == itemID && _inventory[i].CurAmount < _inventory[i].MaxAmount) {
             haveItem = true;
         }
     }
     return haveItem;
 }
 private void DiscardItemEventAction(bool discardStatus, ItemID itemID, int itemCount)
 {
     if (discardStatus && GameGlobal.Inventory.Any(x=>x.id == itemID))
     {
         int discardCount = GameGlobal.Inventory.Where(x => x.id == itemID).Sum(x => x.itemCount) - itemCount;
         GameGlobal.Inventory.Consume(GameGlobal.Inventory.First(x => x.id == itemID).Instantiate(discardCount) as Item);
         inventoryPanelController.ShowInventory();
     }
     inventoryPanelController.discardButton.enabled = true;
     inventoryPanelController.discardButton.image.color = inventoryPanelController.discardButtonOriginColor;
 }
Пример #29
0
 private PlayerItem FindPlayerItem(ItemID aItemID)
 {
     for (int i = 0; i < m_PlayerItems.Length; i++)
     {
         if (m_PlayerItems[i] != null && m_PlayerItems[i].ItemID == aItemID)
         {
             return m_PlayerItems[i];
         }
     }
     return null;
 }
Пример #30
0
    public void SetAllItemOfSameTypeVisibility(ItemID aItemID, bool aVisible = true)
    {
        PlayerItem[] items = FindAllPlayerItemOfType(aItemID);

        if (items != null)
        {
            for (int i = 0; i < items.Length; i++)
            {
                items[i].MakeVisible(aVisible);
            }
        }
    }
Пример #31
0
 protected override RunStatus Run(object context)
 {
     if (!IsDone)
     {
         if (MerchantFrame.Instance == null || !MerchantFrame.Instance.IsVisible)
         {
             WoWPoint movetoPoint = _loc;
             WoWUnit  unit        = ObjectManager.GetObjectsOfType <WoWUnit>().Where(o => o.Entry == NpcEntry).
                                    OrderBy(o => o.Distance).FirstOrDefault();
             if (unit != null)
             {
                 movetoPoint = WoWMathHelper.CalculatePointFrom(Me.Location, unit.Location, 3);
             }
             else if (movetoPoint == WoWPoint.Zero)
             {
                 movetoPoint = MoveToAction.GetLocationFromDB(MoveToAction.MoveToType.NpcByID, NpcEntry);
             }
             if (movetoPoint != WoWPoint.Zero && ObjectManager.Me.Location.Distance(movetoPoint) > 4.5)
             {
                 Util.MoveTo(movetoPoint);
             }
             else if (unit != null)
             {
                 unit.Target();
                 unit.Interact();
             }
             if (GossipFrame.Instance != null && GossipFrame.Instance.IsVisible &&
                 GossipFrame.Instance.GossipOptionEntries != null)
             {
                 foreach (GossipEntry ge in GossipFrame.Instance.GossipOptionEntries)
                 {
                     if (ge.Type == GossipEntry.GossipEntryType.Vendor)
                     {
                         GossipFrame.Instance.SelectGossipOption(ge.Index);
                         break;
                     }
                 }
             }
         }
         else
         {
             // check if we have merchant frame open at correct NPC
             if (NpcEntry > 0 && Me.GotTarget && Me.CurrentTarget.Entry != NpcEntry)
             {
                 MerchantFrame.Instance.Close();
                 return(RunStatus.Success);
             }
             if (!_concludingSw.IsRunning)
             {
                 if (BuyItemType == BuyItemActionType.SpecificItem)
                 {
                     var      idList  = new List <uint>();
                     string[] entries = ItemID.Split(',');
                     if (entries.Length > 0)
                     {
                         foreach (string entry in entries)
                         {
                             uint temp;
                             uint.TryParse(entry.Trim(), out temp);
                             idList.Add(temp);
                         }
                     }
                     else
                     {
                         Professionbuddy.Err("No ItemIDs are specified");
                         IsDone = true;
                         return(RunStatus.Failure);
                     }
                     foreach (uint id in idList)
                     {
                         BuyItem(id, (uint)(!BuyAdditively ? Count - Util.GetCarriedItemCount(id) : Count));
                     }
                 }
                 else if (BuyItemType == BuyItemActionType.Material)
                 {
                     foreach (var kv in Pb.MaterialList)
                     {
                         // only buy items if we don't have enough in bags...
                         int amount = kv.Value - (int)Ingredient.GetInBagItemCount(kv.Key);
                         if (amount > 0)
                         {
                             BuyItem(kv.Key, (uint)amount);
                         }
                     }
                 }
                 _concludingSw.Start();
             }
             if (_concludingSw.ElapsedMilliseconds >= 2000)
             {
                 Professionbuddy.Log("BuyItemAction Completed ");
                 IsDone = true;
             }
         }
         if (!IsDone)
         {
             return(RunStatus.Success);
         }
     }
     return(RunStatus.Failure);
 }
 void ItemSelChanged(ItemID itemID)
 {
     Notify("ItemString");
 }
Пример #33
0
 public ItemFilter(ItemID itemID, MaterialCategory materialCategory)
 {
     m_itemIDMask           = new ItemIDMask(itemID);
     m_materialCategoryMask = new MaterialCategoryMask(materialCategory);
 }
Пример #34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ItemID < 1)
            {
                function.WriteErrMsg("[产生错误的可能原因:内容信息不存在或未开放!调用方法:Content.aspx?ID=内容ID]");
            }
            M_CommonData ItemInfo = bcontent.GetCommonData(ItemID);
            M_Node       nodeinfo = bnode.GetNode(ItemInfo.NodeID);

            if (ItemInfo.IsNull)
            {
                function.WriteErrMsg("[产生错误的可能原因:内容信息不存在或未开放!]");
            }
            else if (ItemInfo.Status == -2)
            {
                function.WriteErrMsg("[对不起,当前信息已删除,您无法浏览!]");
            }
            else if (ItemInfo.Status == 0 && ItemInfo.NodeID != 37)
            {
                function.WriteErrMsg("[对不起,当前信息待审核状态,您无法浏览!]");
            }
            else if (ItemInfo.Status < 0)
            {
                function.WriteErrMsg("[对不起,当前信息未通过审核,您无法浏览!]");
            }
            if (nodeinfo.PurviewType)
            {
                if (!buser.CheckLogin())
                {
                    function.WriteErrMsg("该信息所属栏目需登录验证,请先<a href='/User/login.aspx' target='_top'>登录</a>再进行此操作!", "/User/login.aspx");
                }
                else
                {
                    //此处以后可以加上用户组权限检测
                }
            }
            if (nodeinfo.ConsumePoint > 0)
            {
                M_UserInfo userinfo = buser.GetUserByUserID(buser.GetLogin().UserID);
                int        groupID  = 0; //会员级别id
                int        groupNum = 0; //浏览文章的次数

                if (nodeinfo.Viewinglimit != "" || nodeinfo.Viewinglimit != null)
                {
                    #region 查找当前登录会员浏览该文章规定的次数
                    string   Viewinglimits     = nodeinfo.Viewinglimit;
                    string[] ViewinglimitArray = Viewinglimits.Split(new char[] { '|' });
                    if (ViewinglimitArray.Length > 1)
                    {
                        for (int i = 0; i < ViewinglimitArray.Length; i++)
                        {
                            if (userinfo.GroupID == int.Parse(ViewinglimitArray[i].Substring(0, ViewinglimitArray[i].IndexOf("="))))
                            {
                                groupID  = int.Parse(ViewinglimitArray[i].Substring(0, ViewinglimitArray[i].IndexOf("=")));
                                groupNum = int.Parse(ViewinglimitArray[i].Substring(ViewinglimitArray[i].IndexOf("=") + 1, ViewinglimitArray[i].Length - ViewinglimitArray[i].Substring(0, ViewinglimitArray[i].IndexOf("=") + 1).Length));
                                break;
                            }
                        }
                    }
                    #endregion
                }
                if (buser.CheckLogin() && (userinfo.UserPoint - nodeinfo.ConsumePoint) > 0)
                {
                    B_CompleteHistory bcomhistory = new B_CompleteHistory();
                    switch (nodeinfo.ConsumeType)
                    {
                    case 0:        //0-不重复收费
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    case 1:        //1-距离上次收费时间多少小时后重新收费
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    case 2:        //2-重复阅读内容多少次重新收费
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    case 3:        //3-上述两者都满足时重新收费
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    case 4:        //4- 1、2两者任一个满足时就重新收费
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    case 5:         //5-每阅读一次就重复收费一次
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);
                        break;

                    default:
                        ReadArticleStandardCharges(userinfo, nodeinfo, buser, bcomhistory, ItemInfo.GeneralID, nodeinfo.ConsumeType, groupID, groupNum);        //不重复收费
                        break;
                    }
                }
                else
                {
                    function.WriteErrMsg("您的点券不足,请充值!");
                }
            }
            M_ModelInfo modelinfo   = bmode.GetModelById(ItemInfo.ModelID);
            string      TempNode    = bnode.GetModelTemplate(ItemInfo.NodeID, ItemInfo.ModelID);
            string      TempContent = ItemInfo.Template;
            string      TemplateDir = modelinfo.ContentModule;
            if (!string.IsNullOrEmpty(TempContent))
            {
                TemplateDir = TempContent;
            }
            else
            {
                if (!string.IsNullOrEmpty(TempNode))
                {
                    TemplateDir = TempNode;
                }
            }
            if (string.IsNullOrEmpty(TemplateDir))
            {
                function.WriteErrMsg("该内容所属模型未指定模板");
            }
            else
            {
                GetNodePreate(nodeinfo.NodeID);
                if (!(TemplateDir.ToLower().IndexOf("site") > 0 && TemplateDir.ToLower().IndexOf("site") <= 2))
                {
                    TemplateDir = base.Request.PhysicalApplicationPath + SiteConfig.SiteOption.TemplateDir + "/" + TemplateDir;
                }
                else
                {
                    TemplateDir = base.Request.PhysicalApplicationPath + "/" + TemplateDir;
                }
                int    pid = bnode.GetContrarily(DataConverter.CLng(ItemInfo.NodeID), 5); //子站判断
                M_Node mn  = bnode.GetNodeXML(DataConverter.CLng(pid));
                mn = bnode.dal_GetNode(DataConverter.CLng(pid));
                if (mn.NodeBySite == 5)
                {
                    string NodeDir = mn.NodeDir;
                    mn          = bnode.GetNodeXML(DataConverter.CLng(ItemInfo.NodeID));
                    TemplateDir = modelinfo.ContentModule;
                    if (!string.IsNullOrEmpty(TempNode))
                    {
                        TemplateDir = TempNode;
                    }
                    if (TemplateDir.IndexOf("SiteTemplate") < 0)
                    {
                        TemplateDir = "\\Site\\" + NodeDir + "\\Template" + TemplateDir;
                    }
                    TemplateDir = base.Request.PhysicalApplicationPath + TemplateDir;    // "\\Site\\" + NodeDir + "\\Template" +
                }
                TemplateDir = TemplateDir.Replace("/", @"\").Replace(@"\\", @"\");
                string Templatestrstr = FileSystemObject.ReadFile(TemplateDir);
                string ContentHtml    = this.bll.CreateHtml(Templatestrstr, Cpage, ItemID, "0"); //Templatestrstr:模板页面字符串,页码,该文章ID
                /* --------------------判断是否分页 并做处理------------------------------------------------*/
                if (!string.IsNullOrEmpty(ContentHtml))
                {
                    string infoContent = "";     //进行处理的内容字段
                    string pagelabel   = "";
                    string infotmp     = "";

                    #region 分页符分页

                    string pattern = @"{\#PageCode}([\s\S])*?{\/\#PageCode}";      //查找要分页的内容
                    if (Regex.IsMatch(ContentHtml, pattern, RegexOptions.IgnoreCase))
                    {
                        infoContent = Regex.Match(ContentHtml, pattern, RegexOptions.IgnoreCase).Value;
                        infotmp     = infoContent;
                        infoContent = infoContent.Replace("{#PageCode}", "").Replace("{/#PageCode}", "");
                        //查找分页标签
                        bool   isPage   = false;
                        string pattern1 = @"{ZL\.Page([\s\S])*?\/}";

                        if (Regex.IsMatch(ContentHtml, pattern1, RegexOptions.IgnoreCase))
                        {
                            pagelabel = Regex.Match(ContentHtml, pattern1, RegexOptions.IgnoreCase).Value;
                            isPage    = true;
                        }
                        if (isPage)
                        {
                            if (string.IsNullOrEmpty(infoContent))     //没有设定要分页的字段内容
                            {
                                ContentHtml = ContentHtml.Replace(pagelabel, "");
                            }
                            else       //进行内容分页处理
                            {
                                //文件名
                                string file1 = "Content.aspx?ID=" + ItemID.ToString();
                                //取分页标签处理结果 返回字符串数组 根据数组元素个数生成几页
                                string         ilbl       = pagelabel.Replace("{ZL.Page ", "").Replace("/}", "").Replace(" ", ",");
                                string         lblContent = "";
                                IList <string> ContentArr = new List <string>();

                                if (string.IsNullOrEmpty(ilbl))
                                {
                                    lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                    ContentArr = this.bll.GetContentPage(infoContent);
                                }
                                else
                                {
                                    string[] paArr = ilbl.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                    if (paArr.Length == 0)
                                    {
                                        lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        ContentArr = this.bll.GetContentPage(infoContent);
                                    }
                                    else
                                    {
                                        string  lblname = paArr[0].Split(new char[] { '=' })[1].Replace("\"", "");
                                        B_Label blbl    = new B_Label();
                                        lblContent = blbl.GetLabelXML(lblname).Content;
                                        if (string.IsNullOrEmpty(lblContent))
                                        {
                                            lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        }
                                        ContentArr = this.bll.GetContentPage(infoContent);
                                    }
                                }

                                if (ContentArr.Count > 0) //存在分页数据
                                {
                                    if (Cpage == 0)       //显示全部
                                    {
                                        ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                                        ContentHtml = ContentHtml.Replace("[PageCode/]", "");
                                    }
                                    else
                                    {
                                        ContentHtml = ContentHtml.Replace(infotmp, ContentArr[Cpage - 1]);
                                    }
                                    ContentHtml = ContentHtml.Replace(pagelabel, this.bll.GetPage(lblContent, ItemID, Cpage, ContentArr.Count, ContentArr.Count));    //输出分页
                                }
                                else
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                                    ContentHtml = ContentHtml.Replace(pagelabel, "");
                                }
                            }
                        }
                        else      //没有分页标签
                        {
                            //如果设定了分页内容字段 将该字段内容的分页标志清除
                            if (!string.IsNullOrEmpty(infoContent))
                            {
                                ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                            }
                        }
                    }
                    #endregion

                    pattern = @"{\#Content}([\s\S])*?{\/\#Content}";      //查找要分页的内容
                    if (Regex.IsMatch(ContentHtml, pattern, RegexOptions.IgnoreCase))
                    {
                        infoContent = Regex.Match(ContentHtml, pattern, RegexOptions.IgnoreCase).Value;
                        infotmp     = infoContent;
                        infoContent = infoContent.Replace("{#Content}", "").Replace("{/#Content}", "");
                        //查找分页标签
                        bool   isPage   = false;
                        string pattern1 = @"{ZL\.Page([\s\S])*?\/}";
                        if (Regex.IsMatch(ContentHtml, pattern1, RegexOptions.IgnoreCase))
                        {
                            pagelabel = Regex.Match(ContentHtml, pattern1, RegexOptions.IgnoreCase).Value;
                            isPage    = true;
                        }
                        if (isPage)
                        {
                            if (string.IsNullOrEmpty(infoContent))     //没有设定要分页的字段内容
                            {
                                ContentHtml = ContentHtml.Replace(pagelabel, "");
                            }
                            else       //进行内容分页处理
                            {
                                //文件名
                                string file1 = "Content.aspx?ID=" + ItemID.ToString();
                                //取分页标签处理结果 返回字符串数组 根据数组元素个数生成几页
                                string         ilbl       = pagelabel.Replace("{ZL.Page ", "").Replace("/}", "").Replace(" ", ",");
                                string         lblContent = "";
                                int            NumPerPage = 500;
                                IList <string> ContentArr = new List <string>();

                                if (string.IsNullOrEmpty(ilbl))
                                {
                                    lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                    ContentArr = this.bll.GetContentPage(infoContent, NumPerPage);
                                }
                                else
                                {
                                    string[] paArr = ilbl.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                                    if (paArr.Length == 0)
                                    {
                                        lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        ContentArr = this.bll.GetContentPage(infoContent, NumPerPage);
                                    }
                                    else
                                    {
                                        string lblname = paArr[0].Split(new char[] { '=' })[1].Replace("\"", "");
                                        if (paArr.Length > 1)
                                        {
                                            NumPerPage = DataConverter.CLng(paArr[1].Split(new char[] { '=' })[1].Replace("\"", ""));
                                        }
                                        B_Label blbl = new B_Label();
                                        lblContent = blbl.GetLabelXML(lblname).Content;
                                        if (string.IsNullOrEmpty(lblContent))
                                        {
                                            lblContent = "{loop}<a href=\"{$pageurl/}\">{$pageid/}</a>$$$<b>[{$pageid/}]</b>{/loop}";     //默认格式的分页导航
                                        }
                                        ContentArr = this.bll.GetContentPage(infoContent, NumPerPage);
                                    }
                                }
                                if (ContentArr.Count > 0)     //存在分页数据
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, ContentArr[Cpage - 1]);
                                    ContentHtml = ContentHtml.Replace(pagelabel, this.bll.GetPage(lblContent, ItemID, Cpage, ContentArr.Count, NumPerPage));
                                }
                                else
                                {
                                    ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                                    ContentHtml = ContentHtml.Replace(pagelabel, "");
                                }
                            }
                        }
                        else    //没有分页标签
                        {
                            //如果设定了分页内容字段 将该字段内容的分页标志清除
                            if (!string.IsNullOrEmpty(infoContent))
                            {
                                ContentHtml = ContentHtml.Replace(infotmp, infoContent);
                            }
                        }
                    }
                }

                string patterns   = @"{ZL\.Page([\s\S])*?\/}";
                string pagelabels = Regex.Match(ContentHtml, patterns, RegexOptions.IgnoreCase).Value;
                if (pagelabels != "")
                {
                    ContentHtml = ContentHtml.Replace(pagelabels, "");
                }
                if (nodeinfo.SafeGuard == 1 && File.Exists(Server.MapPath("/JS/Guard.js")))
                {
                    ContentHtml = ContentHtml + SafeSC.ReadFileStr("/JS/Guard.js");
                }
                if (SiteConfig.SiteOption.IsSensitivity == 1)
                {
                    ContentHtml = sell.ProcessSen(ContentHtml);
                }
                Response.Write(ContentHtml);
            }
        }
Пример #35
0
 public override int GetHashCode()
 {
     return(ItemID.GetHashCode() ^ RandomPropertiesSeed.GetHashCode() ^
            RandomPropertiesID.GetHashCode() ^ ItemBonus.GetHashCode() ^ Modifications.GetHashCode());
 }
Пример #36
0
        protected override void PageIndexChange(int Index)
        {
            string searchString = string.Empty;

            if (txtSearch.Text.Length > 0 && txtSearch.Text != "Search...")
            {
                searchString = txtSearch.Text;
            }
            PageIndex = Index;
            string url = QueryStringParameter(CurrentURL, Request.QueryString, new string[] { "ID", "PageIndex", "Filter" }, new string[] { ItemID.ToString(), PageIndex.ToString(), searchString });

            Response.Redirect(url, false);
        }
Пример #37
0
 public ItemDefinition(int type) : base(ItemID.GetUniqueKey(type))
 {
 }