Пример #1
0
 private void AddCancelRequestedSubscription(CancelRequestedQuery cancelQuery)
 {
     _trackingRecordPreFilter.TrackCancelRequestedRecords = true;
     if (_cancelRequestedSubscriptions == null)
     {
         _cancelRequestedSubscriptions = new List <CancelRequestedQuery>();
     }
     _cancelRequestedSubscriptions.Add(cancelQuery);
 }
Пример #2
0
        private CancelRequestedQuery Match(CancelRequestedRecord cancelRecord)
        {
            CancelRequestedQuery query = null;

            if (_cancelRequestedSubscriptions != null)
            {
                for (int i = 0; i < _cancelRequestedSubscriptions.Count; i++)
                {
                    //check specific and then generic
                    string activityName = cancelRecord.Activity == null ? null : cancelRecord.Activity.Name;
                    if (string.CompareOrdinal(_cancelRequestedSubscriptions[i].ActivityName, activityName) == 0)
                    {
                        if (CheckSubscription(_cancelRequestedSubscriptions[i].ChildActivityName, cancelRecord.Child.Name))
                        {
                            query = _cancelRequestedSubscriptions[i];
                            break;
                        }
                    }
                    else if (string.CompareOrdinal(_cancelRequestedSubscriptions[i].ActivityName, "*") == 0)
                    {
                        if (CheckSubscription(_cancelRequestedSubscriptions[i].ChildActivityName, cancelRecord.Child.Name))
                        {
                            query = _cancelRequestedSubscriptions[i];
                            break;
                        }
                    }
                }
            }

            if ((query != null) && (_associatedProfile.ImplementationVisibility == ImplementationVisibility.RootScope))
            {
                if ((!ShouldTrackActivity(cancelRecord.Activity, query.ActivityName)) ||
                    (!ShouldTrackActivity(cancelRecord.Child, query.ChildActivityName)))
                {
                    return(null);
                }
            }

            return(query);
        }