/// <summary> /// Instantiates the base class for the Box resource managers /// </summary> /// <param name="config"></param> /// <param name="service"></param> /// <param name="converter"></param> /// <param name="auth"></param> public ResourceManager(ICanvasConfig config, IRequestService service, IJsonConverter converter, IAuthRepository auth) { _config = config; _service = service; _converter = converter; _auth = auth; }
/// <summary> /// Instantiates a new AuthRepository /// </summary> /// <param name="canvasConfig">The Canvas app configuration that should be used</param> /// <param name="requestService">The service that will be used to make the requests</param> /// <param name="converter">How requests/responses will be serialized/deserialized respectively</param> /// <param name="session">The current authenticated session</param> public AuthRepository(ICanvasConfig canvasConfig, IRequestService requestService, IJsonConverter converter, OAuth2Session session) { _config = canvasConfig; _service = requestService; _converter = converter; Session = session; }
/// <summary> /// Instantiates a new AuthRepository /// </summary> /// <param name="canvasConfig">The Canvas app configuration that should be used</param> /// <param name="requestService">The service that will be used to make the requests</param> /// <param name="converter">How requests/responses will be serialized/deserialized respectively</param> /// <param name="session">The current authenticated session</param> public AuthRepository(ICanvasConfig canvasConfig, IRequestService requestService, IJsonConverter converter, OAuth2Session session) { _config = canvasConfig; _service = requestService; _converter = converter; Session = session; }
public ResourceManagerTestIntegration() { _auth = new OAuth2Session("YOUR_ACCESS_TOKEN", "YOUR_REFRESH_TOKEN", 3600, "bearer"); _handler = new HttpRequestHandler(); _parser = new JsonConverter(); _config = new CanvasConfig(CanvasDomain, ClientId, ClientSecret, RedirectUri); _client = new Client(_config, _auth); }
public ResourceManagerTestIntegration() { _auth = new OAuth2Session("YOUR_ACCESS_TOKEN", "YOUR_REFRESH_TOKEN", 3600, "bearer"); _handler = new HttpRequestHandler(); _parser = new JsonConverter(); _config = new CanvasConfig(CanvasDomain, ClientId, ClientSecret, RedirectUri); _client = new Client(_config, _auth); }
/// <summary> /// Initializes a new Client with the provided config, converter, service and auth objects. /// </summary> /// <param name="config">The config object to use</param> /// <param name="auth">The auth repository object to use</param> public Client(ICanvasConfig config, IAuthRepository auth) { _config = config; _converter = new JsonConverter(); _service = new RequestService(new HttpRequestHandler()); Auth = auth; InitManagers(); }
/// <summary> /// Instantiates a Client with the provided config object and auth session /// </summary> /// <param name="config">The config object to be used</param> /// <param name="authSession">A fully authenticated auth session</param> public Client(ICanvasConfig config, OAuth2Session authSession = null) : this(config, new AuthRepository(config, new RequestService(new HttpRequestHandler()), new JsonConverter(), authSession)) { _config = config; _converter = new JsonConverter(); _service = new RequestService(new HttpRequestHandler()); Auth = new AuthRepository(config, new RequestService(new HttpRequestHandler()), new JsonConverter(), authSession); InitManagers(); }
/// <summary> /// Draws all the added <see cref="IPlottable"/> instances. /// </summary> /// <param name="canvasConfig">the canvas config use to get the canvas for drawing</param> public void Draw(ICanvasConfig canvasConfig) { ValidationUtil.RequireNonNull(canvasConfig); canvasConfig.AddPage(page); var canvas = canvasConfig.UsePageArea(box, page); if (canvas.GetModeParam() == ModeParam.Boxed || canvas.GetModeParam() == ModeParam.BoxedCalibration) { canvas.SetColor(Color.Black); canvas.DrawRectangle(PointPair.Full, 1f, 1f); } foreach (var plottable in plottables) { plottable.Plot(canvas); } }
/// <summary> /// Instantiates a new AuthRepository /// </summary> /// <param name="canvasConfig">The Canvas app configuration that should be used</param> /// <param name="requestService">The service that will be used to make the requests</param> /// <param name="converter">How requests/responses will be serialized/deserialized respectively</param> public AuthRepository(ICanvasConfig canvasConfig, IRequestService requestService, IJsonConverter converter) : this(canvasConfig, requestService, converter, null) { }
public AnalyticsManager(ICanvasConfig config, IRequestService service, IJsonConverter converter, IAuthRepository auth) : base(config, service, converter, auth) { }
public AnalyticsManager(ICanvasConfig config, IRequestService service, IJsonConverter converter, IAuthRepository auth) : base(config, service, converter, auth) { }
/// <summary> /// Instantiates a new AuthRepository /// </summary> /// <param name="canvasConfig">The Canvas app configuration that should be used</param> /// <param name="requestService">The service that will be used to make the requests</param> /// <param name="converter">How requests/responses will be serialized/deserialized respectively</param> public AuthRepository(ICanvasConfig canvasConfig, IRequestService requestService, IJsonConverter converter) : this(canvasConfig, requestService, converter, null) { }