public void SetJavascriptCallbackProperty(JavascriptCallbackResponseMessageProperty javascriptResponseMessageProperty) { if (this.javascriptWrapper == null) { this.javascriptWrapper = new JavascriptXmlWriterWrapper(this.messageEncoder.writeEncoding) { JavascriptResponseMessageProperty = javascriptResponseMessageProperty }; } else { this.javascriptWrapper.JavascriptResponseMessageProperty = javascriptResponseMessageProperty; } }
static internal JavascriptCallbackResponseMessageProperty TrySetupJavascriptCallback(string callbackParameterName) { JavascriptCallbackResponseMessageProperty javascriptProperty = null; if (!String.IsNullOrEmpty(callbackParameterName) && !OperationContext.Current.OutgoingMessageProperties.TryGetValue<JavascriptCallbackResponseMessageProperty>(JavascriptCallbackResponseMessageProperty.Name, out javascriptProperty)) { UriTemplateMatch match = WebOperationContext.Current.IncomingRequest.UriTemplateMatch; if (match != null && match.QueryParameters.AllKeys.Contains(callbackParameterName)) { string callbackName = match.QueryParameters[callbackParameterName]; if (!String.IsNullOrEmpty(callbackName)) { javascriptProperty = new JavascriptCallbackResponseMessageProperty { CallbackFunctionName = callbackName }; OperationContext.Current.OutgoingMessageProperties.Add(JavascriptCallbackResponseMessageProperty.Name, javascriptProperty); } } } return javascriptProperty; }