public ActionResult Index(string state, string code) { try { IAuthenticator authenticator = Utils.GetCredentials(code, state); // Store the authenticator and the authorized service in session Session["authenticator"] = authenticator; Session["service"] = Utils.BuildService(authenticator); } catch (CodeExchangeException) { if (Session["service"] == null || Session["authenticator"] == null) { Response.Redirect(Utils.GetAuthorizationUrl("", state)); } } catch (NoRefreshTokenException e) { Response.Redirect(e.AuthorizationUrl); } DriveState driveState = new DriveState(); if (!string.IsNullOrEmpty(state)) { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); driveState = jsonSerializer.Deserialize <DriveState>(state); } if (driveState.action == "open") { return(OpenWith(driveState)); } else { return(CreateNew(driveState)); } }
private ActionResult CreateNew(DriveState state) { ViewBag.FileIds = new string[] { "" }; return(View()); }
private ActionResult OpenWith(DriveState state) { ViewBag.FileIds = state.ids; return(View()); }
private ActionResult CreateNew(DriveState state) { return(Content(DateTime.Now.ToString() + "<hr>", "text/html")); }
private ActionResult OpenWith(DriveState state) { return(Content(DateTime.Now.ToString() + "<hr>" + state.ids, "text/html")); }