|  | 
 
上一篇:传奇3寄售代码 C# Zircon源代码下一篇:C#传奇3大补帖增强免蜡源代码|   
 
 
 复制代码  /// <summary>
    /// 商城
    /// </summary>
    public sealed class ShangChengDialog : DXWindow1
    {
        #region Store
        public DXTextBox StoreItemNameBox, StoreBuyTotalBox;
        public DXNumberBox StoreBuyCountBox, StoreBuyPriceBox, GameGoldBox, HuntGoldBox;
        public DXComboBox StoreItemTypeBox, StoreSortBox;
        public DXControl StoreBuyPanel;
        public DXButton StoreBuyButton, StoreSearchButton, ClearButton,YuanbaoLabel;
        public DXCheckBox UseHuntGoldBox;
        public DXVScrollBar StoreScrollBar1;
        public DXLabel StoreBuyPriceLabel;
        public DXControl Panel;
        public MarketPlaceStoreRow[] StoreRows;
        public List<StoreInfo> StoreSearchResults;
        public DXCheckBox FastBox;
        public List<DXButton> FilterButton;
        public DXVScrollBar FilterScrollBar;
        public DXControl FilterPanel;
        public DXButton CurrentButton;
        public int Xianyouyuanbao;
        public int Xianyoubangyuan;
        #endregion
            label = new DXLabel
            {
                Parent = filterPanel1,
                Location = new Point(StoreItemNameBox.Location.X + StoreItemNameBox.Size.Width + 10, 5),
                Text = "物品:",
            };
            StoreItemTypeBox = new DXComboBox
            {
                Parent = filterPanel1,
                Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
                Size = new Size(95, DXComboBox.DefaultNormalHeight),
                DropDownHeight = 198
            };
            new DXListBoxItem
            {
                Parent = StoreItemTypeBox.ListBox,
                Label = { Text = $"全部" },
                Visible = false,
                Item = null
            };
            TODO Store Filter
            HashSet<string> filters = new HashSet<string>();
            foreach (StoreInfo info in Globals.StoreInfoList.Binding)
            {
                if (string.IsNullOrEmpty(info.Filter)) continue;
                string[] temp = info.Filter.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string s in temp)
                    filters.Add(s.Trim());
            }
            foreach (string filter in filters.OrderBy(x => x))
            {
                new DXListBoxItem
                {
                    Parent = StoreItemTypeBox.ListBox,
                    Label = { Text = filter },
                    Item = filter
                };
            }
            StoreItemTypeBox.ListBox.SelectItem(null);
            label = new DXLabel
            {
                Visible = false,
                Parent = filterPanel1,
                Location = new Point(StoreItemTypeBox.Location.X + StoreItemTypeBox.Size.Width + 10, 5),
                Text = "排序:",
            };
            StoreSortBox = new DXComboBox
            {
                Visible=false,
                Parent = filterPanel1,
                Location = new Point(label.Location.X + label.Size.Width + 5, label.Location.Y),
                Size = new Size(100, DXComboBox.DefaultNormalHeight)
            };
            Type storeType = typeof(MarketPlaceStoreSort);
            for (MarketPlaceStoreSort i = MarketPlaceStoreSort.Alphabetical; i <= MarketPlaceStoreSort.Favourite; i++)
            {
                MemberInfo[] infos = storeType.GetMember(i.ToString());
                DescriptionAttribute description = infos[0].GetCustomAttribute<DescriptionAttribute>();
                new DXListBoxItem
                {
                    Parent = StoreSortBox.ListBox,
                    Label = { Text = description?.Description ?? i.ToString() },
                    Item = i,
                    Opacity = 0.5f
                };
            }
 
 | 
 |