예제 #1
0
        private static BlobRecipient ReadRecipient(ExTimeZone timeZone, BinaryReader reader)
        {
            BlobRecipient blobRecipient = null;
            uint          num           = reader.ReadUInt32();

            reader.ReadUInt32();
            if (num > 0U)
            {
                blobRecipient = new BlobRecipient(timeZone);
                for (uint num2 = 0U; num2 < num; num2 += 1U)
                {
                    PropTag propTag;
                    object  value;
                    if (!BlobRecipientParser.ReadPropValue(reader, out propTag, out value))
                    {
                        ExTraceGlobals.StorageTracer.TraceError(0L, "BlobRecipientParser::ReadRecipient. Failed reading property.");
                        return(null);
                    }
                    if (propTag.ValueType() != PropType.Error && !propTag.IsNamedProperty())
                    {
                        try
                        {
                            PropertyTagPropertyDefinition propertyDefinition = PropertyTagPropertyDefinition.CreateCustom(propTag.ToString(), (uint)propTag);
                            blobRecipient[propertyDefinition] = value;
                        }
                        catch (InvalidPropertyTypeException ex)
                        {
                            ExTraceGlobals.StorageTracer.TraceError <PropTag, string>(0L, "BlobRecipientParser::ReadRecipient. Failed creating custom property definition for ptag={0}; exception message={1}", propTag, ex.Message);
                            return(null);
                        }
                    }
                }
            }
            return(blobRecipient);
        }