File

projects/wms-framework/src/lib/domainservicesupport/OperationsSupport.ts

Description

Defines a operation object that contains data relavant to loading the user from an authentication service

Index

Properties

Properties

Error
Type : Exception

Set when an exception happen while loading the user, null otherwise

User
Type : IPrincipal

Information of the loaded user

import { Exception } from '../baseframework/Exceptions';
import { Entity } from './EntitiesSupport';
import { SubscriptionEvent } from '../utils/SubscriptionEvent';
import { INotifyPropertyChanged } from '../basecomponentmodel/INotifyPropertyChanged';
import { Debugger } from '../diagnostics/Debugger';
import { IPrincipal } from './Authentication';

/**
 * OperationBase class
 *
 * @export
 * @class OperationBase
 * @implements {INotifyPropertyChanged}
 * @wType System.ServiceModel.DomainServices.Client.OperationBase
 */
export class OperationBase implements INotifyPropertyChanged {
  PropertyChanged: SubscriptionEvent<
    (o: any, args: { PropertyName: string }) => void
  > = new SubscriptionEvent();

  /**
   * Cancel method
   *
   * @return {*}  {*}
   * @memberof OperationBase
   * @wNoMap
   */
  Cancel(): any {
    Debugger.Throw('Method not implemented.');
  }
  IsComplete: any = null;
  CanCancel: any = null;
}

/**
 * SubmitOperation class
 *
 * @export
 * @class SubmitOperation
 * @extends {OperationBase}
 * @wType System.ServiceModel.DomainServices.Client.SubmitOperation
 */
export class SubmitOperation extends OperationBase {
  Error: Exception;
  ChangeSet: any = null;
  EntitiesInError: Entity[];
  IsCanceled: boolean = false;
  UserState: any = null;

  /**
   * Marks error as handled
   *
   * @return {*}  {*}
   * @memberof SubmitOperation
   * @wNoMap
   */
  MarkErrorAsHandled(): any {
    Debugger.Throw('Method not implemented.');
  }
  HasError: any = null;
}

export class LoadOperationBase extends OperationBase {}

/**
 * LoadOperation class
 *
 * @export
 * @class LoadOperation
 * @extends {LoadOperationBase}
 * @template T
 * @wType System.ServiceModel.DomainServices.Client.LoadOperation`1
 */
export class LoadOperation<T> extends LoadOperationBase {
  TotalEntityCount: number = 0;
  UserState: any = null;
  Entities: Iterable<T>;

  /**
   * Marks error as handled
   *
   * @memberof LoadOperation
   * @wNoMap
   */
  MarkErrorAsHandled() {
    Debugger.Throw('Method not implemented.');
  }
  Completed: (sender: any, e: any) => void;
  HasError: any = null;
}

/**
 * LoginOperation class
 *
 * @export
 * @class LoginOperation
 * @extends {OperationBase}
 * @wType System.ServiceModel.DomainServices.Client.ApplicationServices.LoginOperation
 */
export class LoginOperation extends OperationBase {
  /**
   * Cancel method
   *
   * @return {*}  {*}
   * @memberof LoginOperation
   * @wNoMap
   */
  Cancel(): any {
    Debugger.Throw('Method not implemented.');
  }
  Error: any = null;
  IsCanceled: any = null;
  CanCancel: boolean = false;

  /**
   * Marks error as handled
   *
   * @return {*}  {*}
   * @memberof LoginOperation
   * @wNoMap
   */
  MarkErrorAsHandled(): any {
    Debugger.Throw('Method not implemented.');
  }
  LoginSuccess: any = null;
  HasError: any = null;

  public Completed = new SubscriptionEvent<(s: any, e: any) => void>();
}

/**
 * Defines a operation object that contains data relavant to loading the user
 * from an authentication service
 *
 * @export
 * @class LoadUserOperation
 * @wType System.ServiceModel.DomainServices.Client.ApplicationServices.LoadUserOperation
 */
export class LoadUserOperation {
  /**
   * Information of the loaded user
   *
   * @type {IPrincipal}
   * @memberof LoadUserOperation
   */
  User: IPrincipal;

  /**
   * Set when an exception happen while loading the user, null otherwise
   *
   * @type {Exception}
   * @memberof LoadUserOperation
   */
  Error: Exception;
}

/**
 * ChangeSetEntry class
 *
 * @export
 * @class ChangeSetEntry
 * @wType System.ServiceModel.DomainServices.Client.ChangeSetEntry
 */
export class ChangeSetEntry {}

/**
 * EntityChangeSet class
 *
 * @export
 * @class EntityChangeSet
 * @wType System.ServiceModel.DomainServices.Client.EntityChangeSet
 */
export class EntityChangeSet {}

export class InvokeOperation<T> {
  public Value: T;
  public SupportsCancellation: boolean = false;
  CancelCore(): void {}
  InvokeCompleteAction(): void {}
}

/**
 * EntitySetOperations enum
 *
 * @export
 * @enum {number}
 * @wEnum System.ServiceModel.DomainServices.Client.EntitySetOperations
 */
export enum EntitySetOperations {
  Edit,
  Add,
  None,
}

result-matching ""

    No results matching ""