private int ReadLcid() { if (this.mapiStore != null) { PropValue prop = this.mapiStore.GetProp(PropTag.SortLocaleId); if (!prop.IsNull() && !prop.IsError()) { return(prop.GetInt()); } return(0); } else { this.storeSession.Mailbox.Load(new PropertyDefinition[] { SortLCIDContext.SortLciPropertyDefinition }); object obj = this.storeSession.Mailbox[SortLCIDContext.SortLciPropertyDefinition]; if (obj == null || obj is PropertyError) { return(0); } return((int)obj); } }
// Token: 0x06001577 RID: 5495 RVA: 0x0007A018 File Offset: 0x00078218 public static List <MailboxData> GetMailboxTable(PropTag[] requiredMailboxTableProperties, DatabaseInfo databaseInfo) { PropValue[][] mailboxes; try { mailboxes = MailboxTableQuery.GetMailboxes("Client=TBA", databaseInfo, requiredMailboxTableProperties); } catch (MapiRetryableException innerException) { throw new SkipException(innerException); } catch (MapiPermanentException innerException2) { throw new SkipException(innerException2); } List <MailboxData> list = new List <MailboxData>(); foreach (PropValue[] array2 in mailboxes) { if (array2 != null) { PropValue mailboxProperty = MailboxTableQuery.GetMailboxProperty(array2, PropTag.UserGuid); PropValue mailboxProperty2 = MailboxTableQuery.GetMailboxProperty(array2, PropTag.MailboxNumber); if (mailboxProperty.PropTag.Id() == PropTag.UserGuid.Id() && mailboxProperty2.PropTag.Id() == PropTag.MailboxNumber.Id()) { Guid mailboxGuid = new Guid(mailboxProperty.GetBytes()); int @int = mailboxProperty2.GetInt(); list.Add(new MailboxProcessorMailboxData(databaseInfo, mailboxGuid, @int, array2)); } } } return(list); }
private static string GetFolderLegacyDistinguishedName(MapiEntryId abEntryId, MapiFolder folder) { string result; try { if (null == abEntryId) { if (folder == null) { throw new ArgumentNullException("folder"); } PropValue prop = folder.GetProp(PropTag.AddressBookEntryId); if (PropType.Error == prop.PropType) { return(null); } abEntryId = new MapiEntryId(prop.GetBytes()); } result = MapiMessageStoreSession.GetLegacyDNFromAddressBookEntryId(abEntryId); } catch (MapiPermanentException) { result = null; } catch (MapiRetryableException) { result = null; } return(result); }
internal static MapiEntryId GetEntryIdentity(MapiProp mapiObject) { MapiEntryId result; try { if (mapiObject == null) { throw new ArgumentNullException("mapiObject"); } PropValue prop = mapiObject.GetProp(PropTag.EntryId); if (PropType.Error == prop.PropType) { result = null; } else { result = new MapiEntryId(prop.GetBytes()); } } catch (MapiPermanentException) { result = null; } catch (MapiRetryableException) { result = null; } return(result); }
// Token: 0x060002EB RID: 747 RVA: 0x00012394 File Offset: 0x00010594 private object ConvertValue(PropValue propValue) { if ((propValue.PropType & PropType.MultiValueFlag) == PropType.MultiValueFlag) { object[] array = propValue.Value as object[]; if (array == null || array.Length != 1) { throw new NspiException(NspiStatus.TooComplex, "Only one value permitted with multivalue"); } if (propValue.PropType == PropType.AnsiStringArray && propValue.Value is byte[][]) { byte[][] array2 = (byte[][])propValue.Value; return(this.encoding.GetString(array2[0])); } return(array[0]); } else { if (propValue.PropType == PropType.AnsiString && propValue.Value is byte[]) { return(this.encoding.GetString((byte[])propValue.Value)); } return(propValue.Value); } }
protected static void CreateAndSubmitMessage(MapiFolder folder, string sourceMailboxName, string targetMailAddress, string subject, bool deleteAfterSubmit) { using (MapiMessage mapiMessage = folder.CreateMessage()) { PropValue[] props = new PropValue[] { new PropValue(PropTag.DeleteAfterSubmit, deleteAfterSubmit), new PropValue(PropTag.Subject, subject), new PropValue(PropTag.ReceivedByEmailAddress, targetMailAddress), new PropValue(PropTag.Body, "This is a Test-Mailflow probe message.") }; mapiMessage.SetProps(props); mapiMessage.ModifyRecipients(ModifyRecipientsFlags.AddRecipients, new AdrEntry[] { new AdrEntry(new PropValue[] { new PropValue(PropTag.EmailAddress, targetMailAddress), new PropValue(PropTag.OriginatorDeliveryReportRequested, deleteAfterSubmit), new PropValue(PropTag.AddrType, "SMTP"), new PropValue(PropTag.RecipientType, RecipientType.To), new PropValue(PropTag.DisplayName, sourceMailboxName) }) }); mapiMessage.SaveChanges(); mapiMessage.SubmitMessage(SubmitMessageFlags.ForceSubmit); } }
private void WaitAndProcessDeliveryReceipt(MapiFolder folder, string subject, string fromAddress, string toAddress, string perfInstance) { using (MapiMessage mapiMessage = this.WaitForDeliveryReceipt(folder, subject, base.Task.ErrorLatency, base.Task.ExecutionTimeout, fromAddress, toAddress)) { if (mapiMessage != null) { PropValue prop = mapiMessage.GetProp(PropTag.MessageDeliveryTime); PropValue prop2 = mapiMessage.GetProp(PropTag.OriginalSubmitTime); EnhancedTimeSpan enhancedTimeSpan = prop.GetDateTime() - prop2.GetDateTime(); if (enhancedTimeSpan < EnhancedTimeSpan.Zero) { enhancedTimeSpan = EnhancedTimeSpan.Zero; } base.OutputResult(Strings.MapiTransactionResultSuccess, enhancedTimeSpan, base.IsRemoteTest); base.AddSuccessMonitoringEvent(1000, Strings.TestMailflowSucceeded(fromAddress, toAddress)); base.AddPerfCounter("Mailflow Latency", perfInstance, enhancedTimeSpan.TotalSeconds); } else { EnhancedTimeSpan latency = EnhancedTimeSpan.FromSeconds(0.0); base.OutputResult(Strings.MapiTransactionResultFailure, latency, base.IsRemoteTest); base.AddErrorMonitoringEvent(1001, Strings.TestMailflowFailed(fromAddress, toAddress, base.Task.ExecutionTimeout)); base.AddPerfCounter("Mailflow Latency", perfInstance, -1.0); } } }
private void WaitAndProcessProbeResponses(MapiFolder folder, string fromAddress, Dictionary <string, string> subjectTargets, ExDateTime probeSentTime) { List <byte[]> list = new List <byte[]>(); List <string> list2 = new List <string>(); for (int i = 0; i < base.Task.ExecutionTimeout; i++) { foreach (KeyValuePair <string, string> keyValuePair in subjectTargets) { if (!string.IsNullOrEmpty(keyValuePair.Value)) { using (MapiMessage deliveryReceipt = TestMailFlowHelper.GetDeliveryReceipt(folder, keyValuePair.Key, false)) { if (deliveryReceipt != null) { PropValue prop = deliveryReceipt.GetProp(PropTag.MessageDeliveryTime); PropValue prop2 = deliveryReceipt.GetProp(PropTag.EntryId); PropValue prop3 = deliveryReceipt.GetProp(PropTag.Subject); if (!prop.IsError() && prop.Value != null && prop3.Value != null) { string text = prop3.Value.ToString(); if (text.StartsWith("RSP: CrossPremiseMailFlowMonitoring-", StringComparison.OrdinalIgnoreCase)) { EnhancedTimeSpan latency = ((ExDateTime)prop.GetDateTime() > probeSentTime) ? ((ExDateTime)prop.GetDateTime() - probeSentTime) : EnhancedTimeSpan.Zero; base.OutputResult(Strings.TestMailflowSucceeded(fromAddress, keyValuePair.Value), latency, base.IsRemoteTest); } else if (text.StartsWith("Undeliverable: CrossPremiseMailFlowMonitoring-", StringComparison.OrdinalIgnoreCase)) { EnhancedTimeSpan latency2 = EnhancedTimeSpan.FromSeconds(0.0); string info = (string)deliveryReceipt.GetProp(PropTag.Body).Value; base.OutputResult(Strings.CrossPremiseProbeNdred(fromAddress, keyValuePair.Value, info), latency2, base.IsRemoteTest); } list2.Add(keyValuePair.Key); list.Add(prop2.GetBytes()); } } } } } foreach (string key in list2) { subjectTargets.Remove(key); } list2.Clear(); if (subjectTargets.Count == 0) { break; } Thread.Sleep(1000); } foreach (KeyValuePair <string, string> keyValuePair2 in subjectTargets) { if (!string.IsNullOrEmpty(keyValuePair2.Value)) { EnhancedTimeSpan latency3 = EnhancedTimeSpan.FromSeconds(0.0); base.OutputResult(Strings.MapiTransactionResultFailure, latency3, base.IsRemoteTest); } } folder.DeleteMessages(DeleteMessagesFlags.ForceHardDelete, list.ToArray()); }
public List <PropValue> GetPropertyValues() { var result = new List <PropValue>(); if (Values.Count > 1 && Values[1].Length > 0) { try { XmlDocument doc = new XmlDocument(); doc.LoadXml(Values[1]); XmlNodeList nl = doc.SelectNodes("/settings/setting"); foreach (XmlNode n in nl) { var pv = new PropValue(); pv.Name = n.Attributes["name"].Value; pv.Value = n.Attributes["value"].Value; pv.Control = n.Attributes["control"].Value; result.Add(pv); } } catch { } } return(result); }
/// <summary> /// Verify that a stream's current position contains a serialized FixedPropTypePropValue. /// </summary> /// <param name="stream">A FastTransferStream.</param> /// <returns>If the stream's current position contains /// a serialized FixedPropTypePropValue, return true, else false</returns> public static new bool Verify(FastTransferStream stream) { ushort tmp = stream.VerifyUInt16(); return(LexicalTypeHelper.IsFixedType((PropertyDataType)tmp) && !PropValue.IsPidTagIdsetGiven(stream)); }
public PropValue[] GetValuesFromRequestJob(RequestJobBase requestJob) { PropValue[] result = new PropValue[26]; this.MakePropValue(result, MapiPropertiesIndex.RequestStatus, requestJob.Status); this.MakePropValue(result, MapiPropertiesIndex.JobProcessingState, requestJob.RequestJobState); this.MakePropValue(result, MapiPropertiesIndex.MRSServerName, requestJob.MRSServerName); this.MakePropValue(result, MapiPropertiesIndex.AllowedToFinishMove, requestJob.AllowedToFinishMove); this.MakePropValue(result, MapiPropertiesIndex.CancelRequest, requestJob.CancelRequest); this.MakePropValue(result, MapiPropertiesIndex.ExchangeGuid, requestJob.ExchangeGuid); this.MakePropValue(result, MapiPropertiesIndex.ArchiveGuid, requestJob.ArchiveGuid ?? Guid.Empty); this.MakePropValue(result, MapiPropertiesIndex.LastUpdateTimestamp, requestJob.TimeTracker.GetTimestamp(RequestJobTimestamp.LastUpdate) ?? DateTime.MinValue); this.MakePropValue(result, MapiPropertiesIndex.CreationTimestamp, requestJob.TimeTracker.GetTimestamp(RequestJobTimestamp.Creation) ?? DateTime.MinValue); this.MakePropValue(result, MapiPropertiesIndex.JobType, requestJob.JobType); this.MakePropValue(result, MapiPropertiesIndex.Flags, requestJob.Flags); this.MakePropValue(result, MapiPropertiesIndex.SourceDatabase, (requestJob.SourceDatabase != null) ? requestJob.SourceDatabase.ObjectGuid : Guid.Empty); this.MakePropValue(result, MapiPropertiesIndex.TargetDatabase, (requestJob.TargetDatabase != null) ? requestJob.TargetDatabase.ObjectGuid : Guid.Empty); this.MakePropValue(result, MapiPropertiesIndex.DoNotPickUntilTimestamp, requestJob.NextPickupTime ?? DateTime.MinValue); this.MakePropValue(result, MapiPropertiesIndex.RequestType, requestJob.RequestType); this.MakePropValue(result, MapiPropertiesIndex.SourceArchiveDatabase, (requestJob.SourceArchiveDatabase != null) ? requestJob.SourceArchiveDatabase.ObjectGuid : Guid.Empty); this.MakePropValue(result, MapiPropertiesIndex.TargetArchiveDatabase, (requestJob.TargetArchiveDatabase != null) ? requestJob.TargetArchiveDatabase.ObjectGuid : Guid.Empty); this.MakePropValue(result, MapiPropertiesIndex.Priority, requestJob.Priority); this.MakePropValue(result, MapiPropertiesIndex.SourceExchangeGuid, requestJob.SourceExchangeGuid); this.MakePropValue(result, MapiPropertiesIndex.TargetExchangeGuid, requestJob.TargetExchangeGuid); this.MakePropValue(result, MapiPropertiesIndex.RehomeRequest, requestJob.RehomeRequest); this.MakePropValue(result, MapiPropertiesIndex.InternalFlags, requestJob.RequestJobInternalFlags); this.MakePropValue(result, MapiPropertiesIndex.PartitionHint, (requestJob.PartitionHint != null) ? requestJob.PartitionHint.GetPersistablePartitionHint() : null); this.MakePropValue(result, MapiPropertiesIndex.PoisonCount, requestJob.PoisonCount); this.MakePropValue(result, MapiPropertiesIndex.FailureType, requestJob.FailureType); this.MakePropValue(result, MapiPropertiesIndex.WorkloadType, requestJob.WorkloadType); return(result); }
public static FolderRec Create(MapiFolder folder, PropTag[] additionalPtagsToLoad) { PropTag[] array; if (additionalPtagsToLoad == null) { array = FolderRec.PtagsToLoad; } else { List <PropTag> list = new List <PropTag>(); list.AddRange(FolderRec.PtagsToLoad); list.AddRange(additionalPtagsToLoad); array = list.ToArray(); } PropValue[] props = folder.GetProps(array); byte[] array2 = null; for (int i = 0; i < array.Length; i++) { PropTag propTag = array[i]; PropTag propTag2 = propTag; if (propTag2 != PropTag.EntryId) { if (propTag2 == PropTag.LTID) { props[i] = new PropValue(PropTag.LTID, folder.MapiStore.GlobalIdFromId(folder.MapiStore.GetFidFromEntryId(array2))); } } else { array2 = (byte[])props[i].Value; } } return(FolderRec.Create(props)); }
internal static string GetName(MapiProp mapiObject) { string result; try { if (mapiObject == null) { throw new ArgumentNullException("mapiObject"); } PropValue prop = mapiObject.GetProp(PropTag.DisplayName); if (PropType.Error == prop.PropType) { result = null; } else { result = prop.GetString(); } } catch (MapiPermanentException) { result = null; } catch (MapiRetryableException) { result = null; } return(result); }
PropProblemData[] IFolder.SetProps(PropValueData[] pvda) { PropProblemData[] result = null; PropValue[] native = DataConverter <PropValueConverter, PropValue, PropValueData> .GetNative(pvda); PropValue[] array = new PropValue[native.Length]; for (int i = 0; i < native.Length; i++) { PropTag propTag = native[i].PropTag; object obj = native[i].Value; if (propTag == PropTag.IpmWasteBasketEntryId) { byte[] array2 = obj as byte[]; if (array2 != null) { obj = this.Mailbox.MapiStore.GlobalIdFromId(this.Mailbox.MapiStore.GetFidFromEntryId(array2)); } } array[i] = new PropValue(propTag, obj); } using (this.Mailbox.RHTracker.Start()) { result = DataConverter <PropProblemConverter, PropProblem, PropProblemData> .GetData(this.Folder.SetProps(array)); } return(result); }
public Goods AddProp(Goods goods, PropName name, PropValue value) { var goodsProp = new GoodsProp(_idGenerator.Create(), goods, name, value); goods.GoodsProps.Add(goodsProp); return(goods); }
internal static SafeRpcMemoryHandle MarshalPropValueCollection(ICollection <PropValue> properties) { SafeRpcMemoryHandle safeRpcMemoryHandle = new SafeRpcMemoryHandle(); safeRpcMemoryHandle.Allocate(PropValue.GetBytesToMarshal(properties)); PropValue.MarshalToNative(properties, safeRpcMemoryHandle); return(safeRpcMemoryHandle); }
private static void ValidateRestrictionValue(PropValue value) { if (value.Value == null) { throw new InvalidRuleException("Value stored in restriction is null"); } RuleUtil.CheckValueType(value.Value, value.PropTag); }
public static RowEntry Remove(long memberId) { PropValue[] propValues = new PropValue[] { new PropValue(PropTag.MemberId, memberId) }; return(RowEntry.Remove(propValues)); }
/// <summary> /// Verify that a stream's current position contains a serialized VarPropTypePropValue. /// </summary> /// <param name="stream">A FastTransferStream.</param> /// <returns>If the stream's current position contains /// a serialized VarPropTypePropValue, return true, else false</returns> public static new bool Verify(FastTransferStream stream) { ushort tmp = stream.VerifyUInt16(); return(LexicalTypeHelper.IsVarType((PropertyDataType)tmp) || PropValue.IsPidTagIdsetGiven(stream) || (tmp & 0x8000) == 0x8000); // Adapter all code page specified in [MS-OXCFXICS]2.2.4.1.1.1 Code Page Property Types }
public static DateTime GetDateTimeOrDefault(PropValue pv) { if (pv.IsError() || pv.IsNull() || pv.Value == null) { return(DateTime.MinValue); } return(pv.GetDateTime()); }
internal static bool IsMessageTypeSupported(MapiMessage message, MapiStore store) { RequestJobNamedPropertySet requestJobNamedPropertySet = RequestJobNamedPropertySet.Get(store); PropValue prop = message.GetProp(requestJobNamedPropertySet.PropTags[9]); MRSJobType value = MapiUtils.GetValue <MRSJobType>(prop, MRSJobType.RequestJobE14R3); return(RequestJobXML.IsKnownJobType(value)); }
public static PropValue[] PvaFromMoMTPva(PropertyValue[] momtPva) { PropValue[] array = new PropValue[momtPva.Length]; for (int i = 0; i < momtPva.Length; i++) { array[i] = PstMailbox.PvFromMoMTPv(momtPva[i]); } return(array); }
private void UpdatePropCollection() { var tmpList = new List <PropValueInfo>(); if (EditingTask.TaskTypeID > 0) { var props = Context.taskWork.GetAllProperties(EditingTask.TaskTypeID); foreach (var prop in props) { int parentListTaskID = 0; List <ListsValue> listValues = new List <ListsValue>(); //если тип список, который тянется от родителя, нужно найти этого родителя и значения if (prop.DataType == 5 && prop.ListType == true) { if (EditingTreeNodeParent == null) { continue; } var parentNode = EditingTreeNodeParent; while (parentNode != null && parentNode.Task.TaskTypeID != prop.TaskTypeID) { parentNode = parentNode.ParentNode; } if (parentNode == null) { MessageBox.Show($"Ошибка! У свойства {prop.PropName} не найден родитель с типом задачи Заказчик, из которого подгружается список. Данные свойства не будут отображены", "Ошибка", MessageBoxButton.OK, MessageBoxImage.Warning); continue; } parentListTaskID = parentNode.Task.ID; listValues = Context.listWork.GetListValues(parentListTaskID, (int)prop.ListID); } var propWithValue = EditingTask.PropValues.FirstOrDefault(pval => pval.Property == prop); var propValInfo = new PropValueInfo(propWithValue, parentListTaskID, listValues); if (propWithValue != null) { tmpList.Add(propValInfo); } else { PropValue pv = new PropValue(); pv.Property = prop; pv.PropID = prop.ID; pv.TaskID = EditingTask.ID; pv.DataType = prop.DataType; propValInfo = new PropValueInfo(pv, parentListTaskID, listValues); if (EditingTask.TaskTypeID == TaskTypesCb.First(t => t.TypeName.ToLower() == "обращение").ID&& EditingTask.ParentTaskID != null && prop.PropName.ToLower() == "номер обращения") { pv.ValueInt = Context.procedureWork.GetLastAppealNumber((int)EditingTask.ParentTaskID) + 1; } tmpList.Add(propValInfo); } } } PropValuesCollection = tmpList; }
internal override Restriction GetRestriction() { PropValue[] array = new PropValue[this.PropValues.Length]; for (int i = 0; i < this.PropValues.Length; i++) { array[i] = DataConverter <PropValueConverter, PropValue, PropValueData> .GetNative(this.PropValues[i]); } return(Restriction.Comment(base.GetRestrictions()[0], array)); }
public static RowEntry Update(long memberId, int rights) { PropValue[] propValues = new PropValue[] { new PropValue(PropTag.MemberId, memberId), new PropValue(PropTag.MemberRights, rights) }; return(RowEntry.Modify(propValues)); }
public static RowEntry Add(byte[] memberEntryId, int rights) { PropValue[] propValues = new PropValue[] { new PropValue(PropTag.EntryId, memberEntryId), new PropValue(PropTag.MemberRights, rights) }; return(RowEntry.Add(propValues)); }
public static DateTime GetLastLogonTime(PropValue[] propvalueArray) { PropValue mailboxProperty = MailboxTableQuery.GetMailboxProperty(propvalueArray, PropTag.LastLogonTime); if (mailboxProperty.PropType != PropType.SysTime) { return(DateTime.MinValue); } return(mailboxProperty.GetDateTime()); }
public GoodsProp(long id, Goods goods, PropName propName, PropValue propValue) { Id = id; GoodsId = goods.Id; Goods = goods; PropNameId = propName.Id; PropName = propName; PropValueId = propValue.Id; PropValue = propValue; }
// Token: 0x0600135B RID: 4955 RVA: 0x00070C94 File Offset: 0x0006EE94 public override void AddPropertyValue(ADRawEntry adRawEntry, PropRow propRow, OABFileRecord oabFileRecord, int index) { PropValue propValue = propRow.Properties[index]; if (propValue.IsError() || propValue.Value == null) { return; } this.AddPropTagToTruncatedPropertiesProperty(oabFileRecord); }
public override void RunNow(Guid mailboxGuid, string parameters) { StoreMailboxData mailboxData; using (ExRpcAdmin exRpcAdmin = ExRpcAdmin.Create("Client=TBA", null, null, null, null)) { try { PropValue[][] mailboxTableInfo = exRpcAdmin.GetMailboxTableInfo(base.DatabaseInfo.Guid, mailboxGuid, new PropTag[] { PropTag.MailboxType, PropTag.PersistableTenantPartitionHint, PropTag.LastLogonTime }); if (mailboxTableInfo.Length != 1 || mailboxTableInfo[0].Length < 1) { throw new InvalidOperationException("Failed to get the mailbox property"); } PropValue mailboxProperty = MailboxTableQuery.GetMailboxProperty(mailboxTableInfo[0], PropTag.PersistableTenantPartitionHint); TenantPartitionHint tenantPartitionHint = null; if (mailboxProperty.PropTag == PropTag.PersistableTenantPartitionHint) { byte[] bytes = mailboxProperty.GetBytes(); if (bytes != null && bytes.Length != 0) { tenantPartitionHint = TenantPartitionHint.FromPersistablePartitionHint(bytes); } } if (string.IsNullOrEmpty(parameters)) { MailboxInformation mailboxInformation = MailboxInformation.Create(mailboxGuid.ToByteArray(), base.DatabaseInfo.Guid, mailboxGuid.ToString(), ControlData.Empty, mailboxTableInfo[0], MailboxInformation.GetLastLogonTime(mailboxTableInfo[0]), tenantPartitionHint); mailboxData = mailboxInformation.MailboxData; } else { mailboxData = new MailboxDataForDemandJob(mailboxGuid, base.DatabaseInfo.Guid, null, parameters, tenantPartitionHint); } } catch (MapiExceptionNotFound arg) { ExTraceGlobals.TimeBasedDatabaseDriverTracer.TraceDebug <TimeBasedStoreDatabaseDriver, MapiExceptionNotFound>((long)this.GetHashCode(), "{0}: Mailbox does not exist on the store: {1}", this, arg); if (string.IsNullOrEmpty(parameters)) { mailboxData = new StoreMailboxData(mailboxGuid, base.DatabaseInfo.Guid, mailboxGuid.ToString(), null); } else { mailboxData = new MailboxDataForDemandJob(mailboxGuid, base.DatabaseInfo.Guid, null, parameters); } } } ExTraceGlobals.TimeBasedDatabaseDriverTracer.TraceDebug <TimeBasedStoreDatabaseDriver, Guid>((long)this.GetHashCode(), "{0}: RunNow: about to start processing mailbox {1} on this database.", this, mailboxGuid); base.RunNow(mailboxData); }