File

projects/wms-framework/src/lib/basecomponentmodel/CalendarBlackoutDatesCollectionModel.ts

Description

CalendarBlackoutDatesCollection support class

Extends

ObservableCollection

Index

Properties
Methods

Constructor

constructor(owner: CalendarModel)
Parameters :
Name Type Optional
owner CalendarModel No

Properties

Public AddNewItem
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from ObservableCollection

Event AddNewItem have changed.

Public CollectionChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from ObservableCollection

Event to indicate that the collection have changed.

Protected Static interfacesInitialized
Default value : false
Inherited from SimpleList
Defined in SimpleList:862

Flag to indicate if supported interfaces have been initialized.

Public PropertyChanged
Type : SubscriptionEvent<void>
Default value : new SubscriptionEvent()
Inherited from ObservableCollection

Event to indicate that a property have changed.

Protected _internalArray
Type : T[]
Default value : []
Inherited from SimpleList
Defined in SimpleList:276

Methods

Public AddDatesInPast
AddDatesInPast()

Adds all dates before today to the collection.

Returns : void
Public Contains
Contains(...args: | | )
Parameters :
Name Type Optional
args | | No
Returns : boolean
add
add(value: T)
Inherited from SimpleList
Defined in SimpleList:995

Adds the given element at the end of the collection.

Parameters :
Name Type Optional
value T No
Returns : void
clear
clear()
Inherited from SimpleList
Defined in SimpleList:1031

Removes all elements from the collection.

Returns : void
Protected clearItems
clearItems()
Inherited from ObservableCollection

Removes all elements from the collection.

Returns : void
Protected Static initializeSupportedInterfaces
initializeSupportedInterfaces()
Inherited from SimpleList
Defined in SimpleList:913

Initialize the interfaces supported by this collection.

Returns : void
insert
insert(index: number, value: T)
Inherited from SimpleList
Defined in SimpleList:937

Inserts a new element at the specified position.

Parameters :
Name Type Optional
index number No
value T No
Returns : void
Protected onCollectionChanged
onCollectionChanged(info: CollectionChangeInfo)
Inherited from ObservableCollection

Trigger a CollectionChanged event.

Parameters :
Name Type Optional
info CollectionChangeInfo No
Returns : void
Protected onPropertyChanged
onPropertyChanged(info: literal type)
Inherited from ObservableCollection

Trigger a PropertyChanged event.

Parameters :
Name Type Optional
info literal type No
Returns : void
remove
remove(value: T)
Inherited from SimpleList
Defined in SimpleList:955

Removes the first element from the collection which matches the given value.

Parameters :
Name Type Optional
value T No
Returns : boolean

{boolean}

removeAt
removeAt(index: number)
Inherited from SimpleList
Defined in SimpleList:977

Removes the element at the given position.

Parameters :
Name Type Optional
index number No
Returns : void
setItem
setItem(index: number, value: T)
Inherited from SimpleList
Defined in SimpleList:1047

Replace the element at the given position with the given element.

Parameters :
Name Type Optional
index number No
value T No
Returns : void
silentAddRange
silentAddRange(range: Iterable<T>)
Inherited from ObservableCollection

Adds elements of an iterable to the list

Parameters :
Name Type Optional
range Iterable<T> No
Returns : void
addRange
addRange(range: Iterable<T>)
Inherited from SimpleList
Defined in SimpleList:452

Adds elements of an iterable to the list

Parameters :
Name Type Optional
range Iterable<T> No
Returns : void
contains
contains(value: T)
Inherited from SimpleList
Defined in SimpleList:410

Check if a value is contained in the list

Parameters :
Name Type Optional
value T No
Returns : boolean
copyTo
copyTo(target: T[], index: number)
Inherited from SimpleList
Defined in SimpleList:513

Copies the list to a target array

Parameters :
Name Type Optional
target T[] No
index number No
Returns : void
forEach
forEach(action: (e: T) => void)
Inherited from SimpleList
Defined in SimpleList:439

Performs an action on each element of the list

Parameters :
Name Type Optional
action function No
Returns : void
getItem
getItem(index: number)
Inherited from SimpleList
Defined in SimpleList:323
Parameters :
Name Type Optional
index number No
Returns : T
indexOf
indexOf(value: T)
Inherited from SimpleList
Defined in SimpleList:343

Index of value in list

Parameters :
Name Type Optional
value T No
Returns : any
insertRange
insertRange(position: number, range: Iterable<T>)
Inherited from SimpleList
Defined in SimpleList:466

Inserts elements of an interable to the list in a position

Parameters :
Name Type Optional
position number No
range Iterable<T> No
Returns : void
Public removeAll
removeAll(predicate: (e: T) => void)
Inherited from SimpleList
Defined in SimpleList:527

Removes all elements from the collection by a predicate

Parameters :
Name Type Optional
predicate function No
Returns : number
sort
sort()
Inherited from SimpleList
Defined in SimpleList:479

Sorts the list

Returns : any
Public toArray
toArray()
Inherited from SimpleList
Defined in SimpleList:545

Converts the list to an array

Returns : {}
()
Inherited from SimpleList
Defined in SimpleList:549
Returns : Iterator<T, any, undefined>
import { ObservableCollection } from '../baseframework';
import { Debugger } from '../diagnostics/Debugger';
import { CalendarDateRangeModel } from '../models/controls/CalendarDateRangeModel';
import { CalendarModel } from '../models/controls/CalendarModel';

/**
 * CalendarBlackoutDatesCollection support class
 *
 * @export
 * @class CalendarBlackoutDatesCollectionModel
 * @extends {ObservableCollection<CalendarDateRangeModel>}
 * @wType System.Windows.Controls.CalendarBlackoutDatesCollection
 */
export class CalendarBlackoutDatesCollectionModel extends ObservableCollection<CalendarDateRangeModel> {
  constructor(private owner: CalendarModel) {
    super();
  }

  /**
   * Adds all dates before today to the collection.
   *
   * @memberof CalendarBlackoutDatesCollectionModel
   * @wNoMap
   */
  public AddDatesInPast(): void {
    Debugger.Throw('not implemented');
  }

  public Contains(
    ...args:
      | [day: Date]
      | [start: Date, end: Date]
      | [range: CalendarDateRangeModel]
  ): boolean {
    if (args[0] instanceof CalendarDateRangeModel) {
      return this.contains(args[0]);
    } else if (args.length === 1) {
      return this.contains(new CalendarDateRangeModel(args[0]));
    }
    return this.contains(new CalendarDateRangeModel(args[0], args[1]));
  }
}

result-matching ""

    No results matching ""