private void HandleDataFoundStatus(StorageEventArgs e)
		{
			if (e == null || !e.HasData)
			{
				HandleDataNotFoundStatus();
				return;
			}

			CurrentData = e.Data.First();
			IsPreviousDataLoaded = true;

			ChangeStatusText(Resources.GetString(Resource.String.DataFound));
			FillFormWithCurrentData();
		}
		private void OnStorageCommChanged(object s, StorageEventArgs e)
		{
			switch (e.Status)
			{
				case StorageStatus.WriteFailed:
					HandleWriteFailedStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.WriteFailed));
					break;
				case StorageStatus.ReadFailed:
					HandleReadFailedStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.ReadFailed));
					break;
				case StorageStatus.WriteSuccessful:
					HandleWriteSuccessfulStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.WriteSuccessful));
					break;
				case StorageStatus.ReadSuccessful:
					HandleReadSuccessfulStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.ReadSuccessful));
					break;
				case StorageStatus.DataNotFound:
					HandleDataNotFoundStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.DataNotFound));
					break;
				case StorageStatus.DataFound:
					HandleDataFoundStatus(e);
					Log.Debug(Tag, Resources.GetString(Resource.String.DataFound));
					break;
				case StorageStatus.Starting:
					HandleStorageServiceStartingStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.StartingStorageService));
					break;
				case StorageStatus.NoDataStored:
					Log.Debug(Tag, Resources.GetString(Resource.String.NoDataStored));
					break;
				case StorageStatus.DeleteSuccessful:
					Log.Debug(Tag, Resources.GetString(Resource.String.DeleteSuccessful));
					break;
				case StorageStatus.DeleteFailed:
					Log.Debug(Tag, Resources.GetString(Resource.String.DeleteFailed));
					break;
				case StorageStatus.StoreFailed:
					HandleStoreFailedStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.StoreFailed));
					break;
				case StorageStatus.Stopped:
					HandleStorageServiceStoppedStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.StorageServiceStopped));
					break;
				case StorageStatus.StoreSuccessful:
					HandleStoreSuccessfulStatus();
					Log.Debug(Tag, Resources.GetString(Resource.String.StoreSuccessful));
					break;
				default:
					throw new ArgumentOutOfRangeException();
			}
		}
示例#3
0
		private void HandleStoreSuccessfulStatus(StorageEventArgs e)
		{
			ChangeOverlayStatusText(Resources.GetString(Resource.String.StoreSuccessful));
			HideOverlay();

			if (!IsInAnalyzer) return;

			if (!e.HasData)
			{
				HandleStoreFailedStatus();
				return;
			}

			CurrentData = e.Data.First();

			lock (_fragmentLock)
			{
				if (CurrentData.Class == "FAILED")
				{
					((AnalyzerTabFragment) _currentFragment).AnalyzerFailed = true;
				}
				((AnalyzerTabFragment) _currentFragment).ShowResultViews(this, CurrentData.Class, SkillStoreApplication.IsHelpRequired);
			}

			ToggleKeepScreenOn(false);
			IsAnalyzing = false;
		}
示例#4
0
		private void HandleDataFoundStatus(StorageEventArgs e)
		{
			ChangeOverlayStatusText(Resources.GetString(Resource.String.DataFound));
			HideOverlay();

			if (IsInAnalyzer) return;

			if (e == null || !e.HasData)
			{
				HandleReadFailedStatus();
				return;
			}

			lock (_fragmentLock)
			{
				((HistoryTabFragment) _currentFragment).SetItems(this, e.Data);
			}
		}
示例#5
0
		private void OnCommunication(object s, StorageEventArgs e)
		{
			var handler = Communication;
			if (handler != null) handler(s, e);
		}