protected override BindingElement CreateBindingElement()
        {
            GZipMessageEncodingBindingElement bindingElement = new GZipMessageEncodingBindingElement();

            ApplyConfiguration(bindingElement);
            return(bindingElement);
        }
        public override void ApplyConfiguration(BindingElement bindingElement)
        {
            GZipMessageEncodingBindingElement binding      = (GZipMessageEncodingBindingElement)bindingElement;
            PropertyInformationCollection     propertyInfo = ElementInformation.Properties;

            // ReSharper disable PossibleNullReferenceException
            if (propertyInfo["innerMessageEncoding"].ValueOrigin != PropertyValueOrigin.Default)
            // ReSharper restore PossibleNullReferenceException
            {
                switch (InnerMessageEncoding)
                {
                case "textMessageEncoding":
                    binding.InnerMessageEncodingBindingElement = new TextMessageEncodingBindingElement();
                    break;

                case "binaryMessageEncoding":
                    binding.InnerMessageEncodingBindingElement = new BinaryMessageEncodingBindingElement();
                    break;
                }
            }
            ApplyConfiguration(binding.ReaderQuotas);
        }