Ejemplo n.º 1
0
        private static MemoryPropertyBag SaveLocationContainer(IStorePropertyBag storeObject, StorePropertyDefinition[] properties)
        {
            MemoryPropertyBag memoryPropertyBag = new MemoryPropertyBag();

            memoryPropertyBag.PreLoadStoreProperty <StorePropertyDefinition>(properties, storeObject.GetProperties(properties));
            return(memoryPropertyBag);
        }
 private static bool TryReadEntry(BinaryReader reader, out ExternalUser user)
 {
     if (reader.ReadUInt32() == ExternalUserCollection.ptagLocalDirectoryEntryId)
     {
         uint num = reader.ReadUInt32();
         MemoryPropertyBag memoryPropertyBag = new MemoryPropertyBag();
         int num2 = 0;
         while ((long)num2 < (long)((ulong)num))
         {
             uint   num3 = reader.ReadUInt32();
             object obj  = ExternalUserCollection.ReadPropValue(reader, ((PropTag)num3).ValueType(), reader.ReadUInt32());
             if (obj != null)
             {
                 PropertyTagPropertyDefinition prop = PropertyTagPropertyDefinition.CreateCustom(string.Empty, num3);
                 memoryPropertyBag.PreLoadStoreProperty(prop, obj, (int)num);
             }
             num2++;
         }
         memoryPropertyBag.SetAllPropertiesLoaded();
         IDirectPropertyBag directPropertyBag = memoryPropertyBag;
         if (directPropertyBag.IsLoaded(InternalSchema.MemberSIDLocalDirectory) && directPropertyBag.IsLoaded(InternalSchema.MemberExternalIdLocalDirectory) && directPropertyBag.IsLoaded(InternalSchema.MemberEmailLocalDirectory))
         {
             if (!directPropertyBag.IsLoaded(InternalSchema.MemberName))
             {
                 memoryPropertyBag[InternalSchema.MemberName] = directPropertyBag.GetValue(InternalSchema.MemberEmailLocalDirectory);
             }
             user = new ExternalUser(memoryPropertyBag);
             return(true);
         }
     }
     user = null;
     return(false);
 }