bool TryCreateRedirectionException(InstanceLockedException exception, out RedirectionException redirectionException) { Uri redirectVia = null; object redirectViaObject; string endpointName = this.invoker.endpoint != null ? this.invoker.endpoint.Name : null; XName endpointXName = endpointName == null ? null : WorkflowServiceNamespace.EndpointsPath.GetName(endpointName); if (endpointXName != null && exception.SerializableInstanceOwnerMetadata != null && exception.SerializableInstanceOwnerMetadata.TryGetValue(endpointXName, out redirectViaObject)) { redirectVia = redirectViaObject as Uri; } if (redirectVia == null) { redirectionException = null; return false; } redirectionException = new RedirectionException(RedirectionType.Resource, RedirectionDuration.Permanent, RedirectionScope.Session, new RedirectionLocation(redirectVia)); return true; }
private bool TryCreateRedirectionException(InstanceLockedException exception, out RedirectionException redirectionException) { Uri address = null; object obj2; string localName = (this.invoker.endpoint != null) ? this.invoker.endpoint.Name : null; XName key = (localName == null) ? null : WorkflowServiceNamespace.EndpointsPath.GetName(localName); if (((key != null) && (exception.SerializableInstanceOwnerMetadata != null)) && exception.SerializableInstanceOwnerMetadata.TryGetValue(key, out obj2)) { address = obj2 as Uri; } if (address == null) { redirectionException = null; return false; } redirectionException = new RedirectionException(RedirectionType.Resource, RedirectionDuration.Permanent, RedirectionScope.Session, new RedirectionLocation[] { new RedirectionLocation(address) }); return true; }