예제 #1
0
        protected override bool Process(IInteraction parameters)
        {
            StringComposeInteraction composer = new StringComposeInteraction(parameters, Encoding.UTF8);

            bool success = WithBranch.TryProcess(composer);

            if (log)
            {
                Secretary.Report(5, composer.ToString());
            }

            return(success);
        }
예제 #2
0
        /// <summary>
        /// Attempts to assemple requesst URI
        /// </summary>
        /// <returns><c>true</c>, if the attempt was successful.</returns>
        /// <param name="parameters">Parameters.</param>
        /// <param name="uri">Output URI.</param>
        protected bool TryProduceURI(IInteraction parameters, out string uri)
        {
            bool successful = true;

            if (this.URI == null)
            {
                uri = this.DefaultURI;
            }
            else
            {
                StringComposeInteraction uriComposer = new StringComposeInteraction(parameters, this.UrlEncoding);

                successful &= this.URI.TryProcess(uriComposer);

                uri = uriComposer.ToString();
            }

            return(successful);
        }