示例#1
0
 protected virtual void InternalSetProperty(MdbPropertyMapping mdbMapping, object value)
 {
     if (this.allowItemBind)
     {
         this.InitializeItemIfNecessary();
         MdbDocumentAdapter.CallXsoAndMapExceptions(this.diagnosticsSession, this.id.MailboxGuid, delegate
         {
             mdbMapping.SetPropertyValue(this.Item, value, new MdbDocumentAdapter.MdbDocAdapterPropertyContext
             {
                 MailboxSession = this.Session
             });
         });
         if (this.mappedPropertiesToLoadOnBind != null)
         {
             foreach (StorePropertyDefinition item in mdbMapping.StorePropertyDefinitions)
             {
                 if (!this.mappedPropertiesToLoadOnBind.Contains(item))
                 {
                     this.mappedPropertiesToLoadOnBind.Add(item);
                 }
             }
             return;
         }
     }
     else
     {
         mdbMapping.SetPropertyValue(this.preloadedProperties, value);
     }
 }
示例#2
0
        protected virtual object InternalGetProperty(MdbPropertyMapping mdbMapping)
        {
            object result = null;

            if (this.allowItemBind)
            {
                this.InitializeItemIfNecessary();
                result = MdbDocumentAdapter.CallXsoAndMapExceptionsWithReturnValue <object>(this.diagnosticsSession, this.id.MailboxGuid, () => MdbDocumentAdapter.CheckPropertyValue(mdbMapping.GetPropertyValue(this.Item, new MdbDocumentAdapter.MdbDocAdapterPropertyContext
                {
                    MailboxSession = this.Session
                })));
            }
            else if (this.AllPropertiesContained(mdbMapping.StorePropertyDefinitions))
            {
                return(MdbDocumentAdapter.CheckPropertyValue(mdbMapping.GetPropertyValue(this.preloadedProperties)));
            }
            return(result);
        }