internal static TrackingError CreateFromWSMessage(ArrayOfTrackingPropertiesType propertyBag)
        {
            string value  = string.Empty;
            string value2 = string.Empty;
            string value3 = string.Empty;

            foreach (TrackingPropertyType trackingPropertyType in propertyBag.Items)
            {
                if (string.Equals(trackingPropertyType.Name, "ErrorCode", StringComparison.OrdinalIgnoreCase))
                {
                    value = trackingPropertyType.Value;
                }
                else if (string.Equals(trackingPropertyType.Name, "Server", StringComparison.OrdinalIgnoreCase))
                {
                    value2 = trackingPropertyType.Value;
                }
                else if (string.Equals(trackingPropertyType.Name, "Domain", StringComparison.OrdinalIgnoreCase))
                {
                    value3 = trackingPropertyType.Value;
                }
            }
            if (string.IsNullOrEmpty(value) || string.IsNullOrEmpty(value2) || string.IsNullOrEmpty(value3))
            {
                TraceWrapper.SearchLibraryTracer.TraceError(0, "Error is not well formed. One or more of errorCode, server or domain is missing", new object[0]);
                return(null);
            }
            TrackingError trackingError = new TrackingError(propertyBag);

            TraceWrapper.SearchLibraryTracer.TraceDebug <TrackingError>(0, "Decoded error: {0}", trackingError);
            return(trackingError);
        }
 private TrackingError(ArrayOfTrackingPropertiesType propertyBag)
 {
     this.properties = new Dictionary <string, string>(5);
     base..ctor();
     foreach (TrackingPropertyType trackingPropertyType in propertyBag.Items)
     {
         this.properties[trackingPropertyType.Name] = trackingPropertyType.Value;
     }
 }