public virtual RestApiInterface aConnection() { using (RestApiInterface restAPI = RestApiInterface.Instance) { return(restAPI); } }
private void Initialize() { _isAuthenticated = (bool)(ViewData["IsAuthenticated"] ?? false); _isAllowed = (bool)(ViewData["IsAuthorized"] ?? false); _isAdmin = (bool)(ViewData["IsAdministrator"] ?? false); if (_isAuthenticated) { foreach (Claim c in _claimsIdentity.Claims) { _strClaimType = c.ClaimType; if (_strClaimType.EndsWith("domain")) { ; } if (_strClaimType.EndsWith("FirstName")) { ; } if (_strClaimType.EndsWith("LastName")) { ; } if (_strClaimType.EndsWith("EmailAddress")) { _email = c.Value; } } RestApiInterface restAPI = RestApiInterface.Instance; _user = restAPI.GetUserByEmail(_email); _employeepuid = new Guid(_user.ObjectId.ToString()); List <ReferencedObject> directReports = restAPI.GetLinks(_employeepuid, "DirectReports"); List <ReferencedObject> manager = restAPI.GetLinks(_employeepuid, "Manager"); if (manager != null && manager.Count != 0) { new Guid(manager[0].ObjectId.ToString()); } } }
void Update() { // Trigerred when the user press a button if (Input.GetButtonDown("Fire1")) { Ray r = cam.ScreenPointToRay(Input.mousePosition); RaycastHit hitInfo; if (Physics.Raycast(r, out hitInfo, Mathf.Infinity, LayerMask.GetMask("Earth"))) { // Get cartesian coordinates Vector3 cartesianCoord = earth.InverseTransformPoint(hitInfo.point).normalized; // Compute spherical coordinates Vector2 sphericalCoord = CoordinateFinder.CartesianToSphericalCoordinates(cartesianCoord); // Process //string location = RestApiInterface.GoogleAPIProcessCoord(sphericalCoord); WeatherData weatherData = RestApiInterface.WeatherMapProcessCoord(sphericalCoord); ui.UpdateUI(weatherData); Debug.Log(weatherData); // Display resul } else { //reset ui ui.UpdateUI(null); } } else if (Input.GetButtonDown("Fire2")) { //reset ui ui.UpdateUI(null); } // Escape -> quit else if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }