public override Data.IMarketData Execute(IRestConnection connection) { this._connection = connection; //Add headers for private request //RequestHeaders.Add( ) return base.Execute(connection); }
public MyPlexConnection(IRestConnection restConnection) { _restConnection = restConnection; _devices = new ObservableCollectionEx <Device>(); _servers = new ObservableCollectionEx <Device>(); _players = new ObservableCollectionEx <Device>(); Devices = new ReadOnlyObservableCollection <Device>(_devices); Servers = new ReadOnlyObservableCollection <Device>(_servers); Players = new ReadOnlyObservableCollection <Device>(_players); }
private ManagementClient(string baseUrl, IRestConnection restConnection) { restConnection.Setup(baseUrl, null); User = new UserManagementClient(baseUrl, restConnection); Company = new CompanyManagementClient(restConnection); Service = new ServiceManagementClient(restConnection); Network = new NetworkManagementClient(restConnection); Device = new DeviceManagementClient(restConnection); TelemetryDataSinksMetadata = new TelemetryDataSinksMetadataClient(restConnection); }
public MyPlexConnection(IRestConnection restConnection) { _restConnection = restConnection; _devices = new ObservableCollectionEx<Device>(); _servers = new ObservableCollectionEx<Device>(); _players = new ObservableCollectionEx<Device>(); Devices = new ReadOnlyObservableCollection<Device>(_devices); Servers = new ReadOnlyObservableCollection<Device>(_servers); Players = new ReadOnlyObservableCollection<Device>(_players); }
public ClassAndGradeViewModel(IRestConnection restConnection) { this.restConnection = restConnection; this.editorFactory = new DataFormEditorFactory <ClassAndGradeEditor>(); Items = new ObservableCollection <ClassAndGradeModel>(); QueryCommand = new DelegateCommand(QueryOp); AddCommand = new DelegateCommand(AddOp); EditCommand = new DelegateCommand(EditOp); DeleteCommand = new DelegateCommand(DeleteOp); GetAllFaculties(); }
/// <summary> /// Executes the specified request. /// </summary> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse>.</returns> /// <summary> /// Executes the specified request. /// </summary> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse>.</returns> public async Task <RestResponse> Execute(RestRequest request, IRestConnection restConnection) { var client = await BuildRestClient(restConnection); var restRequest = _mapper.Map <RestSharpRestRequest>(request); var restResponse = await client.ExecuteTaskAsync(restRequest); var response = _mapper.Map <Rest.RestResponse>(restResponse); NormalizeErrorsToExceptions(restResponse, response); return(response); }
public IcCardViewModel(IRestConnection restConnection) { this.restConnection = restConnection; this.editorFactory = new DataFormEditorFactory <IcCardEditor>(); Items = new ObservableCollection <IcCardModel>(); QueryCommand = new DelegateCommand(QueryOp); AddCommand = new DelegateCommand(AddOp); EditCommand = new DelegateCommand(EditOp); DeleteCommand = new DelegateCommand(DeleteOp); GetAllFaculties(); InitIcCardTypes(); InitSexTypes(); }
public override IMarketData Execute(IRestConnection connection) { this._connection = connection; string pair = Pair.ToString(); RestParameters.Add("pair", pair); if (SinceTimeUTC_Epoch_e9 != 0) RestParameters.Add("since", Convert.ToString(SinceTimeUTC_Epoch_e9)); TradesResponse tr = restRequest<TradesResponse>(); return tr.ToMarketData(); }
public ConnectionManager(ITimer timer, ILocalServerDiscovery localServerDiscovery, IRestConnection restConnection, IMyPlexConnection myPlexConnection, ITvdbCache tvdbCache, ITmdbCache tmdbCache, INowPlaying nowPlaying) { _timer = timer; _restConnection = restConnection; _myPlexConnection = myPlexConnection; _tvdbCache = tvdbCache; _tmdbCache = tmdbCache; _localServerDiscovery = localServerDiscovery; _localServerDiscovery.ServerDiscovered += LocalServerDiscoveryOnServerDiscovered; ServerConnections = new ReadOnlyObservableCollection <ServerConnection>(_allServerConnections); NowPlaying = nowPlaying; }
public ConnectionManager(ITimer timer, ILocalServerDiscovery localServerDiscovery, IRestConnection restConnection, IMyPlexConnection myPlexConnection, ITvdbCache tvdbCache, ITmdbCache tmdbCache, INowPlaying nowPlaying) { _timer = timer; _restConnection = restConnection; _myPlexConnection = myPlexConnection; _tvdbCache = tvdbCache; _tmdbCache = tmdbCache; _localServerDiscovery = localServerDiscovery; _localServerDiscovery.ServerDiscovered += LocalServerDiscoveryOnServerDiscovered; ServerConnections = new ReadOnlyObservableCollection<ServerConnection>(_allServerConnections); NowPlaying = nowPlaying; }
/// <summary> /// Executes the specified request. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse<T>>.</returns> /// <summary> /// Executes the specified request. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse<T>>.</returns> public Rest.RestResponse <T> ExecuteSync <T>(RestRequest request, IRestConnection restConnection) where T : class, new() { var client = BuildRestClientSync(restConnection); var restRequest = _mapper.Map <RestSharpRestRequest>(request); // // make the REST request and wait for the response // var restResponse = client.Execute <T>(restRequest, (Method)Enum.Parse(typeof(Method), request.Method.ToString())); var response = _mapper.Map <Rest.RestResponse <T> >(restResponse); NormalizeErrorsToExceptions(restResponse, response); return(response); }
private static RestSharpRestClient BuildRestClientSync(IRestConnection restConnection) { var client = new RestSharpRestClient { BaseUrl = restConnection.BaseUrl, Timeout = restConnection.Timeout, Authenticator = restConnection.AuthenticateSync <IAuthenticator>() }; // use Newtonsoft's for a) proper handling of DateTimeOffset types, b) performance and c) extensability client.AddHandler("application/json", NewtonsoftJsonSerializer.Default); client.AddHandler("text/json", NewtonsoftJsonSerializer.Default); client.AddHandler("text/x-json", NewtonsoftJsonSerializer.Default); client.AddHandler("text/javascript", NewtonsoftJsonSerializer.Default); client.AddHandler("*+json", NewtonsoftJsonSerializer.Default); return(client); }
/// <summary> /// Executes the specified request. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse<T>>.</returns> /// <summary> /// Executes the specified request. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="request">The request.</param> /// <param name="restConnection">The rest connection.</param> /// <returns>Task<RestResponse<T>>.</returns> public async Task <Rest.RestResponse <T> > Execute <T>(RestRequest request, IRestConnection restConnection) { var client = await BuildRestClient(restConnection); var restRequest = _mapper.Map <RestSharpRestRequest>(request); // // make the REST request and wait for the response // var restResponse = await client.ExecuteTaskAsync <T>(restRequest); var response = _mapper.Map <Rest.RestResponse <T> >(restResponse); NormalizeErrorsToExceptions(restResponse, response); return(response); }
public void LoginOp(object o) { string msg; IRestConnection restCon = container.Resolve <IRestConnection>(new ParameterOverride("baseUrl", Config.GetConfig <string>("ServiceAddress"))); //new RestConnection(Config.GetConfig<string>("ServiceAddress")); string password = (o as RadPasswordBox)?.Password; if (restCon.Login(@"/Account/Login", "LoginName", username, "Password", password, out msg)) { RaiseLoginCompleted(); } else { RadWindow.Alert(new DialogParameters { OkButtonContent = "确定", Content = msg, Owner = App.Current.MainWindow, Header = "错误" }); } }
public PlexServerConnection(IRestConnection restConnection, Device device, PlexUser user = null) : this(restConnection) { User = user; Device = device; }
private PlexServerConnection(IRestConnection restConnection) { _restConnection = restConnection; NowPlaying = new ReadOnlyObservableCollection <Video>(_nowPlaying); Clients = new ReadOnlyObservableCollection <Server>(_clients); }
internal NetworkClient(string baseUrl, IRestConnection restConnection) { _baseUrl = baseUrl; _restConnection = restConnection; }
public TmdbConnection(IRestConnection restConnection, string apiKey) { _restConnection = restConnection; _apiKey = apiKey; }
public CategoriesDataService(IRestConnection restConnection, ILocalDatabase localDb) { _restConnection = restConnection; _localDb = localDb; }
public TvdbConnection(IRestConnection restConnection) { _restConnection = restConnection; }
public ImageHelper(IRestConnection restConnection) { _restConnection = restConnection; }
internal DeviceClient(string baseUrl, IRestConnection restConnection) { _baseUrl = baseUrl; _restConnection = restConnection; }
public TvdbConnection(IRestConnection restConnection) { _restConnection = restConnection; }
public TmdbConnection(IRestConnection restConnection, string apiKey) { _restConnection = restConnection; _apiKey = apiKey; }
public PlexServerConnection(IRestConnection restConnection, string uri, PlexUser user = null) : this(restConnection) { User = user; ConnectionUri = TidyUrl(uri); }
internal TelemetryDataSinksMetadataClient(IRestConnection restConnection) : base(restConnection) { }
private OccasionallyConnectionClient(string baseUrl, string deviceId, string apiKey, IRestConnection restConnection) { _restConnection = restConnection; _restConnection.Setup(baseUrl, new Dictionary <string, string> { { "X-DeviceId", deviceId }, { "X-ApiKey", apiKey } }); }
/// <summary> /// Initializes a new instance of the <see cref="RestContext"/> class. /// </summary> /// <param name="restConnection">The rest connection.</param> /// <param name="restClient">The rest client.</param> public RestContext(IRestConnection restConnection, IRestClient restClient) { _restConnection = restConnection; _restClient = restClient; }
internal NetworkManagementClient(IRestConnection restConnection) : base(restConnection) { }
internal UserManagementClient(string baseUrl, IRestConnection restConnection) : base(restConnection) { _baseUrl = baseUrl; _isLoggedIn = false; }
internal DeviceManagementClient(IRestConnection restConnection) : base(restConnection) { }
protected SpecificManagementClient(IRestConnection restConnection) { RestConnection = restConnection; }
internal CompanyManagementClient(IRestConnection restConnection) : base(restConnection) { }