定义枚举的时候是这样吗?
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 编辑 ]