bool IsOfType (Type t) { if (direction == MessageDirection.Output) return Body != null && Body.ReturnValue != null && Body.ReturnValue.Type == t; else return Body.Parts.Count == 1 && Body.Parts [0].Type == t; }