示例#1
0
        private void getCategoryDetail(string Name)
        {
            this.CList = new CategoryList();
            var cname = Name;

            if (cname == "未分类")
            {
                cname = null;
            }
            List <TextList> Tmod = db.TextLists.Where(c => c.CategoryName == cname).ToList();           //获取分类下属的文章表

            this.CTList = new List <CategoryText>();
            //将TextList表的数据洗入CategoryText列表
            foreach (var item in Tmod)
            {
                var temp = new CategoryText
                {
                    TextTitle  = item.TextTitle,
                    TextID     = item.TextID,
                    Hot        = item.Hot,
                    ChangeTime = item.TextChangeDate
                };
                CList.CategoryHot += item.Hot;
                CTList.Add(temp);
            }
            CList.TextCount = Tmod.Count(c => c.CategoryName == cname);
            if (cname == null)
            {
                CList.CategoryName = "未分类";
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (BuscarButton != null)
            {
                BuscarButton.Dispose();
                BuscarButton = null;
            }

            if (CategoryText != null)
            {
                CategoryText.Dispose();
                CategoryText = null;
            }

            if (CountText != null)
            {
                CountText.Dispose();
                CountText = null;
            }

            if (IdText != null)
            {
                IdText.Dispose();
                IdText = null;
            }

            if (NameText != null)
            {
                NameText.Dispose();
                NameText = null;
            }

            if (PriceText != null)
            {
                PriceText.Dispose();
                PriceText = null;
            }

            if (StatusLabel != null)
            {
                StatusLabel.Dispose();
                StatusLabel = null;
            }

            if (ValidarButton != null)
            {
                ValidarButton.Dispose();
                ValidarButton = null;
            }
        }
        public void Clear()
        {
            GameText.Clear();
            CategoryText.Clear();
            RunnerNamesText.Clear();
            PlatformText.Clear();
            EstimateText.Clear();
            TimeText.Clear();

            if (curRun != null)
            {
                curRun.PropertyChanged -= Run_PropertyChanged;
                curRun = null;
            }
        }