博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

类的一般标准写法

Posted on 2006-09-23 09:52  Kent  阅读(339)  评论(0)    收藏  举报

namespace System.Option
{
    public enum SearchDataType
    {
        Unknown, String, Integer, Float, Datetime
    }

    public class AdvancedSearchCondition
    {
        private string _DisplayName = string.Empty;
        private string _FieldName = string.Empty;
        private SearchDataType _DataType = SearchDataType.Unknown;
        private string _Value = string.Empty;

        public string DisplayName
        {
            get { return this._DisplayName; }
            set { this._DisplayName = value; }
        }

        public string FieldName
        {
            get { return this._FieldName; }
            set { this._FieldName = value; }
        }

        public SearchDataType DataType
        {
            get { return this._DataType; }
            set { this._DataType = value; }
        }

        public string Value
        {
            get { return this._Value; }
            set { this._Value = value; }
        }

        public AdvancedSearchCondition(string displayName, string fieldName, SearchDataType dataType)
        {
            this.DisplayName = displayName;
            this.FieldName = fieldName;
            this.DataType = dataType;
        }
    }
}