Exemple #1
0
		private void OnObjectFinished(MessageData dataContainer)
		{
			var dataBytes = dataContainer.IsDataCompressed
				? ZlibStream.UncompressBuffer(dataContainer.Data) : dataContainer.Data;
			using (var dataStream = new MemoryStream(dataBytes))
			using (var dataReader = new BinaryReader(dataStream))
			{
				object receivedMessage;
				try
				{
					receivedMessage = TryReceiveMessage(dataReader);
				}
				catch (Exception ex)
				{
					receivedMessage =
						new ServerError(StackTraceExtensions.FormatExceptionIntoClickableMultilineText(ex));
				}
				if (DataReceived != null)
					DataReceived(receivedMessage);
				else
					throw new NobodyIsUsingTheDataReceivedEvent(receivedMessage);
			}
		}
		private void OnServerError(ServerError serverError)
		{
			OnAppBuildFailedRecieved(new AppBuildFailed(serverError.Error));
		}
		private void ProcessAndLogServerError(ServerError serverError)
		{
			Error = serverError.ToString();
			LogAndShowError();
		}
 private void ProcessAndLogServerError(ServerError serverError)
 {
     Error = serverError.ToString();
     Logger.Warning(Error);
     if (serverError.Error != "Project name not found on server " + SelectedProject.Name ||
         selectedProject.IsDefault())
         return;
     selectedProject.ResetToDefault();
     Logger.Info("Trying to login with default Content Project: " + selectedProject.Name);
     ValidateLogin();
 }