File

projects/wms-framework/src/lib/wcfserviceinvocationsupport/test/sampleservicewrapper.ts

Extends

AsyncCompletedEventArgs

Index

Properties
Methods
Accessors

Constructor

Public constructor(results: any[], exception: Exception, cancelled: boolean, userState: any)
Parameters :
Name Type Optional
results any[] No
exception Exception No
cancelled boolean No
userState any No

Properties

Private results
Type : any[]
Default value : null
Private _cancelled
Type : boolean
Default value : false
Inherited from AsyncCompletedEventArgs
Private _error
Type : Exception
Default value : null
Inherited from AsyncCompletedEventArgs
Private _state
Type : object
Default value : null
Inherited from AsyncCompletedEventArgs

Methods

Protected RaiseExceptionIfNecessary
RaiseExceptionIfNecessary()
Inherited from AsyncCompletedEventArgs

Raises a user-supplied exception if an asynchronous operation failed.

Returns : void

Accessors

Result
getResult()
import { ClientBase } from '../ClientBase';
import { IClientChannel } from '../IClientChannel';
import { SubscriptionEvent } from '../../utils/SubscriptionEvent';
import { AsyncCallback, IAsyncResult } from '../AsyncResultSupport';
import {
  convertTypeTo,
  ReflectionHelper,
} from '../../baseframework/ReflectionSupport';
import { ChannelBase } from '../ChannelBase';
import { injectable } from 'tsyringe';
import { Exception } from '../../baseframework/Exceptions';
import { ICommunicationObject } from '../CommunicationSupport';
import { ObservableCollection } from '../../baseframework/collections';
import { asExplicitImplementation } from '../../decorators/AsExplicitImplementation';
import { AsyncCompletedEventArgs } from '../AsyncCompletedEventArgs';
import { InvokeAsyncCompletedEventArgs } from '../InvokeAsyncCompletedEventArgs';
import {
  MyClassWithGuidMock,
  MyClassWithIListMock,
  MyClassWithTimeRangeMock,
} from './wcfinvocation.spec';

/**
 *  Class definitions in this file were created by converting a service reference
 *  to a service with the following contract:
 *
 *  @example
 * public interface IExperimentalServices
 * {
 *     [OperationContract]
 *     [System.ServiceModel.Web.WebInvoke(
 *         Method = "POST",
 *         ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         RequestFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         BodyStyle = System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest)]
 *     void SetTheCk(PersonInfo prs);

 *     [OperationContract]
 *     [System.ServiceModel.Web.WebInvoke(
 *         Method = "POST",
 *         ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         RequestFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         BodyStyle = System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest)]
 *     string GetCurrentCkcValue();
 * 
 *     [OperationContract]
 *     [System.ServiceModel.Web.WebInvoke(
 *         Method = "POST",
 *         ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         RequestFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         BodyStyle = System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest)]
 *     MyClassWithGuidMock GetGuidObject();
 *
 *     [OperationContract]
 *     [System.ServiceModel.Web.WebInvoke(
 *         Method = "POST",
 *         ResponseFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         RequestFormat = System.ServiceModel.Web.WebMessageFormat.Json,
 *         BodyStyle = System.ServiceModel.Web.WebMessageBodyStyle.WrappedRequest)]
 *     int AddTwoNumbers(int x, int y);
 * }
 */

