예제 #1
0
        internal static LocalizedException TranslateExceptionHandler(Exception e)
        {
            if (e is LocalizedException)
            {
                if (!(e is MapiRetryableException))
                {
                    if (!(e is MapiPermanentException))
                    {
                        goto IL_42;
                    }
                }
                try
                {
                    LocalizedException ex = StorageGlobals.TranslateMapiException(Strings.UnableToCommunicate, (LocalizedException)e, null, null, string.Empty, new object[0]);
                    if (ex != null)
                    {
                        return(ex);
                    }
                }
                catch (ArgumentException)
                {
                }
            }
IL_42:
            return(null);
        }
예제 #2
0
 public static void DoAdCallAndTranslateExceptions(ADOperation call, bool expectObject, string debugContext)
 {
     Util.ThrowOnNullArgument(call, "call");
     try
     {
         ADNotificationAdapter.RunADOperation(call);
     }
     catch (DataValidationException innerException)
     {
         if (expectObject)
         {
             throw new ObjectNotFoundException(ServerStrings.ADUserNotFound, innerException);
         }
     }
     catch (DataSourceOperationException ex)
     {
         throw StorageGlobals.TranslateDirectoryException(ServerStrings.ADException, ex, null, "MigrationHelperBase::{0}. Failed for [{1}], due to directory exception.", new object[]
         {
             ex,
             debugContext
         });
     }
     catch (DataSourceTransientException ex2)
     {
         throw StorageGlobals.TranslateDirectoryException(ServerStrings.ADException, ex2, null, "MigrationHelperBase::{0}. Failed for [{1}], due to directory exception.", new object[]
         {
             ex2,
             debugContext
         });
     }
 }
        private void SaveCultures(IRecipientSession adRecipientSession)
        {
            PreferredCultures preferredCultures = new PreferredCultures(base.Principal.PreferredCultures);

            preferredCultures.AddSupportedCulture(this.Language, (CultureInfo culture) => true);
            ADUser aduser = adRecipientSession.Read(base.Principal.ObjectId) as ADUser;

            if (aduser != null)
            {
                aduser.Languages.Clear();
                Util.AddRange <CultureInfo, CultureInfo>(aduser.Languages, preferredCultures);
                try
                {
                    adRecipientSession.Save(aduser);
                }
                catch (DataValidationException innerException)
                {
                    throw new CorruptDataException(ServerStrings.ExCannotSaveInvalidObject(aduser), innerException);
                }
                catch (DataSourceOperationException ex)
                {
                    throw StorageGlobals.TranslateDirectoryException(ServerStrings.ADException, ex, null, "MailboxRegionalConfiguration::SaveCultures. Failed due to directory exception {0}.", new object[]
                    {
                        ex
                    });
                }
                catch (DataSourceTransientException ex2)
                {
                    throw StorageGlobals.TranslateDirectoryException(ServerStrings.ADException, ex2, null, "MailboxRegionalConfiguration::SaveCultures. Failed due to directory exception {0}.", new object[]
                    {
                        ex2
                    });
                }
            }
        }
예제 #4
0
 protected void CheckDisposed(string methodName)
 {
     if (this.isDisposed)
     {
         StorageGlobals.TraceFailedCheckDisposed(this, methodName);
         throw new ObjectDisposedException(this.ToString());
     }
 }
예제 #5
0
        public static Exception CreateXsoExceptionFromMapiException(string exceptionType, LocalizedString message)
        {
            Assembly assembly = Assembly.GetAssembly(typeof(MapiExceptionMailboxQuarantined));
            Type     type     = assembly.GetType(exceptionType);

            if (type != null)
            {
                ConstructorInfo constructorInfo  = type.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic)[0];
                ConstructorInfo constructorInfo2 = constructorInfo;
                object[]        array            = new object[5];
                array[0] = message.ToString();
                array[1] = 0;
                array[2] = 0;
                LocalizedException exception = (LocalizedException)constructorInfo2.Invoke(array);
                return(StorageGlobals.TranslateMapiException(message, exception, null, null, string.Empty, new object[0]));
            }
            return(null);
        }
        internal static PropTag GetNeverClutterTag(object mapiThis, StoreSession session)
        {
            PropertyDefinition inferenceNeverClutterOverrideApplied = ItemSchema.InferenceNeverClutterOverrideApplied;
            NamedProp          namedProp  = new NamedProp(WellKnownPropertySet.Inference, inferenceNeverClutterOverrideApplied.Name);
            NamedProp          namedProp2 = WellKnownNamedProperties.Find(namedProp);
            NamedProp          namedProp3 = namedProp2 ?? namedProp;

            NamedProp[] np = new NamedProp[]
            {
                namedProp3
            };
            PropTag[] array = null;
            bool      flag  = false;

            try
            {
                if (session != null)
                {
                    session.BeginMapiCall();
                    session.BeginServerHealthCall();
                    flag = true;
                }
                if (StorageGlobals.MapiTestHookBeforeCall != null)
                {
                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                }
                array = session.Mailbox.MapiStore.GetIDsFromNames(true, np);
            }
            catch (MapiPermanentException ex)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiRulesError, ex, session, mapiThis, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("ClutterOverrideManager::GetNeverClutterTag", new object[0]),
                    ex
                });
            }
            catch (MapiRetryableException ex2)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiRulesError, ex2, session, mapiThis, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("ClutterOverrideManager::GetNeverClutterTag", new object[0]),
                    ex2
                });
            }
            finally
            {
                try
                {
                    if (session != null)
                    {
                        session.EndMapiCall();
                        if (flag)
                        {
                            session.EndServerHealthCall();
                        }
                    }
                }
                finally
                {
                    if (StorageGlobals.MapiTestHookAfterCall != null)
                    {
                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                    }
                }
            }
            return((array.Length > 0) ? (array[0] | (PropTag)11U) : PropTag.Null);
        }
        internal static Rule LoadNeverClutterRule(object mapiThis, StoreSession session)
        {
            Rule result;

            using (Folder folder = Folder.Bind(session, session.GetDefaultFolderId(DefaultFolderType.Inbox)))
            {
                try
                {
                    Rule[] array = null;
                    bool   flag  = false;
                    try
                    {
                        if (session != null)
                        {
                            session.BeginMapiCall();
                            session.BeginServerHealthCall();
                            flag = true;
                        }
                        if (StorageGlobals.MapiTestHookBeforeCall != null)
                        {
                            StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                        }
                        array = folder.MapiFolder.GetRules(new PropTag[0]);
                    }
                    catch (MapiPermanentException ex)
                    {
                        throw StorageGlobals.TranslateMapiException(ServerStrings.MapiRulesError, ex, session, mapiThis, "{0}. MapiException = {1}.", new object[]
                        {
                            string.Format("ClutterOverrideManager::LoadNeverClutterRule", new object[0]),
                            ex
                        });
                    }
                    catch (MapiRetryableException ex2)
                    {
                        throw StorageGlobals.TranslateMapiException(ServerStrings.MapiRulesError, ex2, session, mapiThis, "{0}. MapiException = {1}.", new object[]
                        {
                            string.Format("ClutterOverrideManager::LoadNeverClutterRule", new object[0]),
                            ex2
                        });
                    }
                    finally
                    {
                        try
                        {
                            if (session != null)
                            {
                                session.EndMapiCall();
                                if (flag)
                                {
                                    session.EndServerHealthCall();
                                }
                            }
                        }
                        finally
                        {
                            if (StorageGlobals.MapiTestHookAfterCall != null)
                            {
                                StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                            }
                        }
                    }
                    foreach (Rule rule in array)
                    {
                        if (rule.IsExtended && rule.Name == "Never Clutter Rule")
                        {
                            return(rule);
                        }
                    }
                }
                catch (StoragePermanentException)
                {
                }
                result = null;
            }
            return(result);
        }
예제 #8
0
        public static List <Guid> GetOnlineDatabase(string serverFqdn, List <Guid> guidDatabases)
        {
            List <Guid> list = new List <Guid>();

            MdbStatus[]  array        = null;
            StoreSession storeSession = null;
            object       thisObject   = null;
            bool         flag         = false;

            try
            {
                if (storeSession != null)
                {
                    storeSession.BeginMapiCall();
                    storeSession.BeginServerHealthCall();
                    flag = true;
                }
                if (StorageGlobals.MapiTestHookBeforeCall != null)
                {
                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                }
                try
                {
                    using (ExRpcAdmin exRpcAdmin = ExRpcAdmin.Create("Client=MSExchangeRPC", serverFqdn, null, null, null))
                    {
                        array = exRpcAdmin.ListMdbStatus(guidDatabases.ToArray());
                    }
                }
                catch (MapiExceptionNoAccess)
                {
                }
            }
            catch (MapiPermanentException ex)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotGetProperties, ex, storeSession, thisObject, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Cannot list mailbox database status.", new object[0]),
                    ex
                });
            }
            catch (MapiRetryableException ex2)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCannotGetProperties, ex2, storeSession, thisObject, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Cannot list mailbox database status.", new object[0]),
                    ex2
                });
            }
            finally
            {
                try
                {
                    if (storeSession != null)
                    {
                        storeSession.EndMapiCall();
                        if (flag)
                        {
                            storeSession.EndServerHealthCall();
                        }
                    }
                }
                finally
                {
                    if (StorageGlobals.MapiTestHookAfterCall != null)
                    {
                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                    }
                }
            }
            if (array != null)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    if ((array[i].Status & MdbStatusFlags.Online) == MdbStatusFlags.Online)
                    {
                        list.Add(guidDatabases[i]);
                    }
                }
            }
            return(list);
        }
