/// <inheritdoc/> public void OnRefreshComplete(BaseItem item) { _logger.LogDebug("OnRefreshComplete {0}", item.Id.ToString("N", CultureInfo.InvariantCulture)); _activeRefreshes.Remove(item.Id, out _); RefreshCompleted?.Invoke(this, new GenericEventArgs <BaseItem>(item)); }
public void OnRefreshCompleted() { OnRefreshCompletedCalls++; if (this.RefreshCompleted != null) { RefreshCompleted.Invoke(this, new EventArgs()); } }
public void OnRefreshComplete(BaseItem item) { //_logger.LogInformation("OnRefreshComplete {0}", item.Id.ToString("N", CultureInfo.InvariantCulture)); lock (_activeRefreshes) { _activeRefreshes.Remove(item.Id); } RefreshCompleted?.Invoke(this, new GenericEventArgs <BaseItem>(item)); }
private async Task DoRefresh() { //if (IsBusy) return;//crud test fails with this uncommented StartBeingBusy(RefreshingText); //OnRefreshClicked(); await Task.Run(() => OnRefreshClicked()); await Task.Run(() => OnRefreshClickedAsync()); StopBeingBusy(); RefreshCompleted?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Called when update data is available in order to get the /// engine to refresh it's internal data structures. /// This overload is used when the data is presented as a /// <see cref="Stream"/>, usually a <see cref="MemoryStream"/>. /// </summary> /// <param name="dataFileIdentifier"> /// The identifier of the data file to update. /// This engine only uses one data file so this parameter is ignored. /// </param> /// <param name="stream"> /// The <see cref="Stream"/> containing the data to refresh the /// engine with. /// </param> public override void RefreshData(string dataFileIdentifier, Stream stream) { var data = ReadBytesFromStream(stream); if (_engine == null) { _engine = _swigFactory.CreateEngine(data, data.Length, _config, _propertiesConfigSwig); } else { _engine.refreshData(data, data.Length); } GetEngineMetaData(); RefreshCompleted?.Invoke(this, null); }
/// <summary> /// Called when update data is available in order to get the /// engine to refresh it's internal data structures. /// This overload is used if the data is a physical file on disk. /// </summary> /// <param name="dataFileIdentifier"> /// The identifier of the data file to update. /// This engine only uses one data file so this parameter is ignored. /// </param> public override void RefreshData(string dataFileIdentifier) { var dataFile = DataFiles.Single(); if (_engine == null) { _engine = _swigFactory.CreateEngine(dataFile.DataFilePath, _config, _propertiesConfigSwig); } else { _engine.refreshData(); } GetEngineMetaData(); RefreshCompleted?.Invoke(this, null); }
public async void InitAsync() { Source.Clear(); var result = await client.GetAsync <List <manifestoutgoing> >("Get"); if (result != null) { var results = result.Where(O => O.CreatedDate >= StartDate && O.CreatedDate <= EndDate).ToList(); foreach (var item in results) { Source.Add(item); } } SourceView.Refresh(); RefreshCompleted?.Invoke(); }
private async void InitAsync() { Source.Clear(); var url = string.Format("Get?start={0}-{1}-{2}&end={3}-{4}-{5}", StartDate.Date.Year, StartDate.Date.Month, StartDate.Day, EndDate.Year, EndDate.Month, EndDate.Day); var result = await client.GetAsync <List <invoice> >(url); if (result != null) { foreach (var item in result) { Source.Add(item); SourceView.Refresh(); } } RefreshCompleted?.Invoke(); }
private async void InitAsync() { Source.Clear(); var result = await client.GetAsync <List <city> >("Get"); if (result != null) { foreach (var item in result) { Source.Add(item); SourceView.Refresh(); } } signalRClient = ResourcesBase.GetSignalClient(); signalRClient.OnAddCity += SignalRClient_OnAddCity; RefreshCompleted?.Invoke(); }
public async void CompleteTask() { var result = await client.GetAsync <List <Port> >(""); if (result != default(List <Port>)) { Source.Clear(); foreach (var item in result) { Source.Add(item); } SourceView.Refresh(); RefreshCompleted?.Invoke(); } signalRClient = ResourcesBase.GetSignalClient(); signalRClient.OnAddPort += SignalRClient_OnAddPort; }
internal CharacterList(CharListRequestSender charListRequestSender, CharacterListResultMessageHandler characterListMessageHandler) { if (characterListMessageHandler == null) { throw new ArgumentNullException(nameof(characterListMessageHandler)); } _CharListRequestSender = charListRequestSender ?? throw new ArgumentNullException(nameof(charListRequestSender)); characterListMessageHandler.CharacterListReceived += (sender, args) => { _Characters.Clear(); _Characters.AddRange(args.Characters); _ActiveCharacter = args.ActiveCharacterId; RefreshCompleted?.Invoke(this); }; }
private async void InitAsync() { Source.Clear(); var url = string.Format("{0}-{1}-{2}/{3}-{4}-{5}", StartDate.Year, StartDate.Month, StartDate.Day, EndDate.Year, EndDate.Month, EndDate.Day); var result = await client.GetAsync <List <Penjualan> >(url); if (result != null) { foreach (var item in result) { Source.Add(item); await Task.Delay(10); } } SourceView.Refresh(); RefreshCompleted?.Invoke(); }
public async void InitAsync() { Source.Clear(); var url = string.Format("{0}-{1}-{2}/{3}-{4}-{5}", StartDate.Year, StartDate.Month, StartDate.Day, EndDate.Year, EndDate.Month, EndDate.Day); var result = await client.GetAsync <List <Manifestoutgoing> >(url); if (result != null) { var results = result.Where(O => O.CreatedDate >= StartDate && O.CreatedDate <= EndDate).ToList(); foreach (var item in results) { Source.Add(item); } } SourceView.Refresh(); RefreshCompleted?.Invoke(); }
public void Refresh() { lazyCells.Clear(); Lights = new LightSet[Width, Height]; EndingLights = new LightSet[Width, Height]; var queue = new Queue <Light>(); for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { Cells[x, y]?.Reset(); if (Cells[x, y] is LightSource lightSource) { lazyCells.Add(lightSource); } } } while (lazyCells.Count > 0) { foreach (var cell in lazyCells) { var lights = cell.Apply(null); if (lights != null) { foreach (var light in lights) { queue.Enqueue(light); } } } lazyCells.Clear(); while (queue.Count > 0) { var light = queue.Dequeue(); var newLights = light.Handle(this); if (newLights != null) { foreach (var newLight in newLights) { queue.Enqueue(newLight); } } } } bool success = true; for (int y = 0; y < Height; y++) { for (int x = 0; x < Width; x++) { if (Cells[x, y] is TargetCell target) { target.SetActivated(Lights[x, y], EndingLights[x, y]); if (!target.Success) { success = false; } } } } MissionComplete = success; RefreshCompleted?.Invoke(this, success); }
private void OnRefreshCompleted() { RefreshCompleted?.Invoke(this, EventArgs.Empty); }