/// <summary> /// Creates a new proxy that is identical to the passed proxy, except /// for its facet. This call does not contact the server and always succeeds. /// </summary> /// <param name="b">The proxy to cast to ObjectPrx.</param> /// <param name="f">The facet for the new proxy.</param> /// <returns>The new proxy with the specified facet.</returns> public static ObjectPrx uncheckedCast(ObjectPrx b, string f) { ObjectPrx d = null; if(b != null) { ObjectPrx bb = b.ice_facet(f); ObjectPrxHelper h = new ObjectPrxHelper(); h.copyFrom__(bb); d = h; } return d; }
/// <summary> /// Creates a new proxy that is identical to the passed proxy, except /// for its facet. This call contacts /// the server and throws an Ice run-time exception if the target /// object does not exist, the specified facet does not exist, or the server cannot be reached. /// </summary> /// <param name="b">The proxy to cast to ObjectPrx.</param> /// <param name="f">The facet for the new proxy.</param> /// <param name="ctx">The Context map for the invocation.</param> /// <returns>The new proxy with the specified facet.</returns> public static ObjectPrx checkedCast(ObjectPrx b, string f, Dictionary<string, string> ctx) { ObjectPrx d = null; if(b != null) { try { ObjectPrx bb = b.ice_facet(f); bool ok = bb.ice_isA("::Ice::Object", ctx); Debug.Assert(ok); ObjectPrxHelper h = new ObjectPrxHelper(); h.copyFrom__(bb); d = h; } catch(Ice.FacetNotExistException) { } } return d; }