src/EasyFrameWork/ViewPort/Descriptor/MutiSelectDescriptor.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/* http://www.zkea.net/ 
 * Copyright (c) ZKEASOFT. All rights reserved. 
 * http://www.zkea.net/licenses */

using System;
using Easy.ViewPort.Validator;
using System.Collections.Generic;
using Easy.Constant;
using System.Text;
using Easy.Modules.DataDictionary;
using Easy.Extend;
using System.Linq;
using System.Reflection;

namespace Easy.ViewPort.Descriptor
{
    public class MutiSelectDescriptor : BaseDescriptor<MutiSelectDescriptor>
    {
        private IDictionary<string, string> _data;
        private Func<Dictionary<string, string>> _souceFunc;
        public MutiSelectDescriptor(Type modelType, string property)
            : base(modelType, property)
        {
            this.TagType = HTMLEnumerate.HTMLTagTypes.MutiSelect;
            this.TemplateName = "MultiSelect";
        }


        public IDictionary<string, string> OptionItems
        {
            get
            {
                if (_souceFunc != null)
                {
                    _data = _souceFunc.Invoke();
                }
                if (this.SourceType == SourceType.Dictionary)
                {
                    IDataDictionaryService dicService = ServiceLocator.GetService<IDataDictionaryService>();
                    if (dicService != null)
                    {
                        _data = new Dictionary<string, string>();

                        var dicts = dicService.Get(m => m.DicName == this.SourceKey);
                        foreach (DataDictionaryEntity item in dicts)
                        {
                            if (!this._data.ContainsKey(item.DicValue))
                            {
                                this._data.Add(item.DicValue, item.Title);
                            }
                        }
                    }

                }
                return _data ?? (_data = new Dictionary<string, string>());
            }
        }
        public SourceType SourceType { get; set; }
        public string SourceKey { get; set; }
        public string GetOptions()
后面还有 63 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。