⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 category.cs

📁 详细介绍中小企业的网站编程,附有详细的注释,对需要制作网站的朋友有很大的帮助,有需要的朋友可下载,
💻 CS
字号:
using System;


///<summary>
/// 分类项
/// 表示企业的产品类别,以便于企业组织他们的产品
/// </summary>
public class Category
{
    private string  _id;          
    private bool    _visible;      
    private string  _title;         
    private string  _description;  
    private string  _imageUrl;      
    private string  _imageAltText;  
                
    public Category(string id, bool visible, string title)
    {
        if (String.IsNullOrEmpty(id)) throw new ArgumentException(Messages.CategoryIdUndefined);
        if (String.IsNullOrEmpty(title)) throw new ArgumentException(Messages.CategoryTitleUndefined);            

        _id             = id;
        _visible        = visible;
        _title          = title;
     
    }


    public string Id
    {
        get { return _id; }
    }

    public string Title
    {
        get { return String.IsNullOrEmpty(_title) ? String.Empty : _title; }
        set 
        { 
            if (String.IsNullOrEmpty(value))
                throw new InvalidOperationException(Messages.ItemTitleIsNull);
            _title = value; }
    }

    public bool Visible
    {
        get { return _visible; }
        set { _visible = value; }
    }

    
    public string Description
    {
        get { return String.IsNullOrEmpty(_description) ? String.Empty : _description; }
        set { _description= value; }
    }

    public string ImageUrl
    {
        get { return String.IsNullOrEmpty(_imageUrl) ? String.Empty : _imageUrl; }
        set { _imageUrl= value; }
    }

    public string ImageAltText
    {
        get { return String.IsNullOrEmpty(_imageAltText) ? String.Empty : _imageAltText; }
        set { _imageAltText = value; }
    }
    
} // end class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -