当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript angular2-c360.C360ContextService类代码示例

本文整理汇总了TypeScript中angular2-c360.C360ContextService的典型用法代码示例。如果您正苦于以下问题:TypeScript C360ContextService类的具体用法?TypeScript C360ContextService怎么用?TypeScript C360ContextService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了C360ContextService类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: canActivate

 canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
     if (this.c360Context.isModelLoaded()) {
       return Promise.resolve(true);
     }
     else {
       return this.c360Context.getNewModel()
         .then(root => { return true; })
         .catch(err => {
           this.router.navigate(['/error']);
           return Promise.resolve(false);
         });
     }
 }
开发者ID:D3Automation,项目名称:angular2-c360-sample,代码行数:13,代码来源:model-loaded-guard.ts

示例2: resolve

  resolve(route: ActivatedRouteSnapshot): Promise<UIPart> {
    let refChain = route.params['refChain'];

    if (!refChain) {
      refChain = "Root";
    } 

    if (this.c360Context.isModelLoaded()) {
      return Promise.resolve(this.c360Context.getPartByRefChain(refChain));
    }
    else {
      return this.c360Context.getNewModel()
        .then(root => { return this.c360Context.getPartByRefChain(refChain); })
        .catch(err => {
          this.router.navigate(['/error']);
        });
    }
  }
开发者ID:D3Automation,项目名称:angular2-c360-sample,代码行数:18,代码来源:part-resolver.service.ts

示例3:

 .then(root => { return this.c360Context.getPartByRefChain(refChain); })
开发者ID:D3Automation,项目名称:angular2-c360-sample,代码行数:1,代码来源:part-resolver.service.ts

示例4: getErrorMessage

  getErrorMessage() {
      let message = "Unknown Error";
      let viewer = this.c360Context.getViewer();
      let checkContext = false;            

      if (viewer) {
          switch(viewer.state) {
              case ADSK.C360.loadedState.GPUAccelerationDisabled:
                  message = "GPU Acceleration Disabled";
                  break;
              case ADSK.C360.loadedState.SecurityBlocked:
                  message = "Security Blocked";
                  break;
              case ADSK.C360.loadedState.Not3DCapable:
                  message = "Not 3D Capable";
                  break;
              case ADSK.C360.loadedState.TemporarilyUnavailable:
                  message = "Temporarily Unavailable";
                  break;
              case ADSK.C360.loadedState.NotStandardsCompliant:
                  message = "Not Standards Compliant";
                  break;
              case ADSK.C360.loadedState.WebGLNotSupported:
                  message = "WebGL Not Supported";
                  break;
              case ADSK.C360.loadedState.ThirdPartyCookiesDisabled:
                  message = "Third Party Cookies Disabled";
                  break;
              case ADSK.C360.loadedState.DesignOpenInOtherWindowOrTab:
                  message = "Design Open in Other Window or Tab";
                  break;
              case ADSK.C360.loadedState.ServerMaintenance:
                  message = "Server Maintenance";
                  break;
              case ADSK.C360.loadedState.Forbidden:
                  message = "Forbidden";
                  break;
              case ADSK.C360.loadedState.NotFound:
                  message = "Design Not Found";
                  break;
              case ADSK.C360.loadedState.Error:
                  checkContext = true;
                  break;
              case ADSK.C360.loadedState.Loaded:
                  checkContext = true;
                  break;                    
          }
      } else {
          checkContext = true;
      }

      if (checkContext) {
          var lastError = this.c360Context.getLastError();
          
          if (lastError) {
              message = lastError;
          }
      }

      return message;
  }
开发者ID:D3Automation,项目名称:angular2-c360-sample,代码行数:61,代码来源:error.component.ts


注:本文中的angular2-c360.C360ContextService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。