Exemple #1
0
        protected override bool Process(IInteraction parameters)
        {
            HttpInteraction interaction = (HttpInteraction)parameters.GetClosest(typeof(HttpInteraction));

            string mimeType;

            if (MimeType.Length > 0)
            {
                if (this.CharSet.Length > 0)
                {
                    mimeType = string.Format(
                        "{0}; charset={1}",
                        this.MimeType,
                        this.CharSet);
                }
                else
                {
                    mimeType = this.MimeType;
                }
                interaction.SetContentType(mimeType);
            }

            interaction.SetStatusCode(this.Statuscode);

            return(WithBranch.TryProcess(parameters));
        }