示例#1
0
        protected AbstractViewModelMetadataDictionary(Expression <Func <IEntityService <DataDictionary> > > lazyLoadedService, IViewModelDisplayNameCollection displayNameCollection, ViewModelMetadataWrapper viewModelMetaDataWrapper)
        {
            displayNameCollection.Guard(string.Format("{0}.", typeof(IViewModelDisplayNameCollection).Name));
            viewModelMetaDataWrapper.Guard(string.Format("{0}.", typeof(ViewModelMetadataWrapper).Name));

            _lazyLoadedService       = lazyLoadedService;
            ViewModelMetaDataWrapper = viewModelMetaDataWrapper;
            DisplayNameCollection    = displayNameCollection;
        }
 public ViewModelMetadataDictionaryCached(Expression <Func <IEntityService <DataDictionary> > > lazyLoadedService, IViewModelDisplayNameCollection displayNameCollection, ViewModelMetadataWrapper viewModelMetaDataWrapper) : base(lazyLoadedService, displayNameCollection, viewModelMetaDataWrapper)
 {
 }
示例#3
0
 private bool IsValidViewModel(ViewModelMetadataWrapper wrapper)
 {
     return(wrapper.Container != null
            //&& wrapper.Container.Name.Contains("ViewModel")
            && !string.IsNullOrEmpty(wrapper.PropertyName));
 }
示例#4
0
 private bool IsAttributeClearForAdd(ViewModelMetadataWrapper wrapper)
 {
     return(!wrapper.Attributes.Any(attribute => attribute is DisplayAttribute));
 }
示例#5
0
        private List <AbstractViewModelMetadataDictionary> CreateMetaDataAttributeOverrider(ViewModelMetadataWrapper wrapper)
        {
            var viewModelDictionary = new List <AbstractViewModelMetadataDictionary>
            {
                new ViewModelMetadataDictionaryLoader(_lazyLoadedService, DisplayNameCollection, wrapper),
                new ViewModelMetadataDictionaryCached(_lazyLoadedService, DisplayNameCollection, wrapper)
            };

            return(viewModelDictionary);
        }