コード例 #1
0
        // Token: 0x060000BF RID: 191 RVA: 0x00006CF0 File Offset: 0x00004EF0
        protected override void RenderContents(TextWriter writer, RecipientWellType type, RecipientWellNode.RenderFlags flags)
        {
            if (!this.HasRecipients(type))
            {
                return;
            }
            AdRecipientBatchQuery     adRecipientBatchQuery = new AdRecipientBatchQuery(this.GetRecipientCollection(type), this.UserContext);
            IEnumerator <Participant> recipientCollection   = this.GetRecipientCollection(type);

            RecipientWellNode.RenderFlags renderFlags = flags & ~RecipientWellNode.RenderFlags.RenderCommas;
            bool flag = true;
            RecipientItemType recipientItemType = ItemRecipientWell.GetRecipientItemType(type);
            bool isWebPartRequest = OwaContext.Current.UserContext.IsWebPartRequest;
            int  num = 0;

            while (recipientCollection.MoveNext())
            {
                Participant            participant                = recipientCollection.Current;
                int                    recipientFlags             = 0;
                ADObjectId             adObjectId                 = null;
                int                    readItemType               = 1;
                string                 smtpAddressAndADObjectInfo = ItemRecipientWell.GetSmtpAddressAndADObjectInfo(participant, adRecipientBatchQuery, out adObjectId, out recipientFlags, out readItemType);
                StoreObjectId          storeObjectId              = null;
                StoreParticipantOrigin storeParticipantOrigin     = participant.Origin as StoreParticipantOrigin;
                if (storeParticipantOrigin != null)
                {
                    storeObjectId = storeParticipantOrigin.OriginItemId;
                }
                string idString = ItemRecipientWell.BuildRecipientIdString(recipientItemType, num++);
                if (RecipientWellNode.Render(this.UserContext, writer, participant.DisplayName, smtpAddressAndADObjectInfo, participant.EmailAddress, participant.RoutingType, RecipientAddress.ToAddressOrigin(participant), recipientFlags, readItemType, recipientItemType, adObjectId, storeObjectId, renderFlags, idString, isWebPartRequest) && flag)
                {
                    flag = false;
                    if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
                    {
                        renderFlags |= RecipientWellNode.RenderFlags.RenderCommas;
                    }
                }
            }
        }
コード例 #2
0
        // Token: 0x060003A4 RID: 932 RVA: 0x00020A9C File Offset: 0x0001EC9C
        internal static bool Render(UserContext userContext, TextWriter writer, string displayName, string smtpAddress, string routingAddress, string routingType, AddressOrigin addressOrigin, int recipientFlags, int readItemType, RecipientItemType recipientWell, ADObjectId adObjectId, StoreObjectId storeObjectId, RecipientWellNode.RenderFlags flags, string idString, bool isWebPartRequest)
        {
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            bool flag  = (flags & RecipientWellNode.RenderFlags.ReadOnly) != RecipientWellNode.RenderFlags.None;
            bool flag2 = false;

            if (string.CompareOrdinal(routingType, "MAPIPDL") != 0 && (string.IsNullOrEmpty(routingAddress) || string.IsNullOrEmpty(routingType)))
            {
                if (string.IsNullOrEmpty(displayName))
                {
                    ExTraceGlobals.MailDataTracer.TraceDebug(0L, "Found recipient without an email address or display name");
                    return(false);
                }
                flag2          = true;
                routingAddress = null;
                smtpAddress    = null;
                routingType    = null;
            }
            else if (string.IsNullOrEmpty(displayName))
            {
                if (!string.IsNullOrEmpty(smtpAddress))
                {
                    displayName = smtpAddress;
                }
                else if (!string.IsNullOrEmpty(routingAddress))
                {
                    displayName = routingAddress;
                }
            }
            if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
            {
                writer.Write("; ");
            }
            writer.Write("<span class=\"");
            if (flag2)
            {
                writer.Write("rwURO\">");
                if (displayName != null)
                {
                    Utilities.HtmlEncode(displayName, writer);
                }
            }
            else
            {
                writer.Write("rwRO");
                if ((recipientFlags & 1) != 0)
                {
                    writer.Write(" rwDL");
                }
                writer.Write("\">");
            }
            bool flag3 = false;

            if (!string.IsNullOrEmpty(idString))
            {
                if ((userContext.IsFeatureEnabled(Feature.Contacts) && storeObjectId != null) || adObjectId != null)
                {
                    writer.Write("<a href=\"#\"");
                    if (storeObjectId != null)
                    {
                        writer.Write(" id=\"");
                        Utilities.HtmlEncode(storeObjectId.ToBase64String(), writer);
                    }
                    else if (adObjectId != null)
                    {
                        writer.Write(" id=\"");
                        Utilities.HtmlEncode(Utilities.GetBase64StringFromADObjectId(adObjectId), writer);
                    }
                    writer.Write("\" onClick=\"return onClkRcpt(this,{0}", readItemType);
                    if (!flag)
                    {
                        writer.Write(",{0}", (int)recipientWell);
                    }
                    writer.Write(");\">");
                    flag3 = true;
                }
                else if (routingType == "SMTP" && !string.IsNullOrEmpty(smtpAddress) && flag && !isWebPartRequest)
                {
                    writer.Write("<a href=\"");
                    Utilities.HtmlEncode("?ae=Item&t=IPM.Note&a=New&to=", writer);
                    Utilities.HtmlEncode(Utilities.UrlEncode(smtpAddress), writer);
                    if (!string.IsNullOrEmpty(displayName))
                    {
                        Utilities.HtmlEncode("&nm=", writer);
                        Utilities.HtmlEncode(Utilities.UrlEncode(displayName), writer);
                    }
                    writer.Write("\" class=\"emadr\">");
                    flag3 = true;
                }
            }
            if (!flag2)
            {
                if (displayName != null)
                {
                    Utilities.HtmlEncode(displayName, writer);
                }
                RecipientWellNode.RenderFormattedAddress(writer, displayName, smtpAddress, routingAddress, routingType);
            }
            if (flag3)
            {
                writer.Write("</a>");
            }
            if (!flag && !string.IsNullOrEmpty(idString))
            {
                writer.Write(" <span class=\"sq\">[<a href=\"#\" onClick=\"return onClkRmRcp('");
                writer.Write(idString);
                writer.Write("')\">");
                writer.Write(LocalizedStrings.GetHtmlEncoded(341226654));
                writer.Write("</a>]</span>");
            }
            writer.Write("</span>");
            return(true);
        }
