掌握actionscript 3.0宝典的重点内容就是这么简单

很多人一说到 actionscript 3.0宝典就会觉得内容实在是太多了,学习起来有很大的难度。但是事实上其实我们在学习actionscript 3.0宝典的时候,要想掌握其中的知识信息,掌握重点,关键是在于自己对actionscript 3.0宝典的学习技巧的掌握。比如说:
public class HomeController :Controller
    {
        public ActionResult Index()
        {
            var model = new DemoModel {Email ="test@test.com"};
            return View(model);
        }
    }
    public class DemoModel
    {
        [DataType(DataType.EmailAddress)]
        public string Email { get; set; }
    }
创建对应的强类型视图
@modelTestMvc.Controllers.DemoModel
<fieldset>
    <legend>DemoModel</legend>
    <div >
        @Html.DisplayFor(model =>model.Email)
    </div>
</fieldset>
public class ModelMetadata
    {
        private readonly Type _modelType;       //Model的类型
        private readonly string_propertyName;  //属性名称
        private object _model;                  //Model的值
        private Func<object>_modelAccessor;    //为了用Lambd给Model传值(这是潮流)
        privateIEnumerable<ModelMetadata> _properties; //Model属性值的ModelMetadata集合
        
        //通过子类的ComputeXX系列函数将Model的注解特性赋值到下面几个属性
        public virtual string DataTypeName {get; set; }
        public virtual string Description {get; set; }
        public virtual stringDisplayFormatString { get; set; }
        public virtual string DisplayName {get; set; }
        (其它略,属性太多了,影响阅读...)


        public object Model
        {
            get
            {
                if (_modelAccessor != null)
                {
                    _model = _modelAccessor();
                    _modelAccessor = null;
                }
                return _model;
            }
        }
        public virtualIEnumerable<ModelMetadata> Properties
        {
            get
            {
                if (_properties == null)
                {
                   IEnumerable<ModelMetadata> originalProperties =Provider.GetMetadataForProperties(Model, RealModelType);
                    _propertiesInternal =SortProperties(originalProperties.AsArray());
                    _properties = newReadOnlyCollection<ModelMetadata>(_propertiesInternal);
                }
                return _properties;
            }
        }
        protected ModelMetadataProviderProvider { get; set; }    //ModelMetadata的创建者(后面会有介绍)
        public virtual string TemplateHint {get; set; }          //Model显示用的模板名称
public classCachedDataAnnotationsModelMetadata :CachedModelMetadata<CachedDataAnnotationsMetadataAttributes>
    {
        publicCachedDataAnnotationsModelMetadata(CachedDataAnnotationsModelMetadataProviderprovider, Type containerType, Type modelType, string propertyName,IEnumerable<Attribute> attributes)
            : base(provider, containerType,modelType, propertyName, newCachedDataAnnotationsMetadataAttributes(attributes.ToArray()))
        {
             PrototypeCache = newCachedDataAnnotationMetadataAttributes(attributes.ToArray());  //这个赋值应该在它的父类CachedModelMetadata
以上是关于actionscript 3.0宝典的重点内容,我们在学习actionscript 3.0宝典的时候只要是能够懂得掌握上述的知识信息,那么我们在学习actionscript 3.0宝典的时候基本就能够掌握其中的核心内容了。关于actionscript3.0的操作也就掌握的八九不离十了。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值