@injectable()
export class PersonInfo {
  name: string = '';
  password: string = '';
  get Name() {
    return this.name;
  }
  set Name(value: string) {
    this.name = value;
  }
  get Password() {
    return this.password;
  }
  set Password(value: string) {
    this.password = value;
  }
}
//Could not Transform the Attributes Section
export class RoleInfo {
  private DescField: string = null;
  private NumField: number = 0;
  get Desc(): string {
    return this.DescField;
  }
  set Desc(value: string) {
    this.DescField = value;
  }
  get Num(): number {
    return this.NumField;
  }
  set Num(value: number) {
    this.NumField = value;
  }
}
export interface IExperimentalServices {
  BeginSetTheCk(
    prs: PersonInfo,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult;
  EndSetTheCk(result: IAsyncResult): void;
  BeginGetCurrentCkcValue(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult;
  EndGetCurrentCkcValue(result: IAsyncResult): string;
  BeginAddTwoNumbers(
    x: number,
    y: number,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult;
  EndAddTwoNumbers(result: IAsyncResult): number;
  BeginGetDataIndex(
    x: number,
    info: PersonInfo,
    roles: ObservableCollection<RoleInfo>,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult;
  EndGetDataIndex(result: IAsyncResult): number;
  BeginGetGuidObject(callback: AsyncCallback, asyncState: any): IAsyncResult;
  EndGetGuidObject(result: IAsyncResult): MyClassWithGuidMock;
  BeginGetTimeRangeObject(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult;
  EndGetTimeRangeObject(result: IAsyncResult): MyClassWithTimeRangeMock;
  BeginGetIListObject(callback: AsyncCallback, asyncState: any): IAsyncResult;
  EndGetIListObject(result: IAsyncResult): MyClassWithIListMock;
}
export interface IExperimentalServicesChannel
  extends IExperimentalServices,
    IClientChannel {}
//Could not Transform the Attributes Section
export class GetCurrentCkcValueCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): string {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<string>(this.results[0], String);
  }
}

//Could not Transform the Attributes Section
export class GetGuidObjectCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): MyClassWithGuidMock {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<MyClassWithGuidMock>(
      this.results[0],
      MyClassWithGuidMock
    );
  }
}

//Could not Transform the Attributes Section
export class GetTimeRangeObjectCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): MyClassWithTimeRangeMock {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<MyClassWithTimeRangeMock>(
      this.results[0],
      MyClassWithTimeRangeMock
    );
  }
}

//Could not Transform the Attributes Section
export class GetIListObjectCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): MyClassWithIListMock {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<MyClassWithIListMock>(
      this.results[0],
      MyClassWithIListMock
    );
  }
}

//Could not Transform the Attributes Section
export class AddTwoNumbersCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): number {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<number>(this.results[0], Number);
  }
}
//Could not Transform the Attributes Section
export class GetDataIndexCompletedEventArgs extends AsyncCompletedEventArgs {
  private results: any[] = null;
  public constructor(
    results: any[],
    exception: Exception,
    cancelled: boolean,
    userState: any
  ) {
    super(exception, cancelled, userState);
    this.results = results;
  }
  get Result(): number {
    super.RaiseExceptionIfNecessary();
    return convertTypeTo<number>(this.results[0], Number);
  }
}
//Could not Transform the Attributes Section
export class ExperimentalServicesClient extends ClientBase<IExperimentalServices> {
  constructor(p1?, p2?) {
    let endpointConfigurationName = <string>p1;
    let remoteAddress = <string>p2;
    super(endpointConfigurationName, remoteAddress);
    this.CloseCompleted = new SubscriptionEvent<
      (sender: any, e: AsyncCompletedEventArgs) => void
    >();
    this.OpenCompleted = new SubscriptionEvent<
      (sender: any, e: AsyncCompletedEventArgs) => void
    >();
    this.GetDataIndexCompleted = new SubscriptionEvent<
      (sender: any, e: GetDataIndexCompletedEventArgs) => void
    >();
    this.AddTwoNumbersCompleted = new SubscriptionEvent<
      (sender: any, e: AddTwoNumbersCompletedEventArgs) => void
    >();
    this.GetCurrentCkcValueCompleted = new SubscriptionEvent<
      (sender: any, e: GetCurrentCkcValueCompletedEventArgs) => void
    >();
    this.GetGuidObjectCompleted = new SubscriptionEvent<
      (sender: any, e: GetGuidObjectCompletedEventArgs) => void
    >();
    this.GetTimeRangeObjectCompleted = new SubscriptionEvent<
      (sender: any, e: GetTimeRangeObjectCompletedEventArgs) => void
    >();
    this.GetIListObjectCompleted = new SubscriptionEvent<
      (sender: any, e: GetIListObjectCompletedEventArgs) => void
    >();
    this.SetTheCkCompleted = new SubscriptionEvent<
      (sender: any, e: AsyncCompletedEventArgs) => void
    >();
    this.onCloseCompletedDelegate = null;
    this.onEndCloseDelegate = null;
    this.onBeginCloseDelegate = null;
    this.onOpenCompletedDelegate = null;
    this.onEndOpenDelegate = null;
    this.onBeginOpenDelegate = null;
    this.onGetDataIndexCompletedDelegate = null;
    this.onEndGetDataIndexDelegate = null;
    this.onBeginGetDataIndexDelegate = null;
    this.onAddTwoNumbersCompletedDelegate = null;
    this.onEndAddTwoNumbersDelegate = null;
    this.onBeginAddTwoNumbersDelegate = null;
    this.onGetCurrentCkcValueCompletedDelegate = null;
    this.onEndGetCurrentCkcValueDelegate = null;
    this.onBeginGetCurrentCkcValueDelegate = null;
    this.onSetTheCkCompletedDelegate = null;
    this.onEndSetTheCkDelegate = null;
    this.onBeginSetTheCkDelegate = null;
  }
  private onBeginSetTheCkDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndSetTheCkDelegate: (v1: IAsyncResult) => any[];
  private onSetTheCkCompletedDelegate: (v1: any) => void;
  private onBeginGetCurrentCkcValueDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndGetCurrentCkcValueDelegate: (v1: IAsyncResult) => any[];
  private onGetCurrentCkcValueCompletedDelegate: (v1: any) => void;

  private onBeginGetGuidObjectDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndGetGuidObjectDelegate: (v1: IAsyncResult) => any[];
  private onGetGuidObjectCompletedDelegate: (v1: any) => void;

  private onBeginGetTimeRangeObjectDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndGetTimeRangeObjectDelegate: (v1: IAsyncResult) => any[];
  private onGetTimeRangeObjectCompletedDelegate: (v1: any) => void;

  private onBeginGetIListObjectDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndGetIListObjectDelegate: (v1: IAsyncResult) => any[];
  private onGetIListObjectCompletedDelegate: (v1: any) => void;

  private onBeginAddTwoNumbersDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndAddTwoNumbersDelegate: (v1: IAsyncResult) => any[];
  private onAddTwoNumbersCompletedDelegate: (v1: any) => void;
  private onBeginGetDataIndexDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndGetDataIndexDelegate: (v1: IAsyncResult) => any[];
  private onGetDataIndexCompletedDelegate: (v1: any) => void;
  private onBeginOpenDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndOpenDelegate: (v1: IAsyncResult) => any[];
  private onOpenCompletedDelegate: (v1: any) => void;
  private onBeginCloseDelegate: (
    v1: any[],
    v2: AsyncCallback,
    v3: any
  ) => IAsyncResult;
  private onEndCloseDelegate: (v1: IAsyncResult) => any[];
  private onCloseCompletedDelegate: (v1: any) => void;

