< Summary

Information
Class: Ice.ObjectPrxHelper
Assembly: Ice
File(s): /_/csharp/src/Ice/Proxy.cs
Tag: 105_25977636357
Line coverage
85%
Covered lines: 12
Uncovered lines: 2
Coverable lines: 14
Total lines: 1819
Line coverage: 85.7%
Branch coverage
20%
Covered branches: 2
Total branches: 10
Branch coverage: 20%
Method coverage
80%
Covered methods: 8
Fully covered methods: 8
Total methods: 10
Method coverage: 80%
Full method coverage: 80%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
createProxy(...)50%22100%
checkedCast(...)0%2040%
checkedCast(...)0%620%
checkedCastAsync()100%11100%
checkedCastAsync(...)100%11100%
uncheckedCast(...)100%11100%
uncheckedCast(...)50%22100%
ice_staticId()100%11100%
iceNewInstance(...)100%11100%
.ctor(...)100%11100%

File(s)

/_/csharp/src/Ice/Proxy.cs

#LineLine coverage
 1// Copyright (c) ZeroC, Inc.
 2
 3#nullable enable
 4
 5using Ice.Internal;
 6using System.ComponentModel;
 7using System.Diagnostics.CodeAnalysis;
 8
 9namespace Ice;
 10
 11/// <summary>
 12/// The base interface of all Ice proxies.
 13/// </summary>
 14public interface ObjectPrx : IEquatable<ObjectPrx>
 15{
 16    /// <summary>
 17    /// Gets the communicator that created this proxy.
 18    /// </summary>
 19    /// <returns>The communicator that created this proxy.</returns>
 20    Communicator ice_getCommunicator();
 21
 22    /// <summary>
 23    /// Tests whether this object supports a specific Slice interface.
 24    /// </summary>
 25    /// <param name="id">The type ID of the Slice interface to test against.</param>
 26    /// <param name="context">The request context.</param>
 27    /// <returns><see langword="true"/> if the target object implements the Slice interface specified by <paramref name=
 28    /// or implements a derived interface, and <see langword="false"/> otherwise.</returns>
 29    bool ice_isA(string id, Dictionary<string, string>? context = null);
 30
 31    /// <summary>
 32    /// Tests whether this object supports a specific Slice interface.
 33    /// </summary>
 34    /// <param name="id">The type ID of the Slice interface to test against.</param>
 35    /// <param name="context">The request context.</param>
 36    /// <param name="progress">Sent progress provider.</param>
 37    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 38    /// <returns>A task that will complete with <see langword="true"/> if the target object implements the Slice
 39    /// interface specified by <paramref name="id"/> or implements a derived interface, and <see langword="false"/>
 40    /// otherwise.</returns>
 41    Task<bool> ice_isAAsync(
 42        string id,
 43        Dictionary<string, string>? context = null,
 44        IProgress<bool>? progress = null,
 45        CancellationToken cancel = default);
 46
 47    /// <summary>
 48    /// Tests whether the target object of this proxy can be reached.
 49    /// </summary>
 50    /// <param name="context">The request context.</param>
 51    void ice_ping(Dictionary<string, string>? context = null);
 52
 53    /// <summary>
 54    /// Tests whether the target object of this proxy can be reached.
 55    /// </summary>
 56    /// <param name="context">The request context.</param>
 57    /// <param name="progress">Sent progress provider.</param>
 58    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 59    /// <returns>A task that completes when the invocation completes.</returns>
 60    Task ice_pingAsync(
 61        Dictionary<string, string>? context = null,
 62        IProgress<bool>? progress = null,
 63        CancellationToken cancel = default);
 64
 65    /// <summary>
 66    /// Returns the Slice interfaces supported by this object as a list of Slice type IDs.
 67    /// </summary>
 68    /// <param name="context">The request context.</param>
 69    /// <returns>The Slice type IDs of the interfaces supported by this object, in alphabetical order.</returns>
 70    string[] ice_ids(Dictionary<string, string>? context = null);
 71
 72    /// <summary>
 73    /// Returns the Slice interfaces supported by this object as a list of Slice type IDs.
 74    /// </summary>
 75    /// <param name="context">The request context.</param>
 76    /// <param name="progress">Sent progress provider.</param>
 77    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 78    /// <returns>A task that will complete with The Slice type IDs of the interfaces supported by this object,
 79    /// in alphabetical order.</returns>
 80    Task<string[]> ice_idsAsync(
 81        Dictionary<string, string>? context = null,
 82        IProgress<bool>? progress = null,
 83        CancellationToken cancel = default);
 84
 85    /// <summary>
 86    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 87    /// </summary>
 88    /// <param name="context">The request context.</param>
 89    /// <returns>The Slice type ID of the most-derived interface.</returns>
 90    string ice_id(Dictionary<string, string>? context = null);
 91
 92    /// <summary>
 93    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 94    /// </summary>
 95    /// <param name="context">The request context.</param>
 96    /// <param name="progress">Sent progress provider.</param>
 97    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 98    /// <returns>The task object representing the asynchronous operation.</returns>
 99    Task<string> ice_idAsync(
 100        Dictionary<string, string>? context = null,
 101        IProgress<bool>? progress = null,
 102        CancellationToken cancel = default);
 103
 104    /// <summary>
 105    /// Invokes an operation dynamically.
 106    /// </summary>
 107    /// <param name="operation">The name of the operation to invoke.</param>
 108    /// <param name="mode">The operation mode (normal or idempotent).</param>
 109    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 110    /// <param name="outEncaps">The encoded out-parameters and return value
 111    /// for the operation. The return value follows any out-parameters.</param>
 112    /// <param name="context">The request context.</param>
 113    /// <returns>If the operation completed successfully, the return value is <see langword="true"/>.
 114    /// If the operation raises a user exception, the return value is <see langword="false"/>; in this case,
 115    /// <paramref name="outEncaps"/> contains the encoded user exception. If the operation raises a run-time exception,
 116    /// it throws it directly.</returns>
 117    bool ice_invoke(
 118        string operation,
 119        OperationMode mode,
 120        byte[] inEncaps,
 121        out byte[] outEncaps,
 122        Dictionary<string, string>? context = null);
 123
 124    /// <summary>
 125    /// Invokes an operation dynamically.
 126    /// </summary>
 127    /// <param name="operation">The name of the operation to invoke.</param>
 128    /// <param name="mode">The operation mode (normal or idempotent).</param>
 129    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 130    /// <param name="context">The request context.</param>
 131    /// <param name="progress">Sent progress provider.</param>
 132    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 133    /// <returns>The task object representing the asynchronous operation.</returns>
 134    Task<Object_Ice_invokeResult>
 135    ice_invokeAsync(
 136        string operation,
 137        OperationMode mode,
 138        byte[] inEncaps,
 139        Dictionary<string, string>? context = null,
 140        IProgress<bool>? progress = null,
 141        CancellationToken cancel = default);
 142
 143    /// <summary>
 144    /// Gets the identity embedded in this proxy.
 145    /// <returns>The identity of the target object.</returns>
 146    /// </summary>
 147    Identity ice_getIdentity();
 148
 149    /// <summary>
 150    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 151    /// <param name="newIdentity">The identity for the new proxy.</param>
 152    /// <returns>The proxy with the new identity.</returns>
 153    /// </summary>
 154    ObjectPrx ice_identity(Identity newIdentity);
 155
 156    /// <summary>
 157    /// Gets the per-proxy context for this proxy.
 158    /// </summary>
 159    /// <returns>The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value
 160    /// is null.</returns>
 161    Dictionary<string, string> ice_getContext();
 162
 163    /// <summary>
 164    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 165    /// </summary>
 166    /// <param name="newContext">The context for the new proxy.</param>
 167    /// <returns>The proxy with the new per-proxy context.</returns>
 168    ObjectPrx ice_context(Dictionary<string, string> newContext);
 169
 170    /// <summary>
 171    /// Gets the facet for this proxy.
 172    /// </summary>
 173    /// <returns>The facet for this proxy. If the proxy uses the default facet, the return value is the
 174    /// empty string.</returns>
 175    string ice_getFacet();
 176
 177    /// <summary>
 178    /// Creates a new proxy that is identical to this proxy, except for the facet.
 179    /// </summary>
 180    /// <param name="newFacet">The facet for the new proxy.</param>
 181    /// <returns>The proxy with the new facet.</returns>
 182    ObjectPrx ice_facet(string newFacet);
 183
 184    /// <summary>
 185    /// Gets the adapter ID for this proxy.
 186    /// </summary>
 187    /// <returns>The adapter ID. If the proxy does not have an adapter ID, the return value is the
 188    /// empty string.</returns>
 189    string ice_getAdapterId();
 190
 191    /// <summary>
 192    /// Creates a new proxy that is identical to this proxy, except for the adapter ID.
 193    /// </summary>
 194    /// <param name="newAdapterId">The adapter ID for the new proxy.</param>
 195    /// <returns>The proxy with the new adapter ID.</returns>
 196    ObjectPrx ice_adapterId(string newAdapterId);
 197
 198    /// <summary>
 199    /// Gets the endpoints used by this proxy.
 200    /// </summary>
 201    /// <returns>The endpoints used by this proxy.</returns>
 202    Endpoint[] ice_getEndpoints();
 203
 204    /// <summary>
 205    /// Creates a new proxy that is identical to this proxy, except for the endpoints.
 206    /// </summary>
 207    /// <param name="newEndpoints">The endpoints for the new proxy.</param>
 208    /// <returns>The proxy with the new endpoints.</returns>
 209    ObjectPrx ice_endpoints(Endpoint[] newEndpoints);
 210
 211    /// <summary>
 212    /// Gets the locator cache timeout of this proxy.
 213    /// </summary>
 214    /// <returns>The locator cache timeout value.</returns>
 215    TimeSpan ice_getLocatorCacheTimeout();
 216
 217    /// <summary>
 218    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 219    /// </summary>
 220    /// <param name="newTimeout">The new locator cache timeout (in seconds).</param>
 221    ObjectPrx ice_locatorCacheTimeout(int newTimeout);
 222
 223    /// <summary>
 224    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 225    /// </summary>
 226    /// <param name="newTimeout">The new locator cache timeout.</param>
 227    ObjectPrx ice_locatorCacheTimeout(TimeSpan newTimeout);
 228
 229    /// <summary>
 230    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 231    /// </summary>
 232    /// <param name="newTimeout">The new invocation timeout (in milliseconds).</param>
 233    ObjectPrx ice_invocationTimeout(int newTimeout);
 234
 235    /// <summary>
 236    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 237    /// </summary>
 238    /// <param name="newTimeout">The new invocation timeout.</param>
 239    ObjectPrx ice_invocationTimeout(TimeSpan newTimeout);
 240
 241    /// <summary>
 242    /// Gets the invocation timeout of this proxy.
 243    /// </summary>
 244    /// <returns>The invocation timeout value.</returns>
 245    TimeSpan ice_getInvocationTimeout();
 246
 247    /// <summary>
 248    /// Returns whether this proxy caches connections.
 249    /// </summary>
 250    /// <returns><see langword="true"/> if this proxy caches connections; <see langword="false"/> otherwise.</returns>
 251    bool ice_isConnectionCached();
 252
 253    /// <summary>
 254    /// Creates a new proxy that is identical to this proxy, except for connection caching.
 255    /// </summary>
 256    /// <param name="newCache"><see langword="true"/> if the new proxy should cache connections;
 257    /// <see langword="false"/> otherwise.</param>
 258    /// <returns>The new proxy with the specified caching policy.</returns>
 259    ObjectPrx ice_connectionCached(bool newCache);
 260
 261    /// <summary>
 262    /// Returns how this proxy selects endpoints (randomly or ordered).
 263    /// </summary>
 264    /// <returns>The endpoint selection policy.</returns>
 265    EndpointSelectionType ice_getEndpointSelection();
 266
 267    /// <summary>
 268    /// Creates a new proxy that is identical to this proxy, except for the endpoint selection policy.
 269    /// </summary>
 270    /// <param name="newType">The new endpoint selection policy.</param>
 271    /// <returns>The new proxy with the specified endpoint selection policy.</returns>
 272    ObjectPrx ice_endpointSelection(EndpointSelectionType newType);
 273
 274    /// <summary>
 275    /// Creates a new proxy that is identical to this proxy, except for the encoding used to marshal
 276    /// parameters.
 277    /// </summary>
 278    /// <param name="encodingVersion">The encoding version to use to marshal requests parameters.</param>
 279    /// <returns>The new proxy with the specified encoding version.</returns>
 280    ObjectPrx ice_encodingVersion(EncodingVersion encodingVersion);
 281
 282    /// <summary>
 283    /// Gets the encoding version used to marshal requests parameters.
 284    /// </summary>
 285    /// <returns>The encoding version.</returns>
 286    EncodingVersion ice_getEncodingVersion();
 287
 288    /// <summary>
 289    /// Gets the router for this proxy.
 290    /// </summary>
 291    /// <returns>The router for the proxy. If no router is configured for the proxy, the return value
 292    /// is null.</returns>
 293    RouterPrx? ice_getRouter();
 294
 295    /// <summary>
 296    /// Creates a new proxy that is identical to this proxy, except for the router.
 297    /// </summary>
 298    /// <param name="router">The router for the new proxy.</param>
 299    /// <returns>The new proxy with the specified router.</returns>
 300    ObjectPrx ice_router(RouterPrx? router);
 301
 302    /// <summary>
 303    /// Gets the locator for this proxy.
 304    /// </summary>
 305    /// <returns>The locator for this proxy. If no locator is configured, the return value is null.</returns>
 306    LocatorPrx? ice_getLocator();
 307
 308    /// <summary>
 309    /// Creates a new proxy that is identical to this proxy, except for the locator.
 310    /// </summary>
 311    /// <param name="locator">The locator for the new proxy.</param>
 312    /// <returns>The new proxy with the specified locator.</returns>
 313    ObjectPrx ice_locator(LocatorPrx? locator);
 314
 315    /// <summary>
 316    /// Returns whether this proxy uses collocation optimization.
 317    /// </summary>
 318    /// <returns><see langword="true"/> if the proxy uses collocation optimization;
 319    /// <see langword="false"/> otherwise.</returns>
 320    bool ice_isCollocationOptimized();
 321
 322    /// <summary>
 323    /// Creates a new proxy that is identical to this proxy, except for collocation optimization.
 324    /// </summary>
 325    /// <param name="collocated"><see langword="true"/> if the new proxy enables collocation optimization;
 326    /// <see langword="false"/> otherwise.</param>
 327    /// <returns>The new proxy the specified collocation optimization.</returns>
 328    ObjectPrx ice_collocationOptimized(bool collocated);
 329
 330    /// <summary>
 331    /// Creates a new proxy that is identical to this proxy, but uses twoway invocations.
 332    /// </summary>
 333    /// <returns>A new proxy that uses twoway invocations.</returns>
 334    ObjectPrx ice_twoway();
 335
 336    /// <summary>
 337    /// Returns whether this proxy uses twoway invocations.
 338    /// </summary>
 339    /// <returns><see langword="true"/> if this proxy uses twoway invocations;
 340    /// <see langword="false"/> otherwise.</returns>
 341    bool ice_isTwoway();
 342
 343    /// <summary>
 344    /// Creates a new proxy that is identical to this proxy, but uses oneway invocations.
 345    /// </summary>
 346    /// <returns>A new proxy that uses oneway invocations.</returns>
 347    ObjectPrx ice_oneway();
 348
 349    /// <summary>
 350    /// Returns whether this proxy uses oneway invocations.
 351    /// </summary>
 352    /// <returns><see langword="true"/> if this proxy uses oneway invocations;
 353    /// <see langword="false"/> otherwise.</returns>
 354    bool ice_isOneway();
 355
 356    /// <summary>
 357    /// Creates a new proxy that is identical to this proxy, but uses batch oneway invocations.
 358    /// </summary>
 359    /// <returns>A new proxy that uses batch oneway invocations.</returns>
 360    ObjectPrx ice_batchOneway();
 361
 362    /// <summary>
 363    /// Returns whether this proxy uses batch oneway invocations.
 364    /// </summary>
 365    /// <returns><see langword="true"/> if this proxy uses batch oneway invocations;
 366    /// <see langword="false"/> otherwise.</returns>
 367    bool ice_isBatchOneway();
 368
 369    /// <summary>
 370    /// Creates a new proxy that is identical to this proxy, but uses datagram invocations.
 371    /// </summary>
 372    /// <returns>A new proxy that uses datagram invocations.</returns>
 373    ObjectPrx ice_datagram();
 374
 375    /// <summary>
 376    /// Returns whether this proxy uses datagram invocations.
 377    /// </summary>
 378    /// <returns><see langword="true"/> if this proxy uses datagram invocations;
 379    /// <see langword="false"/> otherwise.</returns>
 380    bool ice_isDatagram();
 381
 382    /// <summary>
 383    /// Creates a new proxy that is identical to this proxy, but uses batch datagram invocations.
 384    /// </summary>
 385    /// <returns>A new proxy that uses batch datagram invocations.</returns>
 386    ObjectPrx ice_batchDatagram();
 387
 388    /// <summary>
 389    /// Returns whether this proxy uses batch datagram invocations.
 390    /// </summary>
 391    /// <returns><see langword="true"/> if this proxy uses batch datagram invocations;
 392    /// <see langword="false"/> otherwise.</returns>
 393    bool ice_isBatchDatagram();
 394
 395    /// <summary>
 396    /// Creates a new proxy that is identical to this proxy, except for compression.
 397    /// </summary>
 398    /// <param name="compress"><see langword="true"/> enables compression for the new proxy;
 399    /// <see langword="false"/> disables compression.</param>
 400    /// <returns>A new proxy with the specified compression setting.</returns>
 401    ObjectPrx ice_compress(bool compress);
 402
 403    /// <summary>
 404    /// Gets the compression override setting of this proxy.
 405    /// </summary>
 406    /// <returns>The compression override setting. If null is returned, no override is set. Otherwise, <see langword="tr
 407    /// if compression is enabled, <see langword="false"/> otherwise.</returns>
 408    bool? ice_getCompress();
 409
 410    /// <summary>
 411    /// Creates a new proxy that is identical to this proxy, except for its connection ID.
 412    /// </summary>
 413    /// <param name="connectionId">The connection ID for the new proxy. An empty string removes the
 414    /// connection ID.</param>
 415    /// <returns>A new proxy with the specified connection ID.</returns>
 416    ObjectPrx ice_connectionId(string connectionId);
 417
 418    /// <summary>
 419    /// Gets the connection id of this proxy.
 420    /// </summary>
 421    /// <returns>The connection id.</returns>
 422    string ice_getConnectionId();
 423
 424    /// <summary>
 425    /// Returns a proxy that is identical to this proxy, except it's a fixed proxy bound
 426    /// the given connection.
 427    /// </summary>
 428    /// <param name="connection">The fixed proxy connection.</param>
 429    /// <returns>A fixed proxy bound to the given connection.</returns>
 430    ObjectPrx ice_fixed(Ice.Connection connection);
 431
 432    /// <summary>
 433    /// Returns whether this proxy is a fixed proxy.
 434    /// </summary>
 435    /// <returns><see langword="true"/> if this is a fixed proxy; <see langword="false"/> otherwise.</returns>
 436    bool ice_isFixed();
 437
 438    /// <summary>
 439    /// Gets the connection to the server that hosts the target object. This method establishes the connection to the
 440    /// server if it is not already established.
 441    /// </summary>
 442    /// <returns>The connection to the server that hosts the target object, or null when this proxy uses collocation
 443    /// optimization to communicate with the target object.</returns>
 444    Connection? ice_getConnection();
 445
 446    /// <summary>
 447    /// Gets the connection to the server that hosts the target object. This method establishes the connection to the
 448    /// server if it is not already established.
 449    /// </summary>
 450    /// <param name="progress">Sent progress provider.</param>
 451    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 452    /// <returns>The connection to the server that hosts the target object, or null when this proxy uses collocation
 453    /// optimization to communicate with the target object.</returns>
 454    Task<Connection?> ice_getConnectionAsync(IProgress<bool>? progress = null, CancellationToken cancel = default);
 455
 456    /// <summary>
 457    /// Gets the cached Connection for this proxy. If the proxy does not yet have an established
 458    /// connection, it does not attempt to create a connection.
 459    /// </summary>
 460    /// <returns>The cached Connection for this proxy (null if the proxy does not have
 461    /// an established connection).</returns>
 462    Connection? ice_getCachedConnection();
 463
 464    /// <summary>
 465    /// Flushes any pending batched requests for this proxy. The call blocks until the flush is complete.
 466    /// </summary>
 467    void ice_flushBatchRequests();
 468
 469    /// <summary>
 470    /// Asynchronously flushes any pending batched requests for this proxy.
 471    /// </summary>
 472    /// <param name="progress">Sent progress provider.</param>
 473    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 474    /// <returns>The task object representing the asynchronous operation.</returns>
 475    Task ice_flushBatchRequestsAsync(
 476        IProgress<bool>? progress = null,
 477        CancellationToken cancel = default);
 478
 479    /// <summary>
 480    /// Write a proxy to the output stream.
 481    /// </summary>
 482    /// <param name="os">Output stream object to write the proxy.</param>
 483    [EditorBrowsable(EditorBrowsableState.Never)]
 484    void iceWrite(OutputStream os);
 485
 486    /// <summary>
 487    /// Returns a scheduler object that uses the Ice thread pool.
 488    /// </summary>
 489    /// <returns>The task scheduler object.</returns>
 490    TaskScheduler ice_scheduler();
 491
 492    /// <summary>
 493    /// Ensures that a proxy received over the wire is not null.
 494    /// </summary>
 495    /// <param name="proxy">The proxy to check.</param>
 496    /// <param name="current">The current object of the corresponding incoming request.</param>
 497    /// <exception cref="MarshalException">Thrown when the proxy is null.</exception>
 498    static void checkNotNull(ObjectPrx? proxy, Current current)
 499    {
 500        if (proxy is null)
 501        {
 502            throw new MarshalException(
 503                $"Null proxy passed to '{current.operation}' on object '{current.adapter.getCommunicator().identityToStr
 504        }
 505    }
 506}
 507
 508/// <summary>
 509/// Represent the result of the ice_invokeAsync operation.
 510/// </summary>
 511public record struct Object_Ice_invokeResult(bool returnValue, byte[] outEncaps);
 512
 513/// <summary>
 514/// Base class of all object proxies.
 515/// </summary>
 516public abstract class ObjectPrxHelperBase : ObjectPrx
 517{
 518    public static bool operator ==(ObjectPrxHelperBase? lhs, ObjectPrxHelperBase? rhs) =>
 519        lhs is not null ? lhs.Equals(rhs) : rhs is null;
 520
 521    public static bool operator !=(ObjectPrxHelperBase? lhs, ObjectPrxHelperBase? rhs) => !(lhs == rhs);
 522
 523    /// <summary>
 524    /// Returns whether this proxy equals the passed object. Two proxies are equal if they are equal in all
 525    /// respects, that is, if their object identity, endpoints timeout settings, and so on are all equal.
 526    /// </summary>
 527    /// <param name="other">The proxy to compare this proxy with.</param>
 528    /// <returns><see langword="true"/> if this proxy is equal to <paramref name="other"/>;
 529    /// <see langword="false"/> otherwise.</returns>
 530    public bool Equals(ObjectPrx? other) =>
 531        other is not null && _reference == ((ObjectPrxHelperBase)other)._reference;
 532
 533    public override bool Equals(object? obj) => Equals(obj as ObjectPrx);
 534
 535    /// <summary>
 536    /// Returns a hash code for this proxy.
 537    /// </summary>
 538    /// <returns>The hash code.</returns>
 539    public override int GetHashCode() => _reference.GetHashCode();
 540
 541    /// <summary>
 542    /// Gets the communicator that created this proxy.
 543    /// </summary>
 544    /// <returns>The communicator that created this proxy.</returns>
 545    public Communicator ice_getCommunicator() => _reference.getCommunicator();
 546
 547    /// <summary>
 548    /// Gets the stringified form of this proxy.
 549    /// </summary>
 550    /// <returns>The stringified proxy.</returns>
 551    public override string ToString() => _reference.ToString();
 552
 553    /// <summary>
 554    /// Tests whether this object supports a specific Slice interface.
 555    /// </summary>
 556    /// <param name="id">The type ID of the Slice interface to test against.</param>
 557    /// <param name="context">The request context.</param>
 558    /// <returns><see langword="true"/> if the target object has the interface specified by id or derives
 559    /// from the interface specified by id.</returns>
 560    public bool ice_isA(string id, Dictionary<string, string>? context = null)
 561    {
 562        try
 563        {
 564            return iceI_ice_isAAsync(id, context, synchronous: true, progress: null, CancellationToken.None).Result;
 565        }
 566        catch (AggregateException ex)
 567        {
 568            throw ex.InnerException!;
 569        }
 570    }
 571
 572    /// <summary>
 573    /// Tests whether this object supports a specific Slice interface.
 574    /// </summary>
 575    /// <param name="id">The type ID of the Slice interface to test against.</param>
 576    /// <param name="context">The request context.</param>
 577    /// <param name="progress">Sent progress provider.</param>
 578    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 579    /// <returns>The task object representing the asynchronous operation.</returns>
 580    public Task<bool> ice_isAAsync(
 581        string id,
 582        Dictionary<string, string>? context = null,
 583        IProgress<bool>? progress = null,
 584        CancellationToken cancel = default) => iceI_ice_isAAsync(id, context, synchronous: false, progress, cancel);
 585
 586    private Task<bool>
 587    iceI_ice_isAAsync(
 588        string id,
 589        Dictionary<string, string>? context,
 590        bool synchronous,
 591        IProgress<bool>? progress,
 592        CancellationToken cancel)
 593    {
 594        iceCheckTwowayOnly(_ice_isA_name);
 595        var completed = new OperationTaskCompletionCallback<bool>(progress, cancel);
 596        iceI_ice_isA(id, context, completed, synchronous);
 597        return completed.Task;
 598    }
 599
 600    private const string _ice_isA_name = "ice_isA";
 601
 602    private void iceI_ice_isA(
 603        string id,
 604        Dictionary<string, string>? context,
 605        OutgoingAsyncCompletionCallback completed,
 606        bool synchronous)
 607    {
 608        getOutgoingAsync<bool>(completed).invoke(
 609            _ice_isA_name,
 610            OperationMode.Idempotent,
 611            FormatType.CompactFormat,
 612            context,
 613            synchronous,
 614            (OutputStream os) => os.writeString(id),
 615            null,
 616            (InputStream iss) => iss.readBool());
 617    }
 618
 619    /// <summary>
 620    /// Tests whether the target object of this proxy can be reached.
 621    /// </summary>
 622    /// <param name="context">The request context.</param>
 623    public void ice_ping(Dictionary<string, string>? context = null)
 624    {
 625        try
 626        {
 627            iceI_ice_pingAsync(context, synchronous: true, progress: null, CancellationToken.None).Wait();
 628        }
 629        catch (AggregateException ex)
 630        {
 631            throw ex.InnerException!;
 632        }
 633    }
 634
 635    /// <summary>
 636    /// Tests whether the target object of this proxy can be reached.
 637    /// </summary>
 638    /// <param name="context">The request context.</param>
 639    /// <param name="progress">Sent progress provider.</param>
 640    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 641    /// <returns>The task object representing the asynchronous operation.</returns>
 642    public Task ice_pingAsync(
 643        Dictionary<string, string>? context = null,
 644        IProgress<bool>? progress = null,
 645        CancellationToken cancel = default) => iceI_ice_pingAsync(context, synchronous: false, progress, cancel);
 646
 647    private Task
 648    iceI_ice_pingAsync(
 649        Dictionary<string, string>? context,
 650        bool synchronous,
 651        IProgress<bool>? progress,
 652        CancellationToken cancel)
 653    {
 654        var completed = new OperationTaskCompletionCallback<object>(progress, cancel);
 655        iceI_ice_ping(context, completed, synchronous);
 656        return completed.Task;
 657    }
 658
 659    private const string _ice_ping_name = "ice_ping";
 660
 661    private void iceI_ice_ping(
 662        Dictionary<string, string>? context,
 663        OutgoingAsyncCompletionCallback completed,
 664        bool synchronous)
 665    {
 666        getOutgoingAsync<object>(completed).invoke(
 667            _ice_ping_name,
 668            OperationMode.Idempotent,
 669            FormatType.CompactFormat,
 670            context,
 671            synchronous);
 672    }
 673
 674    /// <summary>
 675    /// Gets the Slice type IDs of the interfaces supported by the target object of this proxy.
 676    /// </summary>
 677    /// <param name="context">The request context.</param>
 678    /// <returns>The Slice type IDs of the interfaces supported by the target object, in alphabetical order.</returns>
 679    public string[] ice_ids(Dictionary<string, string>? context = null)
 680    {
 681        try
 682        {
 683            return iceI_ice_idsAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 684        }
 685        catch (AggregateException ex)
 686        {
 687            throw ex.InnerException!;
 688        }
 689    }
 690
 691    /// <summary>
 692    /// Gets the Slice type IDs of the interfaces supported by the target object of this proxy.
 693    /// </summary>
 694    /// <param name="context">The request context.</param>
 695    /// <param name="progress">Sent progress provider.</param>
 696    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 697    /// <returns>The task object representing the asynchronous operation.</returns>
 698    public Task<string[]>
 699    ice_idsAsync(
 700        Dictionary<string, string>? context = null,
 701        IProgress<bool>? progress = null,
 702        CancellationToken cancel = default) => iceI_ice_idsAsync(context, synchronous: false, progress, cancel);
 703
 704    private Task<string[]> iceI_ice_idsAsync(
 705        Dictionary<string, string>? context,
 706        bool synchronous,
 707        IProgress<bool>? progress,
 708        CancellationToken cancel)
 709    {
 710        iceCheckTwowayOnly(_ice_ids_name);
 711        var completed = new OperationTaskCompletionCallback<string[]>(progress, cancel);
 712        iceI_ice_ids(context, completed, synchronous);
 713        return completed.Task;
 714    }
 715
 716    private const string _ice_ids_name = "ice_ids";
 717
 718    private void iceI_ice_ids(
 719        Dictionary<string, string>? context,
 720        OutgoingAsyncCompletionCallback completed,
 721        bool synchronous)
 722    {
 723        getOutgoingAsync<string[]>(completed).invoke(
 724            _ice_ids_name,
 725            OperationMode.Idempotent,
 726            FormatType.CompactFormat,
 727            context,
 728            synchronous,
 729            read: (InputStream iss) => iss.readStringSeq());
 730    }
 731
 732    /// <summary>
 733    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 734    /// </summary>
 735    /// <param name="context">The request context.</param>
 736    /// <returns>The Slice type ID of the most-derived interface.</returns>
 737    public string ice_id(Dictionary<string, string>? context = null)
 738    {
 739        try
 740        {
 741            return iceI_ice_idAsync(context, synchronous: true, progress: null, CancellationToken.None).Result;
 742        }
 743        catch (AggregateException ex)
 744        {
 745            throw ex.InnerException!;
 746        }
 747    }
 748
 749    /// <summary>
 750    /// Gets the Slice type ID of the most-derived interface supported by the target object of this proxy.
 751    /// </summary>
 752    /// <param name="context">The request context.</param>
 753    /// <param name="progress">Sent progress provider.</param>
 754    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 755    /// <returns>The task object representing the asynchronous operation.</returns>
 756    public Task<string> ice_idAsync(
 757        Dictionary<string, string>? context = null,
 758        IProgress<bool>? progress = null,
 759        CancellationToken cancel = default) => iceI_ice_idAsync(context, synchronous: false, progress, cancel);
 760
 761    private Task<string>
 762    iceI_ice_idAsync(
 763        Dictionary<string, string>? context,
 764        bool synchronous,
 765        IProgress<bool>? progress,
 766        CancellationToken cancel)
 767    {
 768        iceCheckTwowayOnly(_ice_id_name);
 769        var completed = new OperationTaskCompletionCallback<string>(progress, cancel);
 770        iceI_ice_id(context, completed, synchronous);
 771        return completed.Task;
 772    }
 773
 774    private const string _ice_id_name = "ice_id";
 775
 776    private void iceI_ice_id(
 777        Dictionary<string, string>? context,
 778        OutgoingAsyncCompletionCallback completed,
 779        bool synchronous)
 780    {
 781        getOutgoingAsync<string>(completed).invoke(
 782            _ice_id_name,
 783            OperationMode.Idempotent,
 784            FormatType.CompactFormat,
 785            context,
 786            synchronous,
 787            read: (InputStream iss) => iss.readString());
 788    }
 789
 790    /// <summary>
 791    /// Invokes an operation dynamically.
 792    /// </summary>
 793    /// <param name="operation">The name of the operation to invoke.</param>
 794    /// <param name="mode">The operation mode (normal or idempotent).</param>
 795    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 796    /// <param name="outEncaps">The encoded out-parameters and return value
 797    /// for the operation. The return value follows any out-parameters.</param>
 798    /// <param name="context">The request context.</param>
 799    /// <returns>If the operation completed successfully, the return value is <see langword="true"/>.
 800    /// If the operation raises a user exception, the return value is <see langword="false"/>; in this case,
 801    /// <paramref name="outEncaps"/> contains the encoded user exception.
 802    /// If the operation raises a run-time exception, it throws it directly.</returns>
 803    public bool ice_invoke(
 804        string operation,
 805        OperationMode mode,
 806        byte[] inEncaps,
 807        out byte[] outEncaps,
 808        Dictionary<string, string>? context = null)
 809    {
 810        try
 811        {
 812            Object_Ice_invokeResult result = iceI_ice_invokeAsync(
 813                operation,
 814                mode,
 815                inEncaps,
 816                context,
 817                synchronous: true,
 818                progress: null,
 819                CancellationToken.None).Result;
 820            outEncaps = result.outEncaps;
 821            return result.returnValue;
 822        }
 823        catch (AggregateException ex)
 824        {
 825            throw ex.InnerException!;
 826        }
 827    }
 828
 829    /// <summary>
 830    /// Invokes an operation dynamically.
 831    /// </summary>
 832    /// <param name="operation">The name of the operation to invoke.</param>
 833    /// <param name="mode">The operation mode (normal or idempotent).</param>
 834    /// <param name="inEncaps">The encoded in-parameters for the operation.</param>
 835    /// <param name="context">The request context.</param>
 836    /// <param name="progress">Sent progress provider.</param>
 837    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 838    /// <returns>The task object representing the asynchronous operation.</returns>
 839    public Task<Object_Ice_invokeResult>
 840    ice_invokeAsync(
 841        string operation,
 842        OperationMode mode,
 843        byte[] inEncaps,
 844        Dictionary<string, string>? context = null,
 845        IProgress<bool>? progress = null,
 846        CancellationToken cancel = default) =>
 847            iceI_ice_invokeAsync(operation, mode, inEncaps, context, synchronous: false, progress, cancel);
 848
 849    private Task<Object_Ice_invokeResult>
 850    iceI_ice_invokeAsync(
 851        string operation,
 852        OperationMode mode,
 853        byte[] inEncaps,
 854        Dictionary<string, string>? context,
 855        bool synchronous,
 856        IProgress<bool>? progress,
 857        CancellationToken cancel)
 858    {
 859        var completed = new InvokeTaskCompletionCallback(progress, cancel);
 860        iceI_ice_invoke(operation, mode, inEncaps, context, completed, synchronous);
 861        return completed.Task;
 862    }
 863
 864    private void iceI_ice_invoke(
 865        string operation,
 866        OperationMode mode,
 867        byte[] inEncaps,
 868        Dictionary<string, string>? context,
 869        OutgoingAsyncCompletionCallback completed,
 870        bool synchronous) => getInvokeOutgoingAsync(completed).invoke(operation, mode, inEncaps, context, synchronous);
 871
 872    /// <summary>
 873    /// Gets the identity embedded in this proxy.
 874    /// </summary>
 875    /// <returns>The identity of the target object.</returns>
 876    public Identity ice_getIdentity() => _reference.getIdentity() with { };
 877
 878    /// <summary>
 879    /// Creates a new proxy that is identical to this proxy, except for the proxy identity.
 880    /// </summary>
 881    /// <param name="newIdentity">The identity for the new proxy.</param>
 882    /// <returns>The new proxy with the specified identity.</returns>
 883    /// <exception cref="ArgumentException">If the name of the new identity is empty.</exception>
 884    public ObjectPrx ice_identity(Identity newIdentity)
 885    {
 886        if (newIdentity.name.Length == 0)
 887        {
 888            throw new ArgumentException("The name of an Ice object identity cannot be empty.", nameof(newIdentity));
 889        }
 890        if (newIdentity == _reference.getIdentity())
 891        {
 892            return this;
 893        }
 894        else
 895        {
 896            return new ObjectPrxHelper(_reference.changeIdentity(newIdentity));
 897        }
 898    }
 899
 900    /// <summary>
 901    /// Gets the per-proxy context for this proxy.
 902    /// </summary>
 903    /// <returns>The per-proxy context. If the proxy does not have a per-proxy (implicit) context, the return value
 904    /// is null.</returns>
 905    public Dictionary<string, string> ice_getContext() => new Dictionary<string, string>(_reference.getContext());
 906
 907    /// <summary>
 908    /// Creates a new proxy that is identical to this proxy, except for the per-proxy context.
 909    /// </summary>
 910    /// <param name="newContext">The context for the new proxy.</param>
 911    /// <returns>The proxy with the new per-proxy context.</returns>
 912    public ObjectPrx ice_context(Dictionary<string, string> newContext) =>
 913        iceNewInstance(_reference.changeContext(newContext));
 914
 915    /// <summary>
 916    /// Gets the facet for this proxy.
 917    /// </summary>
 918    /// <returns>The facet for this proxy. If the proxy uses the default facet, the return value is the
 919    /// empty string.</returns>
 920    public string ice_getFacet() => _reference.getFacet();
 921
 922    /// <summary>
 923    /// Creates a new proxy that is identical to this proxy, except for the facet.
 924    /// </summary>
 925    /// <param name="newFacet">The facet for the new proxy.</param>
 926    /// <returns>The proxy with the new facet.</returns>
 927    public ObjectPrx ice_facet(string newFacet)
 928    {
 929        newFacet ??= "";
 930
 931        if (newFacet == _reference.getFacet())
 932        {
 933            return this;
 934        }
 935        else
 936        {
 937            return new ObjectPrxHelper(_reference.changeFacet(newFacet));
 938        }
 939    }
 940
 941    /// <summary>
 942    /// Gets the adapter ID for this proxy.
 943    /// </summary>
 944    /// <returns>The adapter ID. If the proxy does not have an adapter ID, the return value is the
 945    /// empty string.</returns>
 946    public string ice_getAdapterId() => _reference.getAdapterId();
 947
 948    /// <summary>
 949    /// Creates a new proxy that is identical to this proxy, except for the adapter ID.
 950    /// </summary>
 951    /// <param name="newAdapterId">The adapter ID for the new proxy.</param>
 952    /// <returns>The new proxy with the specified adapter ID.</returns>
 953    public ObjectPrx ice_adapterId(string newAdapterId)
 954    {
 955        newAdapterId ??= "";
 956
 957        if (newAdapterId == _reference.getAdapterId())
 958        {
 959            return this;
 960        }
 961        else
 962        {
 963            return iceNewInstance(_reference.changeAdapterId(newAdapterId));
 964        }
 965    }
 966
 967    /// <summary>
 968    /// Gets the endpoints used by this proxy.
 969    /// </summary>
 970    /// <returns>The endpoints used by this proxy.</returns>
 971    public Endpoint[] ice_getEndpoints() => (Endpoint[])_reference.getEndpoints().Clone();
 972
 973    /// <summary>
 974    /// Creates a new proxy that is identical to this proxy, except for the endpoints.
 975    /// </summary>
 976    /// <param name="newEndpoints">The endpoints for the new proxy.</param>
 977    /// <returns>The new proxy with the specified endpoints.</returns>
 978    public ObjectPrx ice_endpoints(Endpoint[] newEndpoints)
 979    {
 980        newEndpoints ??= [];
 981
 982        if (_reference.getEndpoints().SequenceEqual(newEndpoints))
 983        {
 984            return this;
 985        }
 986        else
 987        {
 988            var endpoints = new EndpointI[newEndpoints.Length];
 989            for (int i = 0; i < newEndpoints.Length; ++i)
 990            {
 991                endpoints[i] = (EndpointI)newEndpoints[i];
 992            }
 993            return iceNewInstance(_reference.changeEndpoints(endpoints));
 994        }
 995    }
 996
 997    /// <summary>
 998    /// Gets the locator cache timeout of this proxy.
 999    /// </summary>
 1000    /// <returns>The locator cache timeout value.</returns>
 1001    public TimeSpan ice_getLocatorCacheTimeout() => _reference.getLocatorCacheTimeout();
 1002
 1003    /// <summary>
 1004    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 1005    /// </summary>
 1006    /// <param name="newTimeout">The new locator cache timeout (in seconds).</param>
 1007    /// <returns>The new proxy with the specified locator cache timeout.</returns>
 1008    public ObjectPrx ice_locatorCacheTimeout(int newTimeout) =>
 1009        ice_locatorCacheTimeout(TimeSpan.FromSeconds(newTimeout));
 1010
 1011    /// <summary>
 1012    /// Creates a new proxy that is identical to this proxy, except for the locator cache timeout.
 1013    /// </summary>
 1014    /// <param name="newTimeout">The new locator cache timeout.</param>
 1015    /// <returns>The new proxy with the specified locator cache timeout.</returns>
 1016    public ObjectPrx ice_locatorCacheTimeout(TimeSpan newTimeout)
 1017    {
 1018        if (newTimeout == _reference.getLocatorCacheTimeout())
 1019        {
 1020            return this;
 1021        }
 1022        else
 1023        {
 1024            return iceNewInstance(_reference.changeLocatorCacheTimeout(newTimeout));
 1025        }
 1026    }
 1027
 1028    /// <summary>
 1029    /// Gets the invocation timeout of this proxy.
 1030    /// </summary>
 1031    /// <returns>The invocation timeout value.</returns>
 1032    public TimeSpan ice_getInvocationTimeout() => _reference.getInvocationTimeout();
 1033
 1034    /// <summary>
 1035    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 1036    /// </summary>
 1037    /// <param name="newTimeout">The new invocation timeout (in milliseconds).</param>
 1038    /// <returns>The new proxy with the specified invocation timeout.</returns>
 1039    public ObjectPrx ice_invocationTimeout(int newTimeout) =>
 1040        ice_invocationTimeout(TimeSpan.FromMilliseconds(newTimeout));
 1041
 1042    /// <summary>
 1043    /// Creates a new proxy that is identical to this proxy, except for the invocation timeout.
 1044    /// </summary>
 1045    /// <param name="newTimeout">The new invocation timeout.</param>
 1046    /// <returns>The new proxy with the specified invocation timeout.</returns>
 1047    public ObjectPrx ice_invocationTimeout(TimeSpan newTimeout)
 1048    {
 1049        if (newTimeout == _reference.getInvocationTimeout())
 1050        {
 1051            return this;
 1052        }
 1053        else
 1054        {
 1055            return iceNewInstance(_reference.changeInvocationTimeout(newTimeout));
 1056        }
 1057    }
 1058
 1059    /// <summary>
 1060    /// Returns whether this proxy caches connections.
 1061    /// </summary>
 1062    /// <returns><see langword="true"/> if this proxy caches connections; <see langword="false"/> otherwise.</returns>
 1063    public bool ice_isConnectionCached() => _reference.getCacheConnection();
 1064
 1065    /// <summary>
 1066    /// Creates a new proxy that is identical to this proxy, except for connection caching.
 1067    /// </summary>
 1068    /// <param name="newCache"><see langword="true"/> if the new proxy should cache connections;
 1069    /// <see langword="false"/>, otherwise.</param>
 1070    /// <returns>The new proxy with the specified caching policy.</returns>
 1071    public ObjectPrx ice_connectionCached(bool newCache)
 1072    {
 1073        if (newCache == _reference.getCacheConnection())
 1074        {
 1075            return this;
 1076        }
 1077        else
 1078        {
 1079            return iceNewInstance(_reference.changeCacheConnection(newCache));
 1080        }
 1081    }
 1082
 1083    /// <summary>
 1084    /// Returns how this proxy selects endpoints (randomly or ordered).
 1085    /// </summary>
 1086    /// <returns>The endpoint selection policy.</returns>
 1087    public EndpointSelectionType ice_getEndpointSelection() => _reference.getEndpointSelection();
 1088
 1089    /// <summary>
 1090    /// Creates a new proxy that is identical to this proxy, except for the endpoint selection policy.
 1091    /// </summary>
 1092    /// <param name="newType">The new endpoint selection policy.</param>
 1093    /// <returns>The new proxy with the specified endpoint selection policy.</returns>
 1094    public ObjectPrx ice_endpointSelection(EndpointSelectionType newType)
 1095    {
 1096        if (newType == _reference.getEndpointSelection())
 1097        {
 1098            return this;
 1099        }
 1100        else
 1101        {
 1102            return iceNewInstance(_reference.changeEndpointSelection(newType));
 1103        }
 1104    }
 1105
 1106    /// <summary>
 1107    /// Creates a new proxy that is identical to this proxy, except for the encoding used to marshal
 1108    /// parameters.
 1109    /// </summary>
 1110    /// <param name="encodingVersion">The encoding version to use to marshal requests parameters.</param>
 1111    /// <returns>The new proxy with the specified encoding version.</returns>
 1112    public ObjectPrx ice_encodingVersion(EncodingVersion encodingVersion)
 1113    {
 1114        if (encodingVersion == _reference.getEncoding())
 1115        {
 1116            return this;
 1117        }
 1118        else
 1119        {
 1120            return iceNewInstance(_reference.changeEncoding(encodingVersion));
 1121        }
 1122    }
 1123
 1124    /// <summary>
 1125    /// Gets the encoding version used to marshal requests parameters.
 1126    /// </summary>
 1127    /// <returns>The encoding version.</returns>
 1128    public EncodingVersion ice_getEncodingVersion() => _reference.getEncoding();
 1129
 1130    /// <summary>
 1131    /// Gets the router for this proxy.
 1132    /// </summary>
 1133    /// <returns>The router for the proxy. If no router is configured for the proxy, the return value
 1134    /// is null.</returns>
 1135    public RouterPrx? ice_getRouter()
 1136    {
 1137        RouterInfo ri = _reference.getRouterInfo();
 1138        return ri?.getRouter();
 1139    }
 1140
 1141    /// <summary>
 1142    /// Creates a new proxy that is identical to this proxy, except for the router.
 1143    /// </summary>
 1144    /// <param name="router">The router for the new proxy.</param>
 1145    /// <returns>The new proxy with the specified router.</returns>
 1146    public ObjectPrx ice_router(RouterPrx? router)
 1147    {
 1148        if (router == _reference.getRouterInfo()?.getRouter())
 1149        {
 1150            return this;
 1151        }
 1152        else
 1153        {
 1154            return iceNewInstance(_reference.changeRouter(router));
 1155        }
 1156    }
 1157
 1158    /// <summary>
 1159    /// Gets the locator for this proxy.
 1160    /// </summary>
 1161    /// <returns>The locator for this proxy. If no locator is configured, the return value is null.</returns>
 1162    public LocatorPrx? ice_getLocator()
 1163    {
 1164        LocatorInfo li = _reference.getLocatorInfo();
 1165        return li?.getLocator();
 1166    }
 1167
 1168    /// <summary>
 1169    /// Creates a new proxy that is identical to this proxy, except for the locator.
 1170    /// </summary>
 1171    /// <param name="locator">The locator for the new proxy.</param>
 1172    /// <returns>The new proxy with the specified locator.</returns>
 1173    public ObjectPrx ice_locator(LocatorPrx? locator)
 1174    {
 1175        if (locator == _reference.getLocatorInfo()?.getLocator())
 1176        {
 1177            return this;
 1178        }
 1179        else
 1180        {
 1181            return iceNewInstance(_reference.changeLocator(locator));
 1182        }
 1183    }
 1184
 1185    /// <summary>
 1186    /// Returns whether this proxy uses collocation optimization.
 1187    /// </summary>
 1188    /// <returns><see langword="true"/> if the proxy uses collocation optimization;
 1189    /// <see langword="false"/>, otherwise.</returns>
 1190    public bool ice_isCollocationOptimized() => _reference.getCollocationOptimized();
 1191
 1192    /// <summary>
 1193    /// Creates a new proxy that is identical to this proxy, except for collocation optimization.
 1194    /// </summary>
 1195    /// <param name="collocated"><see langword="true"/> if the new proxy enables collocation optimization;
 1196    /// <see langword="false"/>, otherwise.</param>
 1197    /// <returns>The new proxy the specified collocation optimization.</returns>
 1198    public ObjectPrx ice_collocationOptimized(bool collocated)
 1199    {
 1200        if (collocated == _reference.getCollocationOptimized())
 1201        {
 1202            return this;
 1203        }
 1204        else
 1205        {
 1206            return iceNewInstance(_reference.changeCollocationOptimized(collocated));
 1207        }
 1208    }
 1209
 1210    /// <summary>
 1211    /// Creates a new proxy that is identical to this proxy, but uses twoway invocations.
 1212    /// </summary>
 1213    /// <returns>A new proxy that uses twoway invocations.</returns>
 1214    public ObjectPrx ice_twoway()
 1215    {
 1216        if (_reference.isTwoway)
 1217        {
 1218            return this;
 1219        }
 1220        else
 1221        {
 1222            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeTwoway));
 1223        }
 1224    }
 1225
 1226    /// <summary>
 1227    /// Returns whether this proxy uses twoway invocations.
 1228    /// </summary>
 1229    /// <returns><see langword="true"/> if this proxy uses twoway invocations;
 1230    /// <see langword="false"/> otherwise.</returns>
 1231    public bool ice_isTwoway() => _reference.isTwoway;
 1232
 1233    /// <summary>
 1234    /// Creates a new proxy that is identical to this proxy, but uses oneway invocations.
 1235    /// </summary>
 1236    /// <returns>A new proxy that uses oneway invocations.</returns>
 1237    public ObjectPrx ice_oneway()
 1238    {
 1239        if (_reference.getMode() == Reference.Mode.ModeOneway)
 1240        {
 1241            return this;
 1242        }
 1243        else
 1244        {
 1245            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeOneway));
 1246        }
 1247    }
 1248
 1249    /// <summary>
 1250    /// Returns whether this proxy uses oneway invocations.
 1251    /// </summary>
 1252    /// <returns><see langword="true"/> if this proxy uses oneway invocations;
 1253    /// <see langword="false"/> otherwise.</returns>
 1254    public bool ice_isOneway() => _reference.getMode() == Reference.Mode.ModeOneway;
 1255
 1256    /// <summary>
 1257    /// Creates a new proxy that is identical to this proxy, but uses batch oneway invocations.
 1258    /// </summary>
 1259    /// <returns>A new proxy that uses batch oneway invocations.</returns>
 1260    public ObjectPrx ice_batchOneway()
 1261    {
 1262        if (_reference.getMode() == Reference.Mode.ModeBatchOneway)
 1263        {
 1264            return this;
 1265        }
 1266        else
 1267        {
 1268            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeBatchOneway));
 1269        }
 1270    }
 1271
 1272    /// <summary>
 1273    /// Returns whether this proxy uses batch oneway invocations.
 1274    /// </summary>
 1275    /// <returns><see langword="true"/> if this proxy uses batch oneway invocations;
 1276    /// <see langword="false"/> otherwise.</returns>
 1277    public bool ice_isBatchOneway() => _reference.getMode() == Reference.Mode.ModeBatchOneway;
 1278
 1279    /// <summary>
 1280    /// Creates a new proxy that is identical to this proxy, but uses datagram invocations.
 1281    /// </summary>
 1282    /// <returns>A new proxy that uses datagram invocations.</returns>
 1283    public ObjectPrx ice_datagram()
 1284    {
 1285        if (_reference.getMode() == Reference.Mode.ModeDatagram)
 1286        {
 1287            return this;
 1288        }
 1289        else
 1290        {
 1291            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeDatagram));
 1292        }
 1293    }
 1294
 1295    /// <summary>
 1296    /// Returns whether this proxy uses datagram invocations.
 1297    /// </summary>
 1298    /// <returns><see langword="true"/> if this proxy uses datagram invocations;
 1299    /// <see langword="false"/> otherwise.</returns>
 1300    public bool ice_isDatagram() => _reference.getMode() == Reference.Mode.ModeDatagram;
 1301
 1302    /// <summary>
 1303    /// Creates a new proxy that is identical to this proxy, but uses batch datagram invocations.
 1304    /// </summary>
 1305    /// <returns>A new proxy that uses batch datagram invocations.</returns>
 1306    public ObjectPrx ice_batchDatagram()
 1307    {
 1308        if (_reference.getMode() == Reference.Mode.ModeBatchDatagram)
 1309        {
 1310            return this;
 1311        }
 1312        else
 1313        {
 1314            return iceNewInstance(_reference.changeMode(Reference.Mode.ModeBatchDatagram));
 1315        }
 1316    }
 1317
 1318    /// <summary>
 1319    /// Returns whether this proxy uses batch datagram invocations.
 1320    /// </summary>
 1321    /// <returns><see langword="true"/> if this proxy uses batch datagram invocations;
 1322    /// <see langword="false"/>, otherwise.</returns>
 1323    public bool ice_isBatchDatagram() => _reference.getMode() == Reference.Mode.ModeBatchDatagram;
 1324
 1325    /// <summary>
 1326    /// Creates a new proxy that is identical to this proxy, except for compression.
 1327    /// </summary>
 1328    /// <param name="compress"><see langword="true"/> enables compression for the new proxy;
 1329    /// <see langword="false"/> disables compression.</param>
 1330    /// <returns>A new proxy with the specified compression setting.</returns>
 1331    public ObjectPrx ice_compress(bool compress)
 1332    {
 1333        if (compress == _reference.getCompress())
 1334        {
 1335            return this;
 1336        }
 1337        else
 1338        {
 1339            return iceNewInstance(_reference.changeCompress(compress));
 1340        }
 1341    }
 1342
 1343    /// <summary>
 1344    /// Obtains the compression override setting of this proxy.
 1345    /// </summary>
 1346    /// <returns>The compression override setting. If no optional value is present, no override is
 1347    /// set. Otherwise, <see langword="true"/> if compression is enabled, <see langword="false"/> otherwise.</returns>
 1348    public bool? ice_getCompress() => _reference.getCompress();
 1349
 1350    /// <summary>
 1351    /// Creates a new proxy that is identical to this proxy, except for its connection ID.
 1352    /// </summary>
 1353    /// <param name="connectionId">The connection ID for the new proxy. An empty string removes the
 1354    /// connection ID.</param>
 1355    /// <returns>A new proxy with the specified connection ID.</returns>
 1356    public ObjectPrx ice_connectionId(string connectionId)
 1357    {
 1358        if (connectionId == _reference.getConnectionId())
 1359        {
 1360            return this;
 1361        }
 1362        else
 1363        {
 1364            return iceNewInstance(_reference.changeConnectionId(connectionId));
 1365        }
 1366    }
 1367
 1368    /// <summary>
 1369    /// Gets the connection id of this proxy.
 1370    /// </summary>
 1371    /// <returns>The connection id.</returns>
 1372    public string ice_getConnectionId() => _reference.getConnectionId();
 1373
 1374    /// <summary>
 1375    /// Returns a proxy that is identical to this proxy, except it's a fixed proxy bound
 1376    /// the given connection.
 1377    /// </summary>
 1378    /// <param name="connection">The fixed proxy connection.</param>
 1379    /// <returns>A fixed proxy bound to the given connection.</returns>
 1380    public ObjectPrx ice_fixed(Ice.Connection connection)
 1381    {
 1382        if (connection is null)
 1383        {
 1384            throw new ArgumentException("invalid null connection passed to ice_fixed");
 1385        }
 1386        if (!(connection is Ice.ConnectionI))
 1387        {
 1388            throw new ArgumentException("invalid connection passed to ice_fixed");
 1389        }
 1390
 1391        if (connection == _reference.getConnection())
 1392        {
 1393            return this;
 1394        }
 1395        else
 1396        {
 1397            return iceNewInstance(_reference.changeConnection((Ice.ConnectionI)connection));
 1398        }
 1399    }
 1400
 1401    /// <summary>
 1402    /// Returns whether this proxy is a fixed proxy.
 1403    /// </summary>
 1404    /// <returns><see langword="true"/> if this is a fixed proxy; <see langword="false"/> otherwise.</returns>
 1405    public bool ice_isFixed() => _reference is Ice.Internal.FixedReference;
 1406
 1407    public class GetConnectionTaskCompletionCallback : TaskCompletionCallback<Connection?>
 1408    {
 1409        public GetConnectionTaskCompletionCallback(
 1410            IProgress<bool>? progress = null,
 1411            CancellationToken cancellationToken = default)
 1412            : base(progress, cancellationToken)
 1413        {
 1414        }
 1415
 1416        public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) =>
 1417            SetResult(((ProxyGetConnection)og).getConnection());
 1418    }
 1419
 1420    public Connection? ice_getConnection()
 1421    {
 1422        try
 1423        {
 1424            var completed = new GetConnectionTaskCompletionCallback();
 1425            iceI_ice_getConnection(completed, true);
 1426            return completed.Task.Result;
 1427        }
 1428        catch (AggregateException ex)
 1429        {
 1430            throw ex.InnerException!;
 1431        }
 1432    }
 1433
 1434    public Task<Connection?> ice_getConnectionAsync(IProgress<bool>? progress, CancellationToken cancel)
 1435    {
 1436        var completed = new GetConnectionTaskCompletionCallback(progress, cancel);
 1437        iceI_ice_getConnection(completed, false);
 1438        return completed.Task;
 1439    }
 1440
 1441    private const string _ice_getConnection_name = "ice_getConnection";
 1442
 1443    private void iceI_ice_getConnection(OutgoingAsyncCompletionCallback completed, bool synchronous)
 1444    {
 1445        var outgoing = new ProxyGetConnection(this, completed);
 1446        outgoing.invoke(_ice_getConnection_name, synchronous);
 1447    }
 1448
 1449    /// <summary>
 1450    /// Gets the cached Connection for this proxy. If the proxy does not yet have an established
 1451    /// connection, it does not attempt to create a connection.
 1452    /// </summary>
 1453    /// <returns>The cached Connection for this proxy (null if the proxy does not have
 1454    /// an established connection).</returns>
 1455    public Connection? ice_getCachedConnection() => _requestHandlerCache.cachedConnection;
 1456
 1457    /// <summary>
 1458    /// Flushes any pending batched requests for this communicator. The call blocks until the flush is complete.
 1459    /// </summary>
 1460    public void ice_flushBatchRequests()
 1461    {
 1462        try
 1463        {
 1464            var completed = new FlushBatchTaskCompletionCallback();
 1465            iceI_ice_flushBatchRequests(completed, true);
 1466            completed.Task.Wait();
 1467        }
 1468        catch (AggregateException ex)
 1469        {
 1470            throw ex.InnerException!;
 1471        }
 1472    }
 1473
 1474    internal const string _ice_flushBatchRequests_name = "ice_flushBatchRequests";
 1475
 1476    public Task ice_flushBatchRequestsAsync(
 1477        IProgress<bool>? progress = null,
 1478        CancellationToken cancel = default)
 1479    {
 1480        var completed = new FlushBatchTaskCompletionCallback(progress, cancel);
 1481        iceI_ice_flushBatchRequests(completed, false);
 1482        return completed.Task;
 1483    }
 1484
 1485    private void iceI_ice_flushBatchRequests(OutgoingAsyncCompletionCallback completed, bool synchronous)
 1486    {
 1487        var outgoing = new ProxyFlushBatchAsync(this, completed);
 1488        outgoing.invoke(_ice_flushBatchRequests_name, synchronous);
 1489    }
 1490
 1491    public System.Threading.Tasks.TaskScheduler ice_scheduler() => _reference.getThreadPool();
 1492
 1493    [EditorBrowsable(EditorBrowsableState.Never)]
 1494    public void iceWrite(OutputStream os)
 1495    {
 1496        Identity.ice_write(os, _reference.getIdentity());
 1497        _reference.streamWrite(os);
 1498    }
 1499
 1500    internal Reference iceReference() => _reference;
 1501
 1502    [EditorBrowsable(EditorBrowsableState.Never)]
 1503    public void iceCheckTwowayOnly(string name)
 1504    {
 1505        //
 1506        // No mutex lock necessary, there is nothing mutable in this
 1507        // operation.
 1508        //
 1509
 1510        if (!ice_isTwoway())
 1511        {
 1512            throw new TwowayOnlyException(name);
 1513        }
 1514    }
 1515
 1516    internal RequestHandlerCache iceGetRequestHandlerCache() => _requestHandlerCache;
 1517
 1518    protected ObjectPrxHelperBase(ObjectPrx proxy)
 1519    {
 1520        // We don't supported decorated proxies here.
 1521        var helper = (ObjectPrxHelperBase)proxy;
 1522
 1523        _reference = helper._reference;
 1524        _requestHandlerCache = helper._requestHandlerCache;
 1525    }
 1526
 1527    protected OutgoingAsyncT<T>
 1528    getOutgoingAsync<T>(OutgoingAsyncCompletionCallback completed)
 1529    {
 1530        bool haveEntry = false;
 1531        InputStream? iss = null;
 1532        OutputStream? os = null;
 1533
 1534        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1535        {
 1536            lock (_mutex)
 1537            {
 1538                if (_streamCache != null && _streamCache.Count > 0)
 1539                {
 1540                    haveEntry = true;
 1541                    iss = _streamCache.First!.Value.iss;
 1542                    os = _streamCache.First.Value.os;
 1543
 1544                    _streamCache.RemoveFirst();
 1545                }
 1546            }
 1547        }
 1548        if (!haveEntry)
 1549        {
 1550            return new OutgoingAsyncT<T>(this, completed);
 1551        }
 1552        else
 1553        {
 1554            return new OutgoingAsyncT<T>(this, completed, os, iss);
 1555        }
 1556    }
 1557
 1558    private class InvokeOutgoingAsyncT : OutgoingAsync
 1559    {
 1560        public InvokeOutgoingAsyncT(
 1561            ObjectPrxHelperBase prx,
 1562            OutgoingAsyncCompletionCallback completionCallback,
 1563            OutputStream? os = null,
 1564            InputStream? iss = null)
 1565            : base(prx, completionCallback, os, iss)
 1566        {
 1567        }
 1568
 1569        public void invoke(
 1570            string operation,
 1571            OperationMode mode,
 1572            byte[] inParams,
 1573            Dictionary<string, string>? context,
 1574            bool synchronous)
 1575        {
 1576            try
 1577            {
 1578                prepare(operation, mode, context);
 1579                if (inParams is null || inParams.Length == 0)
 1580                {
 1581                    os_.writeEmptyEncapsulation(encoding_);
 1582                }
 1583                else
 1584                {
 1585                    os_.writeEncapsulation(inParams);
 1586                }
 1587                invoke(operation, synchronous);
 1588            }
 1589            catch (Exception ex)
 1590            {
 1591                abort(ex);
 1592            }
 1593        }
 1594
 1595        public Object_Ice_invokeResult
 1596        getResult(bool ok)
 1597        {
 1598            try
 1599            {
 1600                var ret = new Object_Ice_invokeResult();
 1601                if (proxy_.iceReference().isTwoway)
 1602                {
 1603                    ret.outEncaps = is_.readEncapsulation(out _);
 1604                }
 1605                else
 1606                {
 1607                    ret.outEncaps = [];
 1608                }
 1609                ret.returnValue = ok;
 1610                return ret;
 1611            }
 1612            finally
 1613            {
 1614                cacheMessageBuffers();
 1615            }
 1616        }
 1617    }
 1618
 1619    private class InvokeTaskCompletionCallback : TaskCompletionCallback<Object_Ice_invokeResult>
 1620    {
 1621        public InvokeTaskCompletionCallback(IProgress<bool>? progress, CancellationToken cancellationToken)
 1622            : base(progress, cancellationToken)
 1623        {
 1624        }
 1625
 1626        public override void handleInvokeSent(
 1627            bool sentSynchronously,
 1628            bool done,
 1629            bool alreadySent,
 1630            OutgoingAsyncBase og)
 1631        {
 1632            if (progress_ != null && !alreadySent)
 1633            {
 1634                progress_.Report(sentSynchronously);
 1635            }
 1636            if (done)
 1637            {
 1638                SetResult(new Object_Ice_invokeResult(true, []));
 1639            }
 1640        }
 1641
 1642        public override void handleInvokeResponse(bool ok, OutgoingAsyncBase og) =>
 1643            SetResult(((InvokeOutgoingAsyncT)og).getResult(ok));
 1644    }
 1645
 1646    private InvokeOutgoingAsyncT
 1647    getInvokeOutgoingAsync(OutgoingAsyncCompletionCallback completed)
 1648    {
 1649        bool haveEntry = false;
 1650        InputStream? iss = null;
 1651        OutputStream? os = null;
 1652
 1653        if (_reference.getInstance().cacheMessageBuffers() > 0)
 1654        {
 1655            lock (_mutex)
 1656            {
 1657                if (_streamCache != null && _streamCache.Count > 0)
 1658                {
 1659                    haveEntry = true;
 1660                    iss = _streamCache.First!.Value.iss;
 1661                    os = _streamCache.First.Value.os;
 1662
 1663                    _streamCache.RemoveFirst();
 1664                }
 1665            }
 1666        }
 1667        if (!haveEntry)
 1668        {
 1669            return new InvokeOutgoingAsyncT(this, completed);
 1670        }
 1671        else
 1672        {
 1673            return new InvokeOutgoingAsyncT(this, completed, os, iss);
 1674        }
 1675    }
 1676
 1677    internal void cacheMessageBuffers(InputStream iss, OutputStream os)
 1678    {
 1679        lock (_mutex)
 1680        {
 1681            _streamCache ??= new LinkedList<(InputStream, OutputStream)>();
 1682            _streamCache.AddLast((iss, os));
 1683        }
 1684    }
 1685
 1686    /// <summary>
 1687    /// Initializes a new instance of the <see cref="ObjectPrxHelperBase" /> class.
 1688    /// </summary>
 1689    /// <param name="reference">The reference for the new proxy.</param>
 1690    [EditorBrowsable(EditorBrowsableState.Never)]
 1691    protected ObjectPrxHelperBase(Reference reference)
 1692    {
 1693        _reference = reference;
 1694        _requestHandlerCache = new RequestHandlerCache(reference);
 1695    }
 1696
 1697    /// <summary>
 1698    /// Constructs a new proxy instance.
 1699    /// </summary>
 1700    /// <param name="reference">The reference for the new proxy.</param>
 1701    /// <returns>The new proxy instance.</returns>
 1702    [EditorBrowsable(EditorBrowsableState.Never)]
 1703    protected abstract ObjectPrxHelperBase iceNewInstance(Reference reference);
 1704
 1705    private readonly Reference _reference;
 1706    private readonly RequestHandlerCache _requestHandlerCache;
 1707    private LinkedList<(InputStream iss, OutputStream os)>? _streamCache;
 1708    private readonly object _mutex = new();
 1709}
 1710
 1711/// <summary>
 1712/// Base class for all proxy helpers.
 1713/// </summary>
 1714public class ObjectPrxHelper : ObjectPrxHelperBase
 1715{
 1716    /// <summary>
 1717    /// Creates a new proxy that implements <see cref="ObjectPrx" />.
 1718    /// </summary>
 1719    /// <param name="communicator">The communicator of the new proxy.</param>
 1720    /// <param name="proxyString">The string representation of the proxy.</param>
 1721    /// <returns>The new proxy.</returns>
 1722    /// <exception name="ParseException">Thrown when <paramref name="proxyString" /> is not a valid proxy string.
 1723    /// </exception>
 1724    public static ObjectPrx createProxy(Communicator communicator, string proxyString)
 1725    {
 11726        Reference? reference = communicator.instance.referenceFactory().create(proxyString, "");
 1727
 11728        return reference is not null ?
 11729            new ObjectPrxHelper(reference) :
 11730            throw new ParseException("Invalid empty proxy string.");
 1731    }
 1732
 1733    /// <summary>
 1734    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1735    /// </summary>
 1736    /// <param name="proxy">The source proxy.</param>
 1737    /// <param name="context">The request context.</param>
 1738    /// <returns>A new proxy with the requested type, or null if the target object does not support the requested type.
 1739    /// </returns>
 1740    public static ObjectPrx? checkedCast(ObjectPrx? proxy, Dictionary<string, string>? context = null) =>
 01741        proxy is not null && proxy.ice_isA("::Ice::Object", context) ? proxy : null;
 1742
 1743    /// <summary>
 1744    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1745    /// </summary>
 1746    /// <param name="proxy">The source proxy (can be null).</param>
 1747    /// <param name="facet">A facet name.</param>
 1748    /// <param name="context">The request context.</param>
 1749    /// <returns>A new proxy with the requested type and facet, or null if the target facet does not support the
 1750    /// requested type.</returns>
 1751    public static ObjectPrx? checkedCast(ObjectPrx? proxy, string facet, Dictionary<string, string>? context = null) =>
 01752        checkedCast(proxy?.ice_facet(facet), context);
 1753
 1754    /// <summary>
 1755    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1756    /// </summary>
 1757    /// <param name="proxy">The source proxy.</param>
 1758    /// <param name="context">The request context.</param>
 1759    /// <param name="progress">Sent progress provider.</param>
 1760    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 1761    /// <returns>A new proxy with the requested type, or null if the target object does not support the requested type.
 1762    /// </returns>
 1763    public static async Task<ObjectPrx?> checkedCastAsync(
 1764        ObjectPrx proxy,
 1765        Dictionary<string, string>? context = null,
 1766        IProgress<bool>? progress = null,
 1767        CancellationToken cancel = default) =>
 11768       await proxy.ice_isAAsync("::Ice::Object", context, progress, cancel).ConfigureAwait(false) ? proxy : null;
 1769
 1770    /// <summary>
 1771    /// Creates a new proxy from an existing proxy after confirming the target object's type via a remote invocation.
 1772    /// </summary>
 1773    /// <param name="proxy">The source proxy.</param>
 1774    /// <param name="facet">A facet name.</param>
 1775    /// <param name="context">The request context.</param>
 1776    /// <param name="progress">Sent progress provider.</param>
 1777    /// <param name="cancel">A cancellation token that receives the cancellation requests.</param>
 1778    /// <returns>A new proxy with the requested type and facet, or null if the target facet does not support the
 1779    /// requested type.</returns>
 1780    public static Task<ObjectPrx?> checkedCastAsync(
 1781        ObjectPrx proxy,
 1782        string facet,
 1783        Dictionary<string, string>? context = null,
 1784        IProgress<bool>? progress = null,
 1785        CancellationToken cancel = default) =>
 11786        checkedCastAsync(proxy.ice_facet(facet), context, progress, cancel);
 1787
 1788    /// <summary>
 1789    /// Creates a new proxy from an existing proxy.
 1790    /// </summary>
 1791    /// <param name="proxy">The source proxy.</param>
 1792    /// <returns>A new proxy with the requested type.</returns>
 1793    /// <remarks>This is a purely local operation.</remarks>
 1794    [return: NotNullIfNotNull(nameof(proxy))]
 11795    public static ObjectPrx? uncheckedCast(ObjectPrx? proxy) => proxy;
 1796
 1797    /// <summary>
 1798    /// Creates a new proxy from an existing proxy.
 1799    /// </summary>
 1800    /// <param name="proxy">The source proxy.</param>
 1801    /// <param name="facet">A facet name.</param>
 1802    /// <returns>A new proxy with the requested type and facet, or null if the source proxy is null.</returns>
 1803    /// <remarks>This is a purely local operation.</remarks>
 1804    [return: NotNullIfNotNull(nameof(proxy))]
 11805    public static ObjectPrx? uncheckedCast(ObjectPrx? proxy, string facet) => proxy?.ice_facet(facet);
 1806
 1807    /// <summary>
 1808    /// Gets the Slice type id of the interface or class associated with this proxy class.
 1809    /// </summary>
 1810    /// <returns>The type id, "::Ice::Object".</returns>
 11811    public static string ice_staticId() => Object.ice_staticId();
 1812
 11813    protected override ObjectPrxHelperBase iceNewInstance(Reference reference) => new ObjectPrxHelper(reference);
 1814
 1815    internal ObjectPrxHelper(Reference reference)
 11816        : base(reference)
 1817    {
 11818    }
 1819}