Esempio n. 1
0
        /// <summary>
        ///     The process request.
        /// </summary>
        /// <returns>
        ///     The <see cref="PipelineProcessorResponseValue" />.
        /// </returns>
        public override PipelineProcessorResponseValue ProcessRequest()
        {
            string message;

            if (_dialogResultProcessor.ProcessResult(RequestContext.Item, RequestContext.Value, out message))
            {
                return(new PipelineProcessorResponseValue {
                    Value = true
                });
            }

            return(new PipelineProcessorResponseValue {
                AbortMessage = message
            });
        }
Esempio n. 2
0
        internal virtual void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");
            if (!_sheerResponse.CheckModified())
            {
                return;
            }

            BaseLayoutItem currentItem = DeserializeItems(args.Parameters["items"])[0];

            if (!args.IsPostBack)
            {
                var url = _dialogLocator.GetDialogUrl(currentItem);
                if (!string.IsNullOrEmpty(url))
                {
                    _sheerResponse.ShowModalDialog(url);
                    args.WaitForPostBack();
                }
                else
                {
                    _sheerResponse.Alert("Could not get the dialog URL.");
                }
            }
            else if (args.HasResult)
            {
                string message;
                if (_dialogResultProcessor.ProcessResult(currentItem, args.Result, out message))
                {
                    Refresh();
                }
                else
                {
                    _sheerResponse.Alert(string.IsNullOrEmpty(message)
                        ? "An unknown error occured while processing your selection."
                        : message);
                }
            }
        }