コード例 #3
0
 // Token: 0x060000B0 RID: 176 RVA: 0x000068A0 File Offset: 0x00004AA0
 public static void ResolveRecipients(string chunk, ArrayList wellNodes, UserContext userContext, bool resolveAgainstContactsFirst)
 {
     if (chunk == null)
     {
         throw new ArgumentNullException("chunk");
     }
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     string[] array = Utilities.ParseRecipientChunk(chunk);
     if (array != null)
     {
         RecipientCache recipientCache = AutoCompleteCache.TryGetCache(OwaContext.Current.UserContext);
         for (int i = 0; i < array.Length; i++)
         {
             string text = array[i].Trim();
             if (text.Length > 0)
             {
                 RecipientAddress  recipientAddress  = AnrManager.ResolveAnrString(text, resolveAgainstContactsFirst, userContext);
                 RecipientWellNode recipientWellNode = new RecipientWellNode(text, null);
                 if (recipientAddress != null)
                 {
                     recipientWellNode.DisplayName       = recipientAddress.DisplayName;
                     recipientWellNode.SmtpAddress       = recipientAddress.SmtpAddress;
                     recipientWellNode.AddressOrigin     = recipientAddress.AddressOrigin;
                     recipientWellNode.RoutingAddress    = recipientAddress.RoutingAddress;
                     recipientWellNode.RoutingType       = recipientAddress.RoutingType;
                     recipientWellNode.RecipientFlags    = recipientAddress.RecipientFlags;
                     recipientWellNode.StoreObjectId     = recipientAddress.StoreObjectId;
                     recipientWellNode.ADObjectId        = recipientAddress.ADObjectId;
                     recipientWellNode.EmailAddressIndex = recipientAddress.EmailAddressIndex;
                 }
                 if ((recipientWellNode.RoutingAddress != null || Utilities.IsMapiPDL(recipientWellNode.RoutingType)) && recipientCache != null)
                 {
                     string itemId = string.Empty;
                     if (recipientWellNode.AddressOrigin == AddressOrigin.Store && recipientWellNode.StoreObjectId != null)
                     {
                         itemId = recipientWellNode.StoreObjectId.ToBase64String();
                     }
                     else if (recipientWellNode.AddressOrigin == AddressOrigin.Directory && recipientWellNode.ADObjectId != null)
                     {
                         itemId = Convert.ToBase64String(recipientWellNode.ADObjectId.ObjectGuid.ToByteArray());
                     }
                     if (string.IsNullOrEmpty(recipientWellNode.DisplayName))
                     {
                         recipientWellNode.DisplayName = recipientWellNode.SmtpAddress;
                     }
                     if (userContext.UserOptions.AddRecipientsToAutoCompleteCache)
                     {
                         recipientCache.AddEntry(recipientWellNode.DisplayName, recipientWellNode.SmtpAddress, recipientWellNode.RoutingAddress, string.Empty, recipientWellNode.RoutingType, recipientWellNode.AddressOrigin, recipientWellNode.RecipientFlags, itemId, recipientWellNode.EmailAddressIndex);
                     }
                 }
                 if (wellNodes != null)
                 {
                     wellNodes.Add(recipientWellNode);
                 }
             }
         }
         if (recipientCache != null && recipientCache.IsDirty)
         {
             recipientCache.Commit(true);
         }
     }
 }