本文整理汇总了TypeScript中app/site/base/projectable.isProjectable函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isProjectable函数的具体用法?TypeScript isProjectable怎么用?TypeScript isProjectable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isProjectable函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: openProjectDialogFor
/**
* Opens the projection dialog for the given projectable. After the user's choice,
* the projectors will be updated.
*
* @param obj The projectable.
*/
public async openProjectDialogFor(obj: Projectable | ProjectorElementBuildDeskriptor): Promise<void> {
let descriptor: ProjectorElementBuildDeskriptor;
if (isProjectable(obj)) {
descriptor = obj.getSlide(this.configService);
} else {
descriptor = obj;
}
const dialogRef = this.dialog.open<
ProjectionDialogComponent,
ProjectorElementBuildDeskriptor,
ProjectionDialogReturnType
>(ProjectionDialogComponent, {
maxHeight: '90vh',
autoFocus: false,
data: descriptor
});
const response = await dialogRef.afterClosed().toPromise();
if (response) {
const [action, projectors, projectorElement]: ProjectionDialogReturnType = response;
if (action === 'project') {
this.projectorService.projectOnMultiple(projectors, projectorElement);
} else if (action === 'addToPreview') {
projectors.forEach(projector => {
this.projectorService.addElementToPreview(projector, projectorElement);
});
}
}
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:34,代码来源:projection-dialog.service.ts
示例2:
/**
* Returns a view model associated with the identifiable projector element. Throws an error,
* if the element is not mappable.
*
* @param element The projector element
* @returns the view model from the projector element
*/
public getViewModelFromProjectorElement<T extends BaseProjectableViewModel>(
element: IdentifiableProjectorElement
): T {
this.assertElementIsMappable(element);
const viewModel = this.viewModelStore.get<T>(element.name, element.id);
if (viewModel && !isProjectable(viewModel)) {
console.error('The view model is not projectable', viewModel, element);
}
return viewModel;
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:17,代码来源:projector.service.ts
示例3: getProjectorElement
/**
* Retusn the identifiable projector element from the given types of slides/elements/descriptors
*
* @param obj Something related to IdentifiableProjectorElement
* @returns the identifiable projector element from obj.
*/
private getProjectorElement(
obj: Projectable | ProjectorElementBuildDeskriptor | IdentifiableProjectorElement
): IdentifiableProjectorElement {
if (isProjectable(obj)) {
return obj.getSlide(this.configService).getBasicProjectorElement({});
} else if (isProjectorElementBuildDeskriptor(obj)) {
return obj.getBasicProjectorElement({});
} else {
return obj;
}
}
开发者ID:CatoTH,项目名称:OpenSlides,代码行数:17,代码来源:projector.service.ts
注:本文中的app/site/base/projectable.isProjectable函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论