  SetTheCkCompleted: SubscriptionEvent<
    (sender: any, e: AsyncCompletedEventArgs) => void
  >;
  GetCurrentCkcValueCompleted: SubscriptionEvent<
    (sender: any, e: GetCurrentCkcValueCompletedEventArgs) => void
  >;
  GetGuidObjectCompleted: SubscriptionEvent<
    (sender: any, e: GetGuidObjectCompletedEventArgs) => void
  >;
  GetTimeRangeObjectCompleted: SubscriptionEvent<
    (sender: any, e: GetTimeRangeObjectCompletedEventArgs) => void
  >;
  GetIListObjectCompleted: SubscriptionEvent<
    (sender: any, e: GetIListObjectCompletedEventArgs) => void
  >;
  AddTwoNumbersCompleted: SubscriptionEvent<
    (sender: any, e: AddTwoNumbersCompletedEventArgs) => void
  >;
  GetDataIndexCompleted: SubscriptionEvent<
    (sender: any, e: GetDataIndexCompletedEventArgs) => void
  >;
  OpenCompleted: SubscriptionEvent<
    (sender: any, e: AsyncCompletedEventArgs) => void
  >;
  CloseCompleted: SubscriptionEvent<
    (sender: any, e: AsyncCompletedEventArgs) => void
  >;
  BeginSetTheCk_ExplicitImplementationOfIExperimentalServices(
    prs: PersonInfo,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginSetTheCk(prs, callback, asyncState);
  }
  EndSetTheCk_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): void {
    super.Channel.EndSetTheCk(result);
  }
  private OnBeginSetTheCk(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    let prs: PersonInfo = convertTypeTo<PersonInfo>(inValues[0], PersonInfo);
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginSetTheCk(prs, callback, asyncState);
  }
  private OnEndSetTheCk(result: IAsyncResult): any[] {
    convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndSetTheCk(result);
    return null;
  }
  private OnSetTheCkCompleted(state: any): void {
    if (this.SetTheCkCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.SetTheCkCompleted.toFunction()(
        this,
        new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)
      );
    }
  }
  public SetTheCkAsync__overload_0(prs: PersonInfo): void {
    this.SetTheCkAsync__overload_1(prs, null);
  }
  public SetTheCkAsync__overload_1(prs: PersonInfo, userState: any): void {
    if (this.onBeginSetTheCkDelegate == null) {
      this.onBeginSetTheCkDelegate = (v1, v2, v3) =>
        this.OnBeginSetTheCk(v1, v2, v3);
    }
    if (this.onEndSetTheCkDelegate == null) {
      this.onEndSetTheCkDelegate = (v1) => this.OnEndSetTheCk(v1);
    }
    if (this.onSetTheCkCompletedDelegate == null) {
      this.onSetTheCkCompletedDelegate = (v1) => this.OnSetTheCkCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginSetTheCkDelegate,
      <any>[prs],
      this.onEndSetTheCkDelegate,
      this.onSetTheCkCompletedDelegate,
      userState
    );
  }
  BeginGetCurrentCkcValue_ExplicitImplementationOfIExperimentalServices(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginGetCurrentCkcValue(callback, asyncState);
  }
  EndGetCurrentCkcValue_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): string {
    return super.Channel.EndGetCurrentCkcValue(result);
  }
  BeginGetGuidObject_ExplicitImplementationOfIExperimentalServices(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginGetGuidObject(callback, asyncState);
  }
  EndGetGuidObject_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): MyClassWithGuidMock {
    return super.Channel.EndGetGuidObject(result);
  }
  BeginGetTimeRangeObject_ExplicitImplementationOfIExperimentalServices(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginGetTimeRangeObject(callback, asyncState);
  }
  EndGetTimeRangeObject_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): MyClassWithTimeRangeMock {
    return super.Channel.EndGetTimeRangeObject(result);
  }
  BeginGetIListObject_ExplicitImplementationOfIExperimentalServices(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginGetIListObject(callback, asyncState);
  }
  EndGetIListObject_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): MyClassWithIListMock {
    return super.Channel.EndGetIListObject(result);
  }
  private OnBeginGetCurrentCkcValue(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginGetCurrentCkcValue(callback, asyncState);
  }
  private OnEndGetCurrentCkcValue(result: IAsyncResult): any[] {
    let retVal: string = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndGetCurrentCkcValue(result);
    return [retVal];
  }
  private OnGetCurrentCkcValueCompleted(state: any): void {
    if (this.GetCurrentCkcValueCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.GetCurrentCkcValueCompleted.toFunction()(
        this,
        new GetCurrentCkcValueCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public GetCurrentCkcValueAsync__overload_0(): void {
    this.GetCurrentCkcValueAsync__overload_1(null);
  }
  public GetCurrentCkcValueAsync__overload_1(userState: any): void {
    if (this.onBeginGetCurrentCkcValueDelegate == null) {
      this.onBeginGetCurrentCkcValueDelegate = (v1, v2, v3) =>
        this.OnBeginGetCurrentCkcValue(v1, v2, v3);
    }
    if (this.onEndGetCurrentCkcValueDelegate == null) {
      this.onEndGetCurrentCkcValueDelegate = (v1) =>
        this.OnEndGetCurrentCkcValue(v1);
    }
    if (this.onGetCurrentCkcValueCompletedDelegate == null) {
      this.onGetCurrentCkcValueCompletedDelegate = (v1) =>
        this.OnGetCurrentCkcValueCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginGetCurrentCkcValueDelegate,
      <any>null,
      this.onEndGetCurrentCkcValueDelegate,
      this.onGetCurrentCkcValueCompletedDelegate,
      userState
    );
  }

  private OnBeginGetGuidObject(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginGetGuidObject(callback, asyncState);
  }
  private OnEndGetGuidObject(result: IAsyncResult): any[] {
    let retVal: MyClassWithGuidMock = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndGetGuidObject(result);
    return [retVal];
  }
  private OnGetGuidObjectCompleted(state: any): void {
    if (this.GetGuidObjectCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.GetGuidObjectCompleted.toFunction()(
        this,
        new GetGuidObjectCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public GetGuidObjectAsync__overload_0(): void {
    this.GetGuidObjectAsync__overload_1(null);
  }
  public GetGuidObjectAsync__overload_1(userState: any): void {
    if (this.onBeginGetGuidObjectDelegate == null) {
      this.onBeginGetGuidObjectDelegate = (v1, v2, v3) =>
        this.OnBeginGetGuidObject(v1, v2, v3);
    }
    if (this.onEndGetGuidObjectDelegate == null) {
      this.onEndGetGuidObjectDelegate = (v1) => this.OnEndGetGuidObject(v1);
    }
    if (this.onGetGuidObjectCompletedDelegate == null) {
      this.onGetGuidObjectCompletedDelegate = (v1) =>
        this.OnGetGuidObjectCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginGetGuidObjectDelegate,
      <any>null,
      this.onEndGetGuidObjectDelegate,
      this.onGetGuidObjectCompletedDelegate,
      userState
    );
  }

  private OnBeginGetTimeRangeObject(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginGetTimeRangeObject(callback, asyncState);
  }
  private OnEndGetTimeRangeObject(result: IAsyncResult): any[] {
    let retVal: MyClassWithTimeRangeMock = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndGetTimeRangeObject(result);
    return [retVal];
  }
  private OnGetTimeRangeObjectCompleted(state: any): void {
    if (this.GetTimeRangeObjectCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.GetTimeRangeObjectCompleted.toFunction()(
        this,
        new GetTimeRangeObjectCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public GetTimeRangeObjectAsync__overload_0(): void {
    this.GetTimeRangeObjectAsync__overload_1(null);
  }
  public GetTimeRangeObjectAsync__overload_1(userState: any): void {
    if (this.onBeginGetTimeRangeObjectDelegate == null) {
      this.onBeginGetTimeRangeObjectDelegate = (v1, v2, v3) =>
        this.OnBeginGetTimeRangeObject(v1, v2, v3);
    }
    if (this.onEndGetTimeRangeObjectDelegate == null) {
      this.onEndGetTimeRangeObjectDelegate = (v1) =>
        this.OnEndGetTimeRangeObject(v1);
    }
    if (this.onGetTimeRangeObjectCompletedDelegate == null) {
      this.onGetTimeRangeObjectCompletedDelegate = (v1) =>
        this.OnGetTimeRangeObjectCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginGetTimeRangeObjectDelegate,
      <any>null,
      this.onEndGetTimeRangeObjectDelegate,
      this.onGetTimeRangeObjectCompletedDelegate,
      userState
    );
  }

  private OnBeginGetIListObject(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginGetIListObject(callback, asyncState);
  }
  private OnEndGetIListObject(result: IAsyncResult): any[] {
    let retVal: MyClassWithIListMock = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndGetIListObject(result);
    return [retVal];
  }
  private OnGetIListObjectCompleted(state: any): void {
    if (this.GetIListObjectCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.GetIListObjectCompleted.toFunction()(
        this,
        new GetIListObjectCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public GetIListObjectAsync__overload_0(): void {
    this.GetIListObjectAsync__overload_1(null);
  }
  public GetIListObjectAsync__overload_1(userState: any): void {
    if (this.onBeginGetIListObjectDelegate == null) {
      this.onBeginGetIListObjectDelegate = (v1, v2, v3) =>
        this.OnBeginGetIListObject(v1, v2, v3);
    }
    if (this.onEndGetIListObjectDelegate == null) {
      this.onEndGetIListObjectDelegate = (v1) => this.OnEndGetIListObject(v1);
    }
    if (this.onGetIListObjectCompletedDelegate == null) {
      this.onGetIListObjectCompletedDelegate = (v1) =>
        this.OnGetIListObjectCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginGetIListObjectDelegate,
      <any>null,
      this.onEndGetIListObjectDelegate,
      this.onGetIListObjectCompletedDelegate,
      userState
    );
  }

  BeginAddTwoNumbers_ExplicitImplementationOfIExperimentalServices(
    x: number,
    y: number,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginAddTwoNumbers(x, y, callback, asyncState);
  }
  EndAddTwoNumbers_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): number {
    return super.Channel.EndAddTwoNumbers(result);
  }
  private OnBeginAddTwoNumbers(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    let x: number = convertTypeTo<number>(inValues[0], Number);
    let y: number = convertTypeTo<number>(inValues[1], Number);
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginAddTwoNumbers(x, y, callback, asyncState);
  }
  private OnEndAddTwoNumbers(result: IAsyncResult): any[] {
    let retVal: number = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndAddTwoNumbers(result);
    return [retVal];
  }
  private OnAddTwoNumbersCompleted(state: any): void {
    if (this.AddTwoNumbersCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.AddTwoNumbersCompleted.toFunction()(
        this,
        new AddTwoNumbersCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public AddTwoNumbersAsync__overload_0(x: number, y: number): void {
    this.AddTwoNumbersAsync__overload_1(x, y, null);
  }
  public AddTwoNumbersAsync__overload_1(
    x: number,
    y: number,
    userState: any
  ): void {
    if (this.onBeginAddTwoNumbersDelegate == null) {
      this.onBeginAddTwoNumbersDelegate = (v1, v2, v3) =>
        this.OnBeginAddTwoNumbers(v1, v2, v3);
    }
    if (this.onEndAddTwoNumbersDelegate == null) {
      this.onEndAddTwoNumbersDelegate = (v1) => this.OnEndAddTwoNumbers(v1);
    }
    if (this.onAddTwoNumbersCompletedDelegate == null) {
      this.onAddTwoNumbersCompletedDelegate = (v1) =>
        this.OnAddTwoNumbersCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginAddTwoNumbersDelegate,
      <any>[x, y],
      this.onEndAddTwoNumbersDelegate,
      this.onAddTwoNumbersCompletedDelegate,
      userState
    );
  }
  BeginGetDataIndex_ExplicitImplementationOfIExperimentalServices(
    x: number,
    info: PersonInfo,
    roles: ObservableCollection<RoleInfo>,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return super.Channel.BeginGetDataIndex(
      x,
      info,
      roles,
      callback,
      asyncState
    );
  }
  EndGetDataIndex_ExplicitImplementationOfIExperimentalServices(
    result: IAsyncResult
  ): number {
    return super.Channel.EndGetDataIndex(result);
  }
  private OnBeginGetDataIndex(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    let x: number = convertTypeTo<number>(inValues[0], Number);
    let info: PersonInfo = convertTypeTo<PersonInfo>(inValues[1], PersonInfo);
    let roles: ObservableCollection<RoleInfo> = convertTypeTo<
      ObservableCollection<RoleInfo>
    >(inValues[2], ObservableCollection);
    return convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).BeginGetDataIndex(x, info, roles, callback, asyncState);
  }
  private OnEndGetDataIndex(result: IAsyncResult): any[] {
    let retVal: number = convertTypeTo<IExperimentalServices>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'wcfcookies.AppServices.IExperimentalServices'
      )
    ).EndGetDataIndex(result);
    return [retVal];
  }
  private OnGetDataIndexCompleted(state: any): void {
    if (this.GetDataIndexCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.GetDataIndexCompleted.toFunction()(
        this,
        new GetDataIndexCompletedEventArgs(
          e.Results,
          e.Error,
          e.Cancelled,
          e.UserState
        )
      );
    }
  }
  public GetDataIndexAsync__overload_0(
    x: number,
    info: PersonInfo,
    roles: ObservableCollection<RoleInfo>
  ): void {
    this.GetDataIndexAsync__overload_1(x, info, roles, null);
  }
  public GetDataIndexAsync__overload_1(
    x: number,
    info: PersonInfo,
    roles: ObservableCollection<RoleInfo>,
    userState: any
  ): void {
    if (this.onBeginGetDataIndexDelegate == null) {
      this.onBeginGetDataIndexDelegate = (v1, v2, v3) =>
        this.OnBeginGetDataIndex(v1, v2, v3);
    }
    if (this.onEndGetDataIndexDelegate == null) {
      this.onEndGetDataIndexDelegate = (v1) => this.OnEndGetDataIndex(v1);
    }
    if (this.onGetDataIndexCompletedDelegate == null) {
      this.onGetDataIndexCompletedDelegate = (v1) =>
        this.OnGetDataIndexCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginGetDataIndexDelegate,
      <any>[x, info, roles],
      this.onEndGetDataIndexDelegate,
      this.onGetDataIndexCompletedDelegate,
      userState
    );
  }
  private OnBeginOpen(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<ICommunicationObject>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'System.ServiceModel.ICommunicationObject'
      )
    ).BeginOpen(callback, asyncState);
  }
  private OnEndOpen(result: IAsyncResult): any[] {
    convertTypeTo<ICommunicationObject>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'System.ServiceModel.ICommunicationObject'
      )
    ).EndOpen(result);
    return null;
  }
  private OnOpenCompleted(state: any): void {
    if (this.OpenCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.OpenCompleted.toFunction()(
        this,
        new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)
      );
    }
  }
  public OpenAsync__overload_0(): void {
    this.OpenAsync__overload_1(null);
  }
  public OpenAsync__overload_1(userState: any): void {
    if (this.onBeginOpenDelegate == null) {
      this.onBeginOpenDelegate = (v1, v2, v3) => this.OnBeginOpen(v1, v2, v3);
    }
    if (this.onEndOpenDelegate == null) {
      this.onEndOpenDelegate = (v1) => this.OnEndOpen(v1);
    }
    if (this.onOpenCompletedDelegate == null) {
      this.onOpenCompletedDelegate = (v1) => this.OnOpenCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginOpenDelegate,
      <any>null,
      this.onEndOpenDelegate,
      this.onOpenCompletedDelegate,
      userState
    );
  }
  private OnBeginClose(
    inValues: any[],
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return convertTypeTo<ICommunicationObject>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'System.ServiceModel.ICommunicationObject'
      )
    ).BeginClose(callback, asyncState);
  }
  private OnEndClose(result: IAsyncResult): any[] {
    convertTypeTo<ICommunicationObject>(
      this,
      ReflectionHelper.getInterfaceRuntimeTypeInfo(
        'System.ServiceModel.ICommunicationObject'
      )
    ).EndClose(result);
    return null;
  }
  private OnCloseCompleted(state: any): void {
    if (this.CloseCompleted.toFunction() != null) {
      let e: InvokeAsyncCompletedEventArgs =
        convertTypeTo<InvokeAsyncCompletedEventArgs>(
          state,
          InvokeAsyncCompletedEventArgs
        );
      this.CloseCompleted.toFunction()(
        this,
        new AsyncCompletedEventArgs(e.Error, e.Cancelled, e.UserState)
      );
    }
  }
  public CloseAsync__overload_0(): void {
    this.CloseAsync__overload_1(null);
  }
  public CloseAsync__overload_1(userState: any): void {
    if (this.onBeginCloseDelegate == null) {
      this.onBeginCloseDelegate = (v1, v2, v3) => this.OnBeginClose(v1, v2, v3);
    }
    if (this.onEndCloseDelegate == null) {
      this.onEndCloseDelegate = (v1) => this.OnEndClose(v1);
    }
    if (this.onCloseCompletedDelegate == null) {
      this.onCloseCompletedDelegate = (v1) => this.OnCloseCompleted(v1);
    }
    super.InvokeAsync(
      this.onBeginCloseDelegate,
      <any>null,
      this.onEndCloseDelegate,
      this.onCloseCompletedDelegate,
      userState
    );
  }
  public CreateChannel(): IExperimentalServices {
    return new ExperimentalServicesClient.ExperimentalServicesClientChannel(
      this
    );
  }
  @asExplicitImplementation('wcfcookies.AppServices.IExperimentalServices')
  as_IExperimentalServices(): IExperimentalServices {
    return new ExperimentalServicesClient_IExperimentalServicesWrapper(this);
  }
}
class ExperimentalServicesClient_IExperimentalServicesWrapper
  implements IExperimentalServices
{
  constructor(public instance: ExperimentalServicesClient) {}
  isExplicitInterfaceImplementationWrapper = true;
  BeginSetTheCk(
    prs: PersonInfo,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return this.instance.BeginSetTheCk_ExplicitImplementationOfIExperimentalServices(
      prs,
      callback,
      asyncState
    );
  }
  EndSetTheCk(result: IAsyncResult): void {
    this.instance.EndSetTheCk_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginGetCurrentCkcValue(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return this.instance.BeginGetCurrentCkcValue_ExplicitImplementationOfIExperimentalServices(
      callback,
      asyncState
    );
  }
  EndGetCurrentCkcValue(result: IAsyncResult): string {
    return this.instance.EndGetCurrentCkcValue_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginGetGuidObject(callback: AsyncCallback, asyncState: any): IAsyncResult {
    return this.instance.BeginGetGuidObject_ExplicitImplementationOfIExperimentalServices(
      callback,
      asyncState
    );
  }
  EndGetGuidObject(result: IAsyncResult): MyClassWithGuidMock {
    return this.instance.EndGetGuidObject_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginGetTimeRangeObject(
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return this.instance.BeginGetTimeRangeObject_ExplicitImplementationOfIExperimentalServices(
      callback,
      asyncState
    );
  }
  EndGetTimeRangeObject(result: IAsyncResult): MyClassWithTimeRangeMock {
    return this.instance.EndGetTimeRangeObject_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginGetIListObject(callback: AsyncCallback, asyncState: any): IAsyncResult {
    return this.instance.BeginGetIListObject_ExplicitImplementationOfIExperimentalServices(
      callback,
      asyncState
    );
  }
  EndGetIListObject(result: IAsyncResult): MyClassWithIListMock {
    return this.instance.EndGetIListObject_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginAddTwoNumbers(
    x: number,
    y: number,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return this.instance.BeginAddTwoNumbers_ExplicitImplementationOfIExperimentalServices(
      x,
      y,
      callback,
      asyncState
    );
  }
  EndAddTwoNumbers(result: IAsyncResult): number {
    return this.instance.EndAddTwoNumbers_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
  BeginGetDataIndex(
    x: number,
    info: PersonInfo,
    roles: ObservableCollection<RoleInfo>,
    callback: AsyncCallback,
    asyncState: any
  ): IAsyncResult {
    return this.instance.BeginGetDataIndex_ExplicitImplementationOfIExperimentalServices(
      x,
      info,
      roles,
      callback,
      asyncState
    );
  }
  EndGetDataIndex(result: IAsyncResult): number {
    return this.instance.EndGetDataIndex_ExplicitImplementationOfIExperimentalServices(
      result
    );
  }
}
export namespace ExperimentalServicesClient {
  export class ExperimentalServicesClientChannel
    extends ChannelBase<IExperimentalServices>
    implements IExperimentalServices
  {
    public constructor(client: ClientBase<IExperimentalServices>) {
      super(client);
    }
    public BeginSetTheCk(
      prs: PersonInfo,
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(1).fill(undefined).map((x) => null);
      _args[0] = {
        name: 'prs',
        value: prs,
      };
      let _result: IAsyncResult = super.BeginInvoke(
        'SetTheCk',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndSetTheCk(result: IAsyncResult): void {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      super.EndInvoke('SetTheCk', <any>_args, result);
    }
    public BeginGetCurrentCkcValue(
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: IAsyncResult = super.BeginInvoke(
        'GetCurrentCkcValue',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndGetCurrentCkcValue(result: IAsyncResult): string {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: string = convertTypeTo<string>(
        super.EndInvoke('GetCurrentCkcValue', <any>_args, result),
        String
      );
      return _result;
    }
    public BeginGetGuidObject(
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: IAsyncResult = super.BeginInvoke(
        'GetGuidObject',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndGetGuidObject(result: IAsyncResult): MyClassWithGuidMock {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: MyClassWithGuidMock = convertTypeTo<MyClassWithGuidMock>(
        super.EndInvoke('GetGuidObject', <any>_args, result),
        MyClassWithGuidMock
      );
      return _result;
    }
    public BeginGetTimeRangeObject(
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: IAsyncResult = super.BeginInvoke(
        'GetTimeRangeObject',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndGetTimeRangeObject(
      result: IAsyncResult
    ): MyClassWithTimeRangeMock {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: MyClassWithTimeRangeMock =
        convertTypeTo<MyClassWithTimeRangeMock>(
          super.EndInvoke('GetRangeObject', <any>_args, result),
          MyClassWithTimeRangeMock
        );
      return _result;
    }
    public BeginGetIListObject(
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: IAsyncResult = super.BeginInvoke(
        'GetIListObject',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndGetIListObject(result: IAsyncResult): MyClassWithIListMock {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: MyClassWithIListMock = convertTypeTo<MyClassWithIListMock>(
        super.EndInvoke('GetIListObject', <any>_args, result),
        MyClassWithIListMock
      );
      return _result;
    }
    public BeginAddTwoNumbers(
      x: number,
      y: number,
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(2).fill(undefined).map((x) => null);
      _args[0] = {
        name: 'x',
        value: x,
      };
      _args[1] = {
        name: 'y',
        value: y,
      };
      let _result: IAsyncResult = super.BeginInvoke(
        'AddTwoNumbers',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndAddTwoNumbers(result: IAsyncResult): number {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: number = convertTypeTo<number>(
        super.EndInvoke('AddTwoNumbers', <any>_args, result),
        Number
      );
      return _result;
    }
    public BeginGetDataIndex(
      x: number,
      info: PersonInfo,
      roles: ObservableCollection<RoleInfo>,
      callback: AsyncCallback,
      asyncState: any
    ): IAsyncResult {
      let _args: any[] = new Array<any>(3).fill(undefined).map((x) => null);
      _args[0] = {
        name: 'x',
        value: x,
      };
      _args[1] = {
        name: 'info',
        value: info,
      };
      _args[2] = {
        name: 'roles',
        value: roles,
      };
      let _result: IAsyncResult = super.BeginInvoke(
        'GetDataIndex',
        <any>_args,
        callback,
        asyncState
      );
      return _result;
    }
    public EndGetDataIndex(result: IAsyncResult): number {
      let _args: any[] = new Array<any>(0).fill(undefined).map((x) => null);
      let _result: number = convertTypeTo<number>(
        super.EndInvoke('GetDataIndex', <any>_args, result),
        Number
      );
      return _result;
    }
  }
}

result-matching ""

    No results matching ""