示例#1
0
 protected override void Render(HtmlTextWriter writer)
 {
     if (!String.IsNullOrEmpty(Text))
     {
         writer.Write(WebManager.GetLabel(Text, TemplateControl ?? NamingContainer));
     }
 }
示例#2
0
        public virtual void CommandHandler(Object sender, CommandEventArgs e)
        {
            ActionContext context = new ActionContext(e)
            {
                Sender = sender, Origin = this
            };

            WebManager.ExecuteAction(context);
        }
示例#3
0
            public override void Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
            {
                var selectActionArgs = new SelectEventArgs()
                {
                    DataSourceView = UnderlyingView, SelectArgs = arguments
                };

                selectActionArgs.Callback = delegate(IEnumerable data) {
                    selectActionArgs.Data = data;
                    callback(data);
                };
                WebManager.ExecuteAction(
                    new ActionContext(
                        selectActionArgs
                        )
                {
                    Origin = ActionDS.ActionSourceControl ?? ActionDS.NamingContainer, Sender = ActionDS
                });
            }
示例#4
0
            public override void Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
            {
                var selectArgs = new ProviderDataSourceSelectEventArgs(arguments);

                DS.OnSelecting(this, selectArgs);
                var provider = WebManager.GetService <IProvider <object, object> >(DS.ProviderName);

                if (provider == null)
                {
                    throw new Exception("Underlying data provider service not found: " + DS.ProviderName);
                }
                var result     = provider.Provide(selectArgs.ProviderContext);
                var resultList = result is IList ? (IList)result : new object[] { result };

                var resultArr = new object[resultList.Count];

                for (int i = 0; i < resultList.Count; i++)
                {
                    resultArr[i] = resultList[i] is IDictionary ? new DictionaryView((IDictionary)resultList[i]) : resultList[i];
                }

                callback(resultArr);
            }
示例#5
0
 protected void PerformAction(ActionContext context, DataSourceViewOperationCallback callback)
 {
     WebManager.ExecuteAction(context);
 }