private RoutingTypeOptionsData QueryOptionsData(MailboxSession session, string routingType)
        {
            Util.ThrowOnNullArgument(routingType, "routingType");
            int num = routingType.IndexOf('=');

            if (num >= 0)
            {
                routingType = routingType.Substring(0, num);
            }
            if (routingType == string.Empty)
            {
                throw new ArgumentException("routingType");
            }
            int        lcid = session.PreferedCulture.LCID;
            ADObjectId descendantId;

            if (string.CompareOrdinal(routingType, "EX") == 0)
            {
                descendantId = base.Id.GetDescendantId(new ADObjectId(string.Format("CN=Exchange,CN={0:X},CN={1}", lcid, "Display-Templates")));
            }
            else
            {
                descendantId = base.Id.GetDescendantId(new ADObjectId(string.Format("CN={0},CN={1:X},CN={2}", routingType, lcid, "Address-Templates")));
            }
            AddressTemplate        addressTemplate = base.ConfigSession.Read <AddressTemplate>(descendantId);
            RoutingTypeOptionsData result;

            if (addressTemplate != null)
            {
                ADRawEntry adrawEntry = base.ConfigSession.ReadADRawEntry(addressTemplate.Id, new ADPropertyDefinition[]
                {
                    AddressTemplateSchema.PerMsgDialogDisplayTable,
                    AddressTemplateSchema.PerRecipDialogDisplayTable,
                    DetailsTemplateSchema.HelpFileName,
                    DetailsTemplateSchema.HelpData32
                });
                byte[] messageData   = adrawEntry[AddressTemplateSchema.PerMsgDialogDisplayTable] as byte[];
                byte[] recipientData = adrawEntry[AddressTemplateSchema.PerRecipDialogDisplayTable] as byte[];
                byte[] helpFileName  = adrawEntry[DetailsTemplateSchema.HelpFileName] as byte[];
                byte[] helpFileData  = adrawEntry[DetailsTemplateSchema.HelpData32] as byte[];
                result = new RoutingTypeOptionsData(messageData, recipientData, helpFileName, helpFileData);
            }
            else
            {
                result = default(RoutingTypeOptionsData);
            }
            return(result);
        }
Example #2
0
        private string GetAddressFileContent()
        {
            var addressTemplate = new AddressTemplate(_segmentManager);

            return(addressTemplate.TransformText());
        }