private void ExtractInformation(MatchEventArgs e) { if (GameEnded) { Winner = e.WinnerName; OnPropertyChanged(nameof(Winner)); } else { Word = e.Word; OnPropertyChanged(nameof(Word)); } foreach (dynamic info in e.Players) { Player p = new Player(false, info["UserID"], info["Username"]); p.Score = info["Points"]; if (!GameEnded) { var points = info["NewPoints"]; p.PointsRecentlyGained = points; } Players.Add(p); } Players = new ObservableCollection <Player>(Players.OrderByDescending(p => p.Score)); OnPropertyChanged(nameof(Players)); }
void find_MatchInstance ( object sender, MatchEventArgs <CompositeObjectInstance> e ) { try { InstanceData instance = new InstanceData( ); instance.InstanceNumber = e.Info.InstanceNumber.ToString( ); instance.PatientID = e.Dataset.GetValue <string> (DicomTag.PatientID, string.Empty); instance.SeriesInstanceUID = e.Info.SeriesInstanceUID; instance.SOPClassUID = e.Info.SOPClassUID; instance.SOPInstanceUID = e.Info.SOPInstanceUID; instance.StationName = e.Dataset.GetValue <string> (DicomTag.StationName, string.Empty); instance.StudyInstanceUID = e.Dataset.GetValue <string> (DicomTag.StudyInstanceUID, string.Empty); instance.TransferSyntax = e.Dataset.GetValue <string> (DicomTag.TransferSyntaxUID, string.Empty); Matches.Add(instance as T); } catch (Exception exception) { System.Diagnostics.Debug.Assert(false, exception.Message); throw; } }
private void find_MatchStudy(object sender, MatchEventArgs <Study> e) { StudyData study = new StudyData( ); study.Patient = new PatientData( ); study.AccessionNumber = e.Info.AccessionNumber; study.AdmittingDiagnosesDescription = e.Info.AdmitDiagDescrp; study.Age = (e.Info.Age == null) ? null : e.Info.Age.Value.Number.ToString( ) + e.Info.Age.Value.Reference.ToString( );//TODO: this needs to be replaced with the DICOM encoding study.Date = (e.Info.Date == null) ? null : e.Info.Date.Value.ToString( ); study.Description = e.Info.Description; study.Id = e.Info.Id; study.InstanceUID = e.Info.InstanceUID; study.ModalitiesInStudy = (null != e.Info.ModalitiesInStudy) ? e.Info.ModalitiesInStudy.ToArray( ) : null; study.NumberOfRelatedInstances = e.Info.NumberOfRelatedInstances; study.NumberOfRelatedSeries = e.Info.NumberofRelatedSeries; study.ReferringPhysiciansName = e.Info.ReferringPhysiciansName.FullDicomEncoded; study.Size = (e.Info.Size == null) ? null : e.Info.Size.ToString( ); study.Weight = (e.Info.Weight == null) ? null : e.Info.Weight.ToString( ); study.Patient.ID = e.Info.Patient.Id; study.Patient.Name = e.Info.Patient.Name.FullDicomEncoded; study.Patient.BirthDate = (e.Info.Patient.BirthDate == null) ? null : e.Info.Patient.BirthDate.ToString( ); study.AdditionalPatientHistory = e.Dataset.GetValue <string> (DicomTag.AdditionalPatientHistory, string.Empty); //study.NameOfDoctorsReading Matches.Add(study as T); }
// when matchmaker finds a match, start the meeting if not expecting anymore to join void OnMatchMakerFoundMatch(object sender, MatchEventArgs e) { Log("Matchmaker found a match."); // if (e.realTimeMatch.expectedPlayerCount == 0) StartMeeting(); }
public LeaderBoard(MatchEventArgs e, bool gameEnded) { GameEnded = gameEnded; OnPropertyChanged(nameof(GameEnded)); Players = new ObservableCollection <Player>(); ExtractInformation(e); InitializeComponent(); }
private void RaiseMatchingChangedEvent(MatchEventArgs e) { if (e.RoutedEvent == null) { e.RoutedEvent = MatchingChangedEvent; } RaiseEvent(e); }
private void SocketClientCoopWordGuessed(object source, EventArgs args) { MatchEventArgs e = (MatchEventArgs)args; if (GameViewModel.Mode == GameModes.Coop || GameViewModel.Mode == GameModes.Solo) { GameViewModel.TeamPoints = e.Points; GameViewModel.TeamNewPoints = e.NewPoints; Application.Current.Dispatcher.Invoke(() => AnimatePointsGained()); } }
private void GetMatch(object sender, MatchEventArgs args) { if (_numberOfMatches == 0) { return; } StackLayout.HeightRequest += 180; FrameLayout.HeightRequest += 150; FrameLayout.Children.Add(_model.GenereateFrame(args.LeftSide, args.RightSide)); _numberOfMatches--; }
public ScannerEventSupport(object source) { matchEvent = new MatchEventArgs(); messageEvent = new MessageEventArgs(); tokenEvent = new TokenEventArgs(); traceEvent = new TraceEventArgs(); semPredEvent = new SemanticPredicateEventArgs(); synPredEvent = new SyntacticPredicateEventArgs(); newLineEvent = new NewLineEventArgs(); listeners = new Hashtable(); this.source = source; }
private void find_MatchStudy(object sender, MatchEventArgs <Study> e) { try { if (Cancelling) { return; } OnMatchFound(e.Dataset); } catch (Exception) { } }
void find_MatchInstance ( object sender, MatchEventArgs <CompositeObjectInstance> e ) { try { if (Cancelling) { return; } OnMatchFound(e.Dataset); } catch (Exception) { } }
private void find_MatchSeries ( object sender, MatchEventArgs <Leadtools.Dicom.Scu.Series> e ) { try { if (Cancelling) { return; } OnMatchFound(e.Dataset); } catch (Exception) { } }
private void find_MatchSeries ( object sender, MatchEventArgs <Leadtools.Dicom.Scu.Series> e ) { SeriesData series = new SeriesData( ); series.Patient = new PatientData(); series.Date = (e.Info.Date == null) ? null : e.Info.Date.Value.ToString( ); series.Description = e.Info.Description; series.InstanceUID = e.Info.InstanceUID; series.Modality = e.Info.Modality; series.Number = (e.Info.Number == null) ? string.Empty : e.Info.Number.ToString( ); series.NumberOfRelatedInstances = e.Info.NumberOfRelatedInstances.ToString( ); //series.PatientID = e.Dataset.GetValue <string> ( DicomTag.PatientID, string.Empty ) ; series.Patient.ID = e.Dataset.GetValue <string> (DicomTag.PatientID, string.Empty); series.StudyInstanceUID = e.Dataset.GetValue <string> (DicomTag.StudyInstanceUID, string.Empty); Matches.Add(series as T); }
public virtual void parserMismatchNot(object source, MatchEventArgs e) { System.Console.Out.WriteLine(indentString + e); }
/// <summary> /// Handle the "MisMatchNot" event. /// </summary> /// <param name="source">Event source object</param> /// <param name="e">Event data object</param> public virtual void parserMismatchNot(object source, MatchEventArgs e) { }
private void HandleMatch(object s, MatchEventArgs e) { _eventService.SaveEvent(e.Log1, e.Log2); }
public void OnMatchFound(MatchEventArgs matchEventArgs) { MatchFound?.Invoke(this, matchEventArgs); }
void ReplaceHelper_MatchingChangedEvent(object sender, MatchEventArgs e) { RaiseMatchingChangedEvent(e); }