public void DoWork() { using (var fileStream = File.Open(_filename, FileMode.Open, FileAccess.Read)) { ApplicationDataStore applicationData = (ApplicationDataStore)_xmlSerializer.ReadObject(fileStream); _viewModelParser.ClearAndLoad(applicationData); OperationStatus?.Invoke(this, new OperationEventArgs("Project loaded!")); } }
public void DoWork() { using (var fileStream = File.Open(_fileName, FileMode.OpenOrCreate, FileAccess.Write)) { var applicationData = _viewModelParser.ExtractData(); _dataContractSerializer.WriteObject(fileStream, applicationData); OperationStatus?.Invoke(this, new OperationEventArgs("Project saved!")); } }
public void DoWork() { try { OperationStatus?.Invoke(this, new OperationEventArgs("Session host starting")); _networkManager.StartHosting(); } catch (NetworkingException e) { OperationStatus?.Invoke(this, new OperationEventArgs("Error! " + e.Message)); } }
protected void OnOperationStatusChanged(ProcessStatusEventArgs e) { Log.Debug($"OperationStatusChanged of {e.ComponentType} with message: {e.StatusMessage}"); OperationStatus?.Invoke(this, e); }
private void SendStatusUpdate(object sender, OperationEventArgs e) { _mainThreadDispatcher.InvokeAsync(() => OperationStatus?.Invoke(sender, e)); }
private void SendStatusMessage(string message) { OperationStatus?.Invoke(this, new OperationEventArgs(message)); }