コード例 #1
0
 internal void OnSelecting(object sender, ComponentDataSourceSelectEventArgs e)
 {
     if (Selecting != null)
     {
         Selecting(sender, e);
     }
 }
コード例 #2
0
            public override void Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
            {
                var selectArgs = new ComponentDataSourceSelectEventArgs(arguments);

                DS.OnSelecting(this, selectArgs);
                var data = AppContext.ComponentFactory.GetComponent(DS.ComponentName, typeof(IEnumerable)) as IEnumerable;

                if (data == null)
                {
                    throw new Exception("Component not found: " + DS.ComponentName);
                }

                var result = new List <object>();

                foreach (var entry in data)
                {
                    result.Add(entry is IDictionary ? new DictionaryView((IDictionary)entry) : entry);
                }
                callback(result);
            }