public static bool TryConstruct(IEnumerable <string> pFlags, out cPermanentFlags rFlags) { if (!cPermanentFlagList.TryConstruct(pFlags, out var lFlags)) { rFlags = null; return(false); } rFlags = new cPermanentFlags(lFlags); return(true); }
public override void ProcessTextCode(eResponseTextContext pTextContext, cResponseData pData, cTrace.cContext pParentContext) { var lContext = pParentContext.NewMethod(nameof(cCommandHookSelect), nameof(ProcessTextCode), pTextContext, pData); if (mMailboxCache.SelectedMailboxDetails != null) { return; } if (pTextContext == eResponseTextContext.information) { switch (pData) { case cResponseDataPermanentFlags lFlags: mPermanentFlags = lFlags.Flags; return; case cResponseDataUIDNext lUIDNext: mUIDNext = lUIDNext.UIDNext; return; case cResponseDataUIDValidity lUIDValidity: mUIDValidity = lUIDValidity.UIDValidity; return; case cResponseDataHighestModSeq lHighestModSeq: mHighestModSeq = lHighestModSeq.HighestModSeq; return; } } else if (pTextContext == eResponseTextContext.success && pData is cResponseDataAccess lAccess) { mAccessReadOnly = lAccess.ReadOnly; } }
public void SetPermanentFlags(bool pSelectedForUpdate, cPermanentFlags pPermanentFlags, cTrace.cContext pParentContext) { var lContext = pParentContext.NewMethod(nameof(cMailboxCacheItem), nameof(SetPermanentFlags), pSelectedForUpdate, pPermanentFlags); ZSetSelectedProperties(new cMailboxSelectedProperties(mSelectedProperties, pSelectedForUpdate, pPermanentFlags), lContext); }
public void SetSelectedProperties(bool pUIDNotSticky, cFetchableFlags pMessageFlags, bool pSelectedForUpdate, cPermanentFlags pPermanentFlags, cTrace.cContext pParentContext) { var lContext = pParentContext.NewMethod(nameof(cMailboxCacheItem), nameof(SetMessageFlags), pUIDNotSticky, pMessageFlags, pSelectedForUpdate, pPermanentFlags); if (pMessageFlags == null) { throw new ArgumentNullException(nameof(pMessageFlags)); } ZSetSelectedProperties(new cMailboxSelectedProperties(mSelectedProperties, pUIDNotSticky, pMessageFlags, pSelectedForUpdate, pPermanentFlags), lContext); }
public void Select(iMailboxHandle pMailboxHandle, bool pForUpdate, bool pAccessReadOnly, bool pUIDNotSticky, cFetchableFlags pFlags, cPermanentFlags pPermanentFlags, int pExists, int pRecent, uint pUIDNext, uint pUIDValidity, uint pHighestModSeq, cTrace.cContext pParentContext) { var lContext = pParentContext.NewMethod(nameof(cMailboxCache), nameof(Select), pMailboxHandle, pForUpdate, pAccessReadOnly, pUIDNotSticky, pFlags, pPermanentFlags, pExists, pRecent, pUIDNext, pUIDValidity, pHighestModSeq); if (mSelectedMailbox != null) { throw new InvalidOperationException(); } if (pMailboxHandle == null) { throw new ArgumentNullException(nameof(pMailboxHandle)); } if (pFlags == null) { throw new ArgumentNullException(nameof(pFlags)); } var lItem = CheckHandle(pMailboxHandle); if (pExists < 0) { throw new ArgumentOutOfRangeException(nameof(pExists)); } if (pRecent < 0) { throw new ArgumentOutOfRangeException(nameof(pRecent)); } mSelectedMailbox = new cSelectedMailbox(mSynchroniser, lItem, pForUpdate, pAccessReadOnly, pExists, pRecent, pUIDNext, pUIDValidity, pHighestModSeq, lContext); lItem.SetSelectedProperties(pUIDNotSticky, pFlags, pForUpdate, pPermanentFlags, lContext); fMailboxProperties lProperties = fMailboxProperties.isselected; if (pForUpdate) { lProperties |= fMailboxProperties.isselectedforupdate; } if (pAccessReadOnly) { lProperties |= fMailboxProperties.isaccessreadonly; } mSetState(eConnectionState.selected, lContext); mSynchroniser.InvokeMailboxPropertiesChanged(pMailboxHandle, lProperties, lContext); mSynchroniser.InvokePropertyChanged(nameof(cIMAPClient.SelectedMailbox), lContext); }
public cResponseDataPermanentFlags(cPermanentFlags pFlags) { Flags = pFlags; }