internal UsbEndpointBase(UsbDevice usbDevice, EndpointTypes epType, int packetSize) { mPacketSize = packetSize; mEpType = epType; mUsbDevice = usbDevice; mTransferContext = new TransferContext(this); }
public QuestObjListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype, new string[] { "bsQuestList", "fkQuestItems" }, new string[] { "TITLE", "NAME" }) { }
public AbstractDefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype, string[] bs_list, string[] members) : base(owner, target, a_b, etype) { _bs_cnt = bs_list.Length; DisplayMembers = members; bs = new BindingSource[_bs_cnt]; for (int i = 0; i < bs_list.Length; i++) bs[i] = FindBindingSource(bs_list[i]); }
public SchoolContext GetContext(EndpointTypes endpointTypes) { IConfigurationRoot configuration = GetConfiguration(); var builder = new DbContextOptionsBuilder <SchoolContext>(); var connectionString = configuration.GetConnectionString(endpointTypes.ToString()); builder.UseMySql(connectionString); return(new SchoolContext(builder.Options)); }
public string getCurrentWeather(string latitude, string longitude, EndpointTypes endpointType) { StringBuilder stringBuilder = new StringBuilder(baseEndpoint); stringBuilder.Append($"{version}/{endpointTypeDictionary[endpointType]}"); stringBuilder.Append($"?apikey={apiKey}"); stringBuilder.Append($"&lat={latitude}"); stringBuilder.Append($"&lon={longitude}"); stringBuilder.Append("&fields=temp:C"); return(stringBuilder.ToString()); }
public float getCurrentTemperature(string city, EndpointTypes endpointTypes) { restClient.endpoint = openWeatherMapEndpoint.getByCityNameEndpoint(city, endpointTypes); string response = restClient.makeRequest(); JSONParser <OpenWeatherMapWeatherModel> jsonParser = new JSONParser <OpenWeatherMapWeatherModel>(); OpenWeatherMapWeatherModel deserializedOpenWeatherMapModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3); float temperature = deserializedOpenWeatherMapModel.main.temp; return(temperature); }
public float getCurrentWeather(string latitude, string longitude, EndpointTypes endpointTypes) { restClient.endpoint = climaCellEndpoint.getCurrentWeather(latitude, longitude, endpointTypes); string response = restClient.makeRequest(); JSONParser <ClimaCellWeatherModel> jsonParser = new JSONParser <ClimaCellWeatherModel>(); ClimaCellWeatherModel deserialisedClimaCellWeatherModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3); float value = deserialisedClimaCellWeatherModel.temp.value; return(value); }
public AbstractDefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype, string[] bs_list, string[] members) : base(owner, target, a_b, etype) { _bs_cnt = bs_list.Length; DisplayMembers = members; bs = new BindingSource[_bs_cnt]; for (int i = 0; i < bs_list.Length; i++) { bs[i] = FindBindingSource(bs_list[i]); } }
public UndefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) { C = a_b; Owner = owner; _etype = etype; PTargets[0] = target; for (int i = 0; i < 2; i++) { PTargets[i + 1] = (Panel)PTargets[i].Tag; cb_list[i] = (ComboBox)PTargets[i + 1].Controls["cbObj" + C + i]; } }
public object Convert(object value, Type targetType, object parameter, string language) { EndpointTypes original = (EndpointTypes)value; if (original == EndpointTypes.Local) { return(Visibility.Collapsed); } else { return(Visibility.Visible); } }
public string getForecast(string latitude, string longitude, EndpointTypes endpointType) { StringBuilder stringBuilder = new StringBuilder(baseEndpoint); stringBuilder.Append($"{version}/{endpointTypeDictionary[endpointType]}"); stringBuilder.Append($"?apikey={apiKey}"); stringBuilder.Append($"&lat={latitude}"); stringBuilder.Append($"&lon={longitude}"); stringBuilder.Append("&start_time=now"); //stringBuilder.Append($"&end_time={currentTime}"); stringBuilder.Append("&fields=temp:C"); return(stringBuilder.ToString()); }
public string getByCityNameEndpoint(string cityName, EndpointTypes endpointType) { StringBuilder stringBuilder = new StringBuilder(baseEndpoint); stringBuilder.Append($"{version}"); stringBuilder.Append($"/{endpointTypeDictionary[endpointType]}"); stringBuilder.Append("?q="); stringBuilder.Append(cityName); stringBuilder.Append("&appid="); stringBuilder.Append(apiKey); stringBuilder.Append("&units="); stringBuilder.Append(units); return(stringBuilder.ToString()); }
public List <OpenWeatherMapForecast> getForecastList(string city, EndpointTypes endpointTypes) { List <OpenWeatherMapForecast> forecastList = new List <OpenWeatherMapForecast>(); restClient.endpoint = openWeatherMapEndpoint.getByCityNameEndpoint(city, endpointTypes); string response = restClient.makeRequest(); JSONParser <OpenWeatherMapForecastModel> jsonParser = new JSONParser <OpenWeatherMapForecastModel>(); OpenWeatherMapForecastModel deserializedOpenWeatherMapForecastModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3); foreach (ForecastModel.UnnamedObject forecastMain in deserializedOpenWeatherMapForecastModel.list) { DateTime dateTime = DateTimeOffset.FromUnixTimeSeconds(forecastMain.dt).UtcDateTime; forecastList.Add(new OpenWeatherMapForecast(dateTime, forecastMain.main.temp)); } return(forecastList); }
internal UsbEndpointReader(UsbDevice usbDevice, EndpointTypes epType, int packetSize, int mReadBufferSize, ReadEndpoints mReadEndpoint) : base(usbDevice, epType, packetSize) { this.mReadBufferSize = mReadBufferSize; this.mReadEndpoint = mReadEndpoint; }
public Route Record(EndpointTypes type_a, string name_a, EndpointTypes type_b, string name_b) { return(null); }
/// <summary> /// Opens an endpoint for reading /// </summary> /// <param name="readEndpoint">Endpoint number for read operations.</param> /// <param name="readBufferSize">Size of the read buffer allocated for the <see cref="UsbEndpointReader.DataReceived"/> event.</param> /// <param name="endPointType">One of the <see cref="EndpointTypes"/> enumerations.</param> /// <param name="packetSize">The packet size to use when endPointType is set to <see cref="EndpointTypes.Isochronous"/>.</param> /// <returns>A <see cref="UsbEndpointReader"/> class ready for reading. /// If the specified endpoint has allready been opened, the original <see cref="UsbEndpointReader"/> object will be returned. /// </returns> public UsbEndpointReader OpenEndpointReader(ReadEndpoints readEndpoint, int readBufferSize, EndpointTypes endPointType, int packetSize) { UsbEndpointReader epNew = new UsbEndpointReader(this, endPointType, packetSize, readBufferSize, readEndpoint); return((UsbEndpointReader)mActiveEndpoints.Add(epNew)); }
public HotSpotListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype) { }
public List <ClimaCellForecast> getForecast(string latitude, string longitude, EndpointTypes endpointTypes) { List <ClimaCellForecast> forecastList = new List <ClimaCellForecast>(); restClient.endpoint = climaCellEndpoint.getForecast(latitude, longitude, endpointTypes); string response = restClient.makeRequest(); JSONParser <ClimaCellForecastModel> jsonParser = new JSONParser <ClimaCellForecastModel>(); ClimaCellForecastModel deserialisedClimaCellForecastModel = jsonParser.ParseJSON(response, Parser.Version.NETCore3); foreach (Forecast climaCell in deserialisedClimaCellForecastModel.temp) { forecastList.Add(new ClimaCellForecast(climaCell.observation_time, climaCell.min.value, climaCell.min.units)); //forecastList.Add(new ClimaCellForecast(climaCell.observation_time, climaCell.max.value, climaCell.max.units)); } return(forecastList); }
public GameObjListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype, new string[] { "bsGameObjects" }, new string[] { "NAME" }) { }
public UndefListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) { C = a_b; Owner = owner; _etype = etype; PTargets[0] = target; for (int i = 0; i < 2; i++) { PTargets[i + 1] = (Panel)PTargets[i].Tag; cb_list[i] = (ComboBox)PTargets[i + 1].Controls["cbObj" + C + i]; } }
public GameObjListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype, new string[] { "bsGameObjects" }, new string[] { "NAME" }) { }
internal UsbEndpointWriter(UsbDevice usbDevice, EndpointTypes epType, int packetSize, WriteEndpoints mWriteEndpoint) : base(usbDevice, epType, packetSize) { this.mWriteEndpoint = mWriteEndpoint; }
public QuestObjListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype, new string[] { "bsQuestList", "fkQuestItems" }, new string[] { "TITLE", "NAME" }) { }
/// <summary> /// Opens an endpoint for writing /// </summary> /// <param name="writeEndpoint">Endpoint number for read operations.</param> /// <param name="endPointType">One of the <see cref="EndpointTypes"/> enumerations.</param> /// <param name="packetSize">The packet size to use when endPointType is set to <see cref="EndpointTypes.Isochronous"/>.</param> /// <returns>A <see cref="UsbEndpointWriter"/> class ready for writing. /// If the specified endpoint has allready been opened, the original <see cref="UsbEndpointWriter"/> object will be returned. /// </returns> public UsbEndpointWriter OpenEndpointWriter(WriteEndpoints writeEndpoint, EndpointTypes endPointType, int packetSize) { UsbEndpointWriter epNew = new UsbEndpointWriter(this, endPointType, packetSize, writeEndpoint); return((UsbEndpointWriter)mActiveEndpoints.Add(epNew)); }
public GraveyardListEndpoint(RouteDetails owner, Panel target, char a_b, EndpointTypes etype) : base(owner, target, a_b, etype) { }
public Route Record(EndpointTypes type_a, string name_a, EndpointTypes type_b, string name_b) { return null; }