public NodeService(string name, Uri endPoint, ApiTypes api, ServiceTypes serviceType) : base(name) { // Default account icon PathIcon = "M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"; EndPoint = endPoint; Api = api; ServiceType = serviceType; //Id = Guid.NewGuid().ToString(); Id = endPoint.AbsoluteUri; switch (api) { case ApiTypes.atAtomPub: Client = new AtomPubClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atXMLRPC_MovableType: Client = new XmlRpcClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atXMLRPC_WordPress: Client = new XmlRpcClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atFeed: Client = new FeedClient(); break; //TODO: WP, AtomAPI } }
public ApplicationLayer(ApiTypes apiType, ISessionLayer sessionLayer, IFrameLayer frameLayer, ITransportLayer transportLayer) { ApiType = apiType; SessionLayer = sessionLayer; FrameLayer = frameLayer; TransportLayer = transportLayer; }
async Task <T> GetDataFromApi <T>(ApiTypes apiType, string apiRoute, string accessToken) { { var client = new HttpClient(); if (string.IsNullOrWhiteSpace(accessToken) == false) { client.SetBearerToken(accessToken); } client.BaseAddress = new Uri($"{GetApiBaseAddress()}/api/"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json)); var response = await client.GetAsync(apiRoute); if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); var model = JsonConvert.DeserializeObject <T>(json); return(model); } return(default(T)); } string GetApiBaseAddress() => apiType == ApiTypes.Student ? Urls.ApiStudentsUrl : Urls.ApiTeachersUrl; }
public NodeService(string name, string username, string password, Uri endPoint, ApiTypes api) : base(name) { UserName = username; UserPassword = password; EndPoint = endPoint; // Default account icon PathIcon = "M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"; switch (api) { case ApiTypes.atAtomPub: Client = new AtomPubClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atXMLRPC: Client = new XmlRpcClient(UserName, UserPassword, EndPoint); break; case ApiTypes.atAtomFeed: Client = new AtomFeedClient(EndPoint); break; //TODO: AtomAPI } Api = api; ID = Guid.NewGuid().ToString(); }
private void Update(kcsapi_combined_battle_midnight data, ApiTypes apiType) { if (apiType == ApiTypes.combined_battle_midnight_sp) { // 적, 아군 함대 정보 갱신 this.UpdateFleets(data.api_deck_id, data, data.api_formation); // 체력 갱신 this.UpdateMaxHP(data.api_f_maxhps, data.api_e_maxhps, data.api_f_maxhps_combined); this.UpdateBefHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined); } // 체력 갱신 this.UpdateNowHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined); if (apiType == ApiTypes.combined_battle_midnight_sp) { battleCalculator .Initialize( this.AliasFirst, this.AliasSecond, this.EnemyFirst, this.EnemySecond ); } battleCalculator.Update(data, (ApiTypes_CombinedMidnight)apiType); }
public SynergyRequest(int userId, ApiTypes api, string request) { // TODO: Complete member initialization this.UserId = userId; this.Api = api; this.Request = request; }
private void Update(kcsapi_combined_battle_midnight_ec data, ApiTypes apiType) { // 체력 갱신 this.UpdateNowHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined, data.api_e_nowhps_combined); // 전투 계산 battleCalculator.Update(data); }
public TimeLoggingController() { var apiService = new ApiTypes(null); var service = new PDashServices(apiService); _controller = new Controller(service); _osTimerService = new OsTimerService(this); }
/// <summary> /// Initializes a new instance of the <see cref="DataChunk"/> class. /// </summary> /// <param name="data">The data.</param> public DataChunk(byte[] data, byte sessionId, bool isOutcome, ApiTypes apiType) { IsOutcome = isOutcome; SessionId = sessionId; TimeStamp = Tools.CurrentDateTime; DataBufferLength = data != null ? data.Length : 0; DataBuffer = data; ApiType = apiType; }
static PDashAPI() { var apiService = new ApiTypes(null); var service = new PDashServices(apiService); Controller = new RobustController(service); stateChangedHandler = new StateChangedEventHandler(iOSTimeLoggingStateChanged); TimeLoggingController.TimeLoggingStateChanged += stateChangedHandler; }
public ApplicationClient(ApiTypes apiType, byte sessionId, ISessionClient sc, IFrameClient fc, ITransportClient tc) { ApiType = apiType; SessionId = sessionId; SessionClient = sc; FrameClient = fc; TransportClient = tc; BindLayers(); }
private void Update(kcsapi_combined_battle_ec_nighttoday data, ApiTypes apiType) { // 적, 아군 함대 정보 갱신 this.UpdateFleetsCombinedEnemy(data.api_deck_id, data); // 체력 갱신 this.UpdateMaxHP(data.api_f_maxhps, data.api_e_maxhps, data.api_f_maxhps_combined, data.api_e_maxhps_combined); this.UpdateBefHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined, data.api_e_nowhps_combined); this.UpdateNowHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined, data.api_e_nowhps_combined); // 전투 계산 battleCalculator.Update(data); }
private void Update(kcsapi_combined_airbattle data, ApiTypes apiType) { // 적, 아군 함대 정보 갱신 this.UpdateFleets(data.api_deck_id, data, data.api_formation); // 체력 갱신 this.UpdateMaxHP(data.api_f_maxhps, data.api_e_maxhps, data.api_f_maxhps_combined); this.UpdateBefHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined); this.UpdateNowHP(data.api_f_nowhps, data.api_e_nowhps, data.api_f_nowhps_combined); // 전투 계산 battleCalculator .Initialize( this.AliasFirst, this.AliasSecond, this.EnemyFirst, this.EnemySecond ) .Update(data, (ApiTypes_CombinedAirBattle)apiType); }
private static int RequestApi(SynergyDbContext context, ApiTypes api) { var apiType = context.Synergy_API.Where(x => x.Api == api.ToString() && x.IsActive).FirstOrDefault(); if (apiType != null) { return(apiType.Id); } else { Synergy_Api addApi = new Synergy_Api() { Api = api.ToString(), IsActive = true }; context.Synergy_API.Add(addApi); return(addApi.Id); } }
public ClientApiResult(ApiController controller, string baseUrl, string apiUrl, ApiTypes apiType = ApiTypes.Get, object data = null, string contentType = "application/json") { if (baseUrl == null) { throw new ArgumentNullException("baseUrl"); } if (apiUrl == null) { throw new ArgumentNullException("apiUrl"); } BaseUrl = baseUrl; ApiUrl = apiUrl; ContentType = contentType; ApiType = apiType; Data = data; _controller = controller; }
private void UpdateCurrentKeys(ApiTypes value) { switch (value) { case ApiTypes.Constant: CurrentKeys = ConstantKeys; break; case ApiTypes.Declares: CurrentKeys = DllImportKeys; break; case ApiTypes.Types: CurrentKeys = StructKeys; break; default: CurrentKeys = ConstantKeys; break; } }
private void Update(kcsapi_sortie_battle data, ApiTypes apiType) { if (apiType == ApiTypes.practice_battle) { this.ClearBattleInfo(); } // 적, 아군 함대 정보 갱신 this.UpdateFleets(data.api_deck_id, data, data.api_formation); // 체력 갱신 this.UpdateMaxHP(data.api_f_maxhps, data.api_e_maxhps); this.UpdateBefHP(data.api_f_nowhps, data.api_e_nowhps); this.UpdateNowHP(data.api_f_nowhps, data.api_e_nowhps); // 전투 계산 battleCalculator .Initialize( this.AliasFirst, this.AliasSecond, this.EnemyFirst, this.EnemySecond ) .Update(data, (ApiTypes_Sortie)apiType); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Create UI _drawerLayout = FindViewById <DrawerLayout>(Resource.Id.drawer_layout); // Init toolbar _toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); _toolbar.Title = this.Resources.GetString(Resource.String.app_name); SetSupportActionBar(_toolbar); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetHomeButtonEnabled(true); //_toolbar. // Attach item selected handler to navigation view var navigationView = FindViewById <NavigationView>(Resource.Id.nav_view); navigationView.SetCheckedItem(0); navigationView.Menu.GetItem(0).SetChecked(true); navigationView.NavigationItemSelected += NavigationView_NavigationItemSelected; // Create ActionBarDrawerToggle button and add it to the toolbar var drawerToggle = new ActionBarDrawerToggle(this, _drawerLayout, _toolbar, Resource.String.open_drawer, Resource.String.close_drawer); _drawerLayout.SetDrawerListener(drawerToggle); // drawerToggle.SetHomeAsUpIndicator(null); drawerToggle.SyncState(); _loginFragment = new Login(); _homeFragment = new Home(); _settingsFragment = new SettingsPage(); _globalTimeLogFragment = new GlobalTimeLogList(); _timeLogDetailFragment = new TimeLogDetail(); _listOfProjectFragment = new ListOfProjects(); _taskDetailFragment = new TaskDetails(); _taskTimeLogDetailFragment = new TaskTimeLogList(); _listOfTasksFragment = new ListProjectTasks(""); _testFragment = new TestFragment(); //for testing //_currentFragment = _testFragment; // if logged in _currentFragment = _homeFragment; // else //CurrentFragment = ListOfProjectFragment; var fragmentTx = FragmentManager.BeginTransaction(); // The fragment will have the ID of Resource.Id.fragment_container. fragmentTx.Replace(Resource.Id.fragmentContainer, _currentFragment); // Commit the transaction. fragmentTx.Commit(); var apiService = new ApiTypes(); var service = new PDashServices(apiService); Ctrl = new Controller(service); // ... CheckForCrashes(); // checkForUpdates(); // FragmentManager.AddOnBackStackChangedListener(this); // shouldDisplayHomeUp(); }