标题:定义枚举的时候是这样吗?
只看楼主
ganmaoaq
Rank: 2
等 级:论坛游民
帖 子:11
专家分:43
注 册:2009-8-17
结帖率:0
已结贴  问题点数:20 回复次数:3 
定义枚举的时候是这样吗?
using System;
using System.Collections.Generic;
using System.Text;

namespace Accp
{
    public enum MovieType
    {
        //喜剧
         Comedy,
        //战争
        War,
       // 爱情
            Romance,
        //动作
        Action,
        //卡通
        Cartoon,
        //恐怖
        Thriller
    }
    [Serializable]
   public class Movie
    {
       public Movie() { }
       public Movie(string moviename,string poster,http://www.,string actor,MovieType movietype ,int price)
       {
           this._movieName = moviename;
           this._poster = poster;
           this._director = director;
           this._actor = actor;
           this._movieType = movietype;
           this._price = price;

       }
       //电影名
        private string _movieName;
        public string MovieName
        {
            get { return _movieName; }
            set { _movieName = value; }
        }
       //海报图片
        private string _poster;
        public string Poster
        {
            get { return _poster; }
            set { _poster = value; }
        }
       //导演名
        private string _director;
        public string Director
        {
            get { return _director; }
            set { _director = value; }
        }
       //主演
        private string _actor;
        public string Actor
        {
            get { return _actor; }
            set { _actor = value; }
        }
       //电影类型
        private MovieType _movieType;
        public MovieType MovieType
        {
            get { return _movieType; }
            set { _movieType = value; }
        }
       //票价
        private int _price;

        public int Price
        {
            get { return _price; }
            set { _price = value; }
        }
      
    }
}

[ 本帖最后由 ganmaoaq 于 2009-8-17 07:39 编辑 ]
搜索更多相关主题的帖子: 枚举 定义 
2009-08-17 07:29
野比
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:24
帖 子:1627
专家分:516
注 册:2007-5-24
得分:6 
正确

女侠,约吗?
2009-08-19 19:01
ぃ…景雪←之恋
Rank: 1
等 级:新手上路
帖 子:3
专家分:7
注 册:2009-8-18
得分:6 
是这样!
2009-08-20 11:09
飙马
Rank: 5Rank: 5
来 自:马里亚纳
等 级:贵宾
威 望:15
帖 子:779
专家分:280
注 册:2007-3-28
得分:6 
还可以这样 :

public enum MovieType
    {     
         Comedy=0,

         War=1,

         Romance=2,

         Action=3,

         Cartoon=4,

         Thriller=5
    }

IT精英如同彩票:平凡的人像5块也中不到一样普遍,努力一点你中了5元保了个本。奖金越高,机率也就越小,付出的也越多,盖茨如同500万一样稀有。虽然每天忙碌而平凡,但我努力成为精英,做梦中了500万。
2009-08-20 12:26



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-282954-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.147077 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved