20078888

技术前线

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

using System;
namespace Model  //命名空间
{

    //CodeStyle 类

    public class CodeStyle
    {
        private string _afternamespace;
        private string _beforenamespace;
        private CacheFrames _cacheframe = CacheFrames.Cache;
        private CodeFrames _codeframe = CodeFrames.Factory;
        private string _connvariable;
        private DALFrames _dalframe;

        public string AfterNamespace
        {
            get
            {
                return this._afternamespace;
            }
            set
            {
                this._afternamespace = value;
            }
        }

        public string AfterNamespaceDot
        {
            get
            {
                if (this._afternamespace != string.Empty)
                {
                    return (this._afternamespace + ".");
                }
                return string.Empty;
            }
        }

        public string AfterNamespaceLine
        {
            get
            {
                if (this._afternamespace != string.Empty)
                {
                    return (this._afternamespace + "_");
                }
                return string.Empty;
            }
        }

        public string BeforeNamespace
        {
            get
            {
                return this._beforenamespace;
            }
            set
            {
                this._beforenamespace = value;
            }
        }

        public string BeforeNamespaceDot
        {
            get
            {
                if (this._beforenamespace != string.Empty)
                {
                    return (this._beforenamespace + ".");
                }
                return string.Empty;
            }
        }

        public CacheFrames CacheFrame
        {
            get
            {
                return this._cacheframe;
            }
            set
            {
                this._cacheframe = value;
            }
        }

        public CodeFrames CodeFrame
        {
            get
            {
                return this._codeframe;
            }
            set
            {
                this._codeframe = value;
            }
        }

        public string ConnVariable
        {
            get
            {
                return this._connvariable;
            }
            set
            {
                this._connvariable = value;
            }
        }

        public DALFrames DALFrame
        {
            get
            {
                return this._dalframe;
            }
            set
            {
                this._dalframe = value;
            }
        }

        public string DotAfterNamespace
        {
            get
            {
                if (this._afternamespace != string.Empty)
                {
                    return ("." + this._afternamespace);
                }
                return string.Empty;
            }
        }

        public enum CacheFrames
        {
            None,
            Cache,
            AggregateDependency
        }

        public enum CodeFrames
        {
            Simple,
            Factory
        }

        public enum DALFrames
        {
            Sql,
            Sp
        }
    }
}

posted on 2010-05-07 17:25  许雪林  阅读(121)  评论(0)    收藏  举报