예제 #9
0
        public void Append(IEnumerable <Activity> activities)
        {
            Util.ThrowOnNullArgument(activities, "activities");
            MapiFastTransferStream mapiFastTransferStream = null;
            StoreSession           storeSession           = this.mailboxSession;
            bool flag = false;

            try
            {
                if (storeSession != null)
                {
                    storeSession.BeginMapiCall();
                    storeSession.BeginServerHealthCall();
                    flag = true;
                }
                if (StorageGlobals.MapiTestHookBeforeCall != null)
                {
                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                }
                mapiFastTransferStream = (MapiFastTransferStream)this.mailboxSession.Mailbox.MapiStore.OpenProperty(PropTag.FastTransfer, InterfaceIds.IFastTransferStream, 0, OpenPropertyFlags.None);
            }
            catch (MapiPermanentException ex)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex, storeSession, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Append", new object[0]),
                    ex
                });
            }
            catch (MapiRetryableException ex2)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex2, storeSession, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Append", new object[0]),
                    ex2
                });
            }
            finally
            {
                try
                {
                    if (storeSession != null)
                    {
                        storeSession.EndMapiCall();
                        if (flag)
                        {
                            storeSession.EndServerHealthCall();
                        }
                    }
                }
                finally
                {
                    if (StorageGlobals.MapiTestHookAfterCall != null)
                    {
                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                    }
                }
            }
            using (mapiFastTransferStream)
            {
                StoreSession storeSession2 = this.mailboxSession;
                bool         flag2         = false;
                try
                {
                    if (storeSession2 != null)
                    {
                        storeSession2.BeginMapiCall();
                        storeSession2.BeginServerHealthCall();
                        flag2 = true;
                    }
                    if (StorageGlobals.MapiTestHookBeforeCall != null)
                    {
                        StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                    }
                    mapiFastTransferStream.Configure(AppendOnlyActivityLog.FxConfigurationProps);
                }
                catch (MapiPermanentException ex3)
                {
                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex3, storeSession2, this, "{0}. MapiException = {1}.", new object[]
                    {
                        string.Format("Append", new object[0]),
                        ex3
                    });
                }
                catch (MapiRetryableException ex4)
                {
                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex4, storeSession2, this, "{0}. MapiException = {1}.", new object[]
                    {
                        string.Format("Append", new object[0]),
                        ex4
                    });
                }
                finally
                {
                    try
                    {
                        if (storeSession2 != null)
                        {
                            storeSession2.EndMapiCall();
                            if (flag2)
                            {
                                storeSession2.EndServerHealthCall();
                            }
                        }
                    }
                    finally
                    {
                        if (StorageGlobals.MapiTestHookAfterCall != null)
                        {
                            StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                        }
                    }
                }
                using (IFastTransferProcessor <FastTransferDownloadContext> fastTransferProcessor = new FastTransferMessageIterator(new ActivityMessageIterator(activities), FastTransferCopyMessagesFlag.None, true))
                {
                    using (FastTransferDownloadContext fastTransferDownloadContext = FastTransferDownloadContext.CreateForDownload(FastTransferSendOption.Unicode, 1U, CTSGlobals.AsciiEncoding, NullResourceTracker.Instance, IncludeAllPropertyFilterFactory.Instance, false))
                    {
                        fastTransferDownloadContext.PushInitial(fastTransferProcessor);
                        byte[] array = new byte[30720];
                        ArraySegment <byte> buffer = new ArraySegment <byte>(array);
                        while (fastTransferDownloadContext.State != FastTransferState.Done)
                        {
                            if (fastTransferDownloadContext.State == FastTransferState.Error)
                            {
                                throw new InvalidOperationException("FastTransferDownloadContext failed during activity log upload.");
                            }
                            int nextBuffer = fastTransferDownloadContext.GetNextBuffer(buffer);
                            if (nextBuffer > 0)
                            {
                                StoreSession storeSession3 = this.mailboxSession;
                                bool         flag3         = false;
                                try
                                {
                                    if (storeSession3 != null)
                                    {
                                        storeSession3.BeginMapiCall();
                                        storeSession3.BeginServerHealthCall();
                                        flag3 = true;
                                    }
                                    if (StorageGlobals.MapiTestHookBeforeCall != null)
                                    {
                                        StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                                    }
                                    mapiFastTransferStream.Upload(new ArraySegment <byte>(array, 0, nextBuffer));
                                }
                                catch (MapiPermanentException ex5)
                                {
                                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex5, storeSession3, this, "{0}. MapiException = {1}.", new object[]
                                    {
                                        string.Format("Append", new object[0]),
                                        ex5
                                    });
                                }
                                catch (MapiRetryableException ex6)
                                {
                                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex6, storeSession3, this, "{0}. MapiException = {1}.", new object[]
                                    {
                                        string.Format("Append", new object[0]),
                                        ex6
                                    });
                                }
                                finally
                                {
                                    try
                                    {
                                        if (storeSession3 != null)
                                        {
                                            storeSession3.EndMapiCall();
                                            if (flag3)
                                            {
                                                storeSession3.EndServerHealthCall();
                                            }
                                        }
                                    }
                                    finally
                                    {
                                        if (StorageGlobals.MapiTestHookAfterCall != null)
                                        {
                                            StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                                        }
                                    }
                                }
                            }
                        }
                        StoreSession storeSession4 = this.mailboxSession;
                        bool         flag4         = false;
                        try
                        {
                            if (storeSession4 != null)
                            {
                                storeSession4.BeginMapiCall();
                                storeSession4.BeginServerHealthCall();
                                flag4 = true;
                            }
                            if (StorageGlobals.MapiTestHookBeforeCall != null)
                            {
                                StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                            }
                            mapiFastTransferStream.Flush();
                        }
                        catch (MapiPermanentException ex7)
                        {
                            throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex7, storeSession4, this, "{0}. MapiException = {1}.", new object[]
                            {
                                string.Format("Append", new object[0]),
                                ex7
                            });
                        }
                        catch (MapiRetryableException ex8)
                        {
                            throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToWriteActivityLog, ex8, storeSession4, this, "{0}. MapiException = {1}.", new object[]
                            {
                                string.Format("Append", new object[0]),
                                ex8
                            });
                        }
                        finally
                        {
                            try
                            {
                                if (storeSession4 != null)
                                {
                                    storeSession4.EndMapiCall();
                                    if (flag4)
                                    {
                                        storeSession4.EndServerHealthCall();
                                    }
                                }
                            }
                            finally
                            {
                                if (StorageGlobals.MapiTestHookAfterCall != null)
                                {
                                    StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #10
0
        public IEnumerable <Activity> Query()
        {
            MapiFastTransferStream fxStream     = null;
            StoreSession           storeSession = this.mailboxSession;
            bool flag = false;

            try
            {
                if (storeSession != null)
                {
                    storeSession.BeginMapiCall();
                    storeSession.BeginServerHealthCall();
                    flag = true;
                }
                if (StorageGlobals.MapiTestHookBeforeCall != null)
                {
                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                }
                fxStream = (MapiFastTransferStream)this.mailboxSession.Mailbox.MapiStore.OpenProperty(PropTag.FastTransfer, InterfaceIds.IFastTransferStream, 1, OpenPropertyFlags.None);
            }
            catch (MapiPermanentException ex)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex, storeSession, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Query", new object[0]),
                    ex
                });
            }
            catch (MapiRetryableException ex2)
            {
                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex2, storeSession, this, "{0}. MapiException = {1}.", new object[]
                {
                    string.Format("Query", new object[0]),
                    ex2
                });
            }
            finally
            {
                try
                {
                    if (storeSession != null)
                    {
                        storeSession.EndMapiCall();
                        if (flag)
                        {
                            storeSession.EndServerHealthCall();
                        }
                    }
                }
                finally
                {
                    if (StorageGlobals.MapiTestHookAfterCall != null)
                    {
                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                    }
                }
            }
            using (fxStream)
            {
                StoreSession storeSession2 = this.mailboxSession;
                bool         flag2         = false;
                try
                {
                    if (storeSession2 != null)
                    {
                        storeSession2.BeginMapiCall();
                        storeSession2.BeginServerHealthCall();
                        flag2 = true;
                    }
                    if (StorageGlobals.MapiTestHookBeforeCall != null)
                    {
                        StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                    }
                    fxStream.Configure(AppendOnlyActivityLog.FxConfigurationProps);
                }
                catch (MapiPermanentException ex3)
                {
                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex3, storeSession2, this, "{0}. MapiException = {1}.", new object[]
                    {
                        string.Format("Query", new object[0]),
                        ex3
                    });
                }
                catch (MapiRetryableException ex4)
                {
                    throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex4, storeSession2, this, "{0}. MapiException = {1}.", new object[]
                    {
                        string.Format("Query", new object[0]),
                        ex4
                    });
                }
                finally
                {
                    try
                    {
                        if (storeSession2 != null)
                        {
                            storeSession2.EndMapiCall();
                            if (flag2)
                            {
                                storeSession2.EndServerHealthCall();
                            }
                        }
                    }
                    finally
                    {
                        if (StorageGlobals.MapiTestHookAfterCall != null)
                        {
                            StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                        }
                    }
                }
                Queue <Activity>  activityBuffer           = new Queue <Activity>();
                bool              resetActivityFound       = false;
                Action <Activity> desearializationDelegate = delegate(Activity activity)
                {
                    if (AppendOnlyActivityLog.IsResetActivity(activity))
                    {
                        resetActivityFound = true;
                    }
                    if (!resetActivityFound)
                    {
                        activityBuffer.Enqueue(activity);
                    }
                };
                using (IFastTransferProcessor <FastTransferUploadContext> processor = new FastTransferMessageIterator(new ActivityMessageIteratorClient(desearializationDelegate), true))
                {
                    using (FastTransferUploadContext context = new FastTransferUploadContext(CTSGlobals.AsciiEncoding, NullResourceTracker.Instance, IncludeAllPropertyFilterFactory.Instance, false))
                    {
                        context.PushInitial(processor);
                        byte[] buffer = null;
                        while (!resetActivityFound)
                        {
                            StoreSession storeSession3 = this.mailboxSession;
                            bool         flag3         = false;
                            try
                            {
                                if (storeSession3 != null)
                                {
                                    storeSession3.BeginMapiCall();
                                    storeSession3.BeginServerHealthCall();
                                    flag3 = true;
                                }
                                if (StorageGlobals.MapiTestHookBeforeCall != null)
                                {
                                    StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod());
                                }
                                buffer = fxStream.Download();
                            }
                            catch (MapiPermanentException ex5)
                            {
                                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex5, storeSession3, this, "{0}. MapiException = {1}.", new object[]
                                {
                                    string.Format("Query", new object[0]),
                                    ex5
                                });
                            }
                            catch (MapiRetryableException ex6)
                            {
                                throw StorageGlobals.TranslateMapiException(ServerStrings.FailedToReadActivityLog, ex6, storeSession3, this, "{0}. MapiException = {1}.", new object[]
                                {
                                    string.Format("Query", new object[0]),
                                    ex6
                                });
                            }
                            finally
                            {
                                try
                                {
                                    if (storeSession3 != null)
                                    {
                                        storeSession3.EndMapiCall();
                                        if (flag3)
                                        {
                                            storeSession3.EndServerHealthCall();
                                        }
                                    }
                                }
                                finally
                                {
                                    if (StorageGlobals.MapiTestHookAfterCall != null)
                                    {
                                        StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod());
                                    }
                                }
                            }
                            if (buffer == null)
                            {
                                break;
                            }
                            context.PutNextBuffer(new ArraySegment <byte>(buffer));
                            if (context.State == FastTransferState.Error)
                            {
                                new CorruptDataException(ServerStrings.FailedToReadActivityLog);
                            }
                            while (activityBuffer.Count > 0)
                            {
                                yield return(activityBuffer.Dequeue());
                            }
                        }
                        context.Flush();
                        if (context.State == FastTransferState.Error)
                        {
                            new CorruptDataException(ServerStrings.FailedToReadActivityLog);
                        }
                        while (activityBuffer.Count > 0)
                        {
                            yield return(activityBuffer.Dequeue());
                        }
                    }
                }
            }
            yield break;
        }
예제 #11
0
 private static void TranslateThrow(LocalizedException e, LocalizedString context)
 {
     throw StorageGlobals.TranslateMapiException(context, e, null, null, string.Empty, new object[0]);
 }