當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript C360ContextService.getLastError方法代碼示例

本文整理匯總了TypeScript中angular2-c360.C360ContextService.getLastError方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript C360ContextService.getLastError方法的具體用法?TypeScript C360ContextService.getLastError怎麽用?TypeScript C360ContextService.getLastError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在angular2-c360.C360ContextService的用法示例。


在下文中一共展示了C360ContextService.getLastError方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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.getLastError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。