private RuntimeTrackingProfile GetRuntimeTrackingProfile(TrackingParticipant participant) { RuntimeTrackingProfile runtimeTrackingProfile; if (!this.profileSubscriptions.TryGetValue(participant, out runtimeTrackingProfile)) { TrackingProfile trackingProfile = participant.TrackingProfile; if (trackingProfile != null) { runtimeTrackingProfile = RuntimeTrackingProfile.GetRuntimeTrackingProfile(trackingProfile, this.definition); this.Merge(runtimeTrackingProfile.Filter); IEnumerable <string> subscribedActivityNames = runtimeTrackingProfile.GetSubscribedActivityNames(); if (subscribedActivityNames != null) { if (this.activitySubscriptions == null) { this.activitySubscriptions = new Hashtable(); } foreach (string str in subscribedActivityNames) { if (this.activitySubscriptions[str] == null) { this.activitySubscriptions[str] = str; } } } } else { this.Merge(new TrackingRecordPreFilter(true)); } this.profileSubscriptions.Add(participant, runtimeTrackingProfile); } return(runtimeTrackingProfile); }
RuntimeTrackingProfile GetRuntimeTrackingProfile(TrackingParticipant participant) { TrackingProfile profile; RuntimeTrackingProfile runtimeProfile; if (!this.profileSubscriptions.TryGetValue(participant, out runtimeProfile)) { profile = participant.TrackingProfile; if (profile != null) { runtimeProfile = RuntimeTrackingProfile.GetRuntimeTrackingProfile(profile, this.definition); Merge(runtimeProfile.Filter); //Add the names to the list of activities that have subscriptions. This provides a quick lookup //for the runtime to check if a TrackingRecord has to be created. IEnumerable <string> activityNames = runtimeProfile.GetSubscribedActivityNames(); if (activityNames != null) { if (this.activitySubscriptions == null) { this.activitySubscriptions = new Hashtable(); } foreach (string name in activityNames) { if (this.activitySubscriptions[name] == null) { this.activitySubscriptions[name] = name; } } } } else { //for null profiles, set all the filter flags. Merge(new TrackingRecordPreFilter(true)); } this.profileSubscriptions.Add(participant, runtimeProfile); } return(runtimeProfile); }