public static SystemTrackerMessageProperty Read(IDictionary <string, object> messageProperties)
        {
            SystemTrackerMessageProperty systemTrackerMessageProperty;

            if (!SystemTrackerMessageProperty.TryGet <SystemTrackerMessageProperty>(messageProperties, out systemTrackerMessageProperty))
            {
                throw new ArgumentException(SRClient.SystemTrackerPropertyMissing, "messageProperties");
            }
            return(systemTrackerMessageProperty);
        }
        public static bool TryAdd(IDictionary <string, object> messageProperties, string systemTracker)
        {
            SystemTrackerMessageProperty systemTrackerMessageProperty;

            if (messageProperties == null || SystemTrackerMessageProperty.TryGet <SystemTrackerMessageProperty>(messageProperties, out systemTrackerMessageProperty))
            {
                return(false);
            }
            messageProperties.Add("SystemTracker", new SystemTrackerMessageProperty(systemTracker));
            return(true);
        }
Пример #3
0
        private static string GetSystemTracker(IDictionary <string, object> messageProperties, IDictionary <string, string> messageHeaders)
        {
            string tracker;
            SystemTrackerMessageProperty systemTrackerMessageProperty;
            string str;

            if (!SystemTrackerMessageProperty.TryGet <SystemTrackerMessageProperty>(messageProperties, out systemTrackerMessageProperty))
            {
                tracker = (!TrackingContext.TryGetHeader(messageHeaders, "SystemTracker", out str) ? string.Empty : str);
            }
            else
            {
                tracker = systemTrackerMessageProperty.Tracker;
            }
            return(tracker);
        }
Пример #4
0
        private static string GetSystemTracker(MessageProperties messageProperties, MessageHeaders messageHeaders)
        {
            string tracker;
            SystemTrackerMessageProperty systemTrackerMessageProperty;
            SystemTrackerHeader          systemTrackerHeader;

            if (!SystemTrackerMessageProperty.TryGet <SystemTrackerMessageProperty>(messageProperties, out systemTrackerMessageProperty))
            {
                tracker = (!SystemTrackerHeader.TryRead(messageHeaders, out systemTrackerHeader) ? string.Empty : systemTrackerHeader.Tracker);
            }
            else
            {
                tracker = systemTrackerMessageProperty.Tracker;
            }
            return(tracker);
        }