Пример #1
0
 // Token: 0x06002520 RID: 9504 RVA: 0x000D6C78 File Offset: 0x000D4E78
 public void Render(TextWriter writer, UserContext userContext, RecipientWellNode.RenderFlags flags)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     RecipientWellNode.Render(writer, userContext, this.displayName, this.smtpAddress, this.routingAddress, this.routingType, this.alias, this.addressOrigin, this.recipientFlags, this.storeObjectId, this.emailAddressIndex, this.adObjectId, flags, this.sipUri, this.mobilePhoneNumber);
 }
Пример #2
0
 // Token: 0x06002523 RID: 9507 RVA: 0x000D6DDC File Offset: 0x000D4FDC
 internal new static bool Render(TextWriter writer, UserContext userContext, string displayName, string smtpAddress, string routingAddress, string routingType, string alias, AddressOrigin addressOrigin, int recipientFlags, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex, ADObjectId adObjectId, RecipientWellNode.RenderFlags flags, string sipUri, string mobilePhoneNumber)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     if (string.IsNullOrEmpty(routingAddress) || string.IsNullOrEmpty(routingType))
     {
         if (string.IsNullOrEmpty(displayName))
         {
             ExTraceGlobals.CoreTracer.TraceDebug(0L, "Found recipient without an email address or display name");
             return(false);
         }
         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("; ");
     }
     if (displayName != null)
     {
         Utilities.HtmlEncode(displayName.Trim(new char[]
         {
             '\''
         }), writer);
     }
     RecipientWellNode.RenderFormattedAddress(writer, userContext, displayName, smtpAddress, routingAddress, routingType);
     return(true);
 }
 // Token: 0x06001E91 RID: 7825 RVA: 0x000B01D0 File Offset: 0x000AE3D0
 internal static void ResolveAndRenderChunk(TextWriter writer, string chunk, ArrayList wellNodes, RecipientCache recipientCache, UserContext userContext, AnrManager.Options options)
 {
     if (writer == null)
     {
         throw new ArgumentNullException("writer");
     }
     if (chunk == null)
     {
         throw new ArgumentNullException("chunk");
     }
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     writer.Write("<div id=\"chk\">");
     string[] array = Utilities.ParseRecipientChunk(chunk);
     if (array != null)
     {
         for (int i = 0; i < array.Length; i++)
         {
             string text = array[i].Trim();
             if (text.IndexOf(Globals.HtmlDirectionCharacterString, StringComparison.Ordinal) != -1)
             {
                 text = Utilities.RemoveHTMLDirectionCharacters(text);
             }
             if (text.Length > 0)
             {
                 RecipientAddress  recipientAddress  = AnrManager.ResolveAnrString(text, options, 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.EmailAddressIndex = recipientAddress.EmailAddressIndex;
                     recipientWellNode.ADObjectId        = recipientAddress.ADObjectId;
                     recipientWellNode.SipUri            = recipientAddress.SipUri;
                     recipientWellNode.MobilePhoneNumber = recipientAddress.MobilePhoneNumber;
                 }
                 if ((recipientWellNode.RoutingAddress != null || Utilities.IsMapiPDL(recipientWellNode.RoutingType)) && recipientCache != null)
                 {
                     string itemId = string.Empty;
                     if (recipientWellNode.StoreObjectId != null)
                     {
                         itemId = recipientWellNode.StoreObjectId.ToBase64String();
                     }
                     else if (recipientWellNode.ADObjectId != null)
                     {
                         itemId = Convert.ToBase64String(recipientWellNode.ADObjectId.ObjectGuid.ToByteArray());
                     }
                     recipientCache.AddEntry(recipientWellNode.DisplayName, recipientWellNode.SmtpAddress, recipientWellNode.RoutingAddress, string.Empty, recipientWellNode.RoutingType, recipientWellNode.AddressOrigin, recipientWellNode.RecipientFlags, itemId, recipientWellNode.EmailAddressIndex, recipientWellNode.SipUri, recipientWellNode.MobilePhoneNumber);
                 }
                 recipientWellNode.Render(writer, userContext, RecipientWellNode.RenderFlags.RenderSkinnyHtml);
                 if (wellNodes != null)
                 {
                     wellNodes.Add(recipientWellNode);
                 }
             }
         }
     }
     writer.Write("</div>");
 }
Пример #4
0
        // Token: 0x0600251F RID: 9503 RVA: 0x000D67BC File Offset: 0x000D49BC
        internal static bool Render(TextWriter writer, UserContext userContext, string displayName, string smtpAddress, string routingAddress, string routingType, string alias, AddressOrigin addressOrigin, int recipientFlags, StoreObjectId storeObjectId, EmailAddressIndex emailAddressIndex, ADObjectId adObjectId, RecipientWellNode.RenderFlags flags, string sipUri, string mobilePhoneNumber)
        {
            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (string.CompareOrdinal(routingType, "SMTP") == 0 && ImceaAddress.IsImceaAddress(routingAddress) && Utilities.TryDecodeImceaAddress(routingAddress, ref routingType, ref routingAddress))
            {
                smtpAddress = null;
            }
            bool   flag  = (flags & RecipientWellNode.RenderFlags.ReadOnly) != RecipientWellNode.RenderFlags.None;
            bool   flag2 = false;
            string text  = "rwRR";

            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);
                }
                text           = "rwUR";
                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 (flag)
            {
                text = (flag2 ? "rwURO" : "rwRRO");
            }
            if ((recipientFlags & 1) != 0)
            {
                text += " rwDL";
            }
            if ((flags & RecipientWellNode.RenderFlags.RenderCommas) != RecipientWellNode.RenderFlags.None)
            {
                writer.Write(userContext.DirectionMark);
                writer.Write("; ");
            }
            if ((flags & RecipientWellNode.RenderFlags.RenderSkinnyHtml) != RecipientWellNode.RenderFlags.None)
            {
                if (!flag)
                {
                    writer.Write("<span>");
                }
                writer.Write("<span class=\"");
            }
            else if (flag)
            {
                writer.Write("<span id=\"spnR\" ");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "oncontextmenu", "onRwCm(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "ondblclick", "onDblClkReadRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onclick", "onClkRcp(event);");
                writer.Write(" class=\"");
            }
            else
            {
                writer.Write("<span tabindex=\"-1\" contenteditable=\"false\">");
                if (userContext.BrowserType == BrowserType.IE)
                {
                    writer.Write("<span tabindex=\"-1\" contenteditable=\"true\" id=\"spnR\" ");
                }
                else
                {
                    writer.Write("<span tabindex=\"-1\" contenteditable=\"false\" id=\"spnR\" ");
                }
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "oncontextmenu", "onContextMenuSpnRw(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onclick", "onClkRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "onkeydown", "onKDRcp(event);");
                writer.Write(" ");
                Utilities.RenderScriptHandler(writer, "ondblclick", "onDblClkRcp(event);");
                writer.Write(" ondrop=\"return(false);\" class=\"");
            }
            writer.Write(text);
            writer.Write("\" _ao=\"{0}\" _rf=\"{1}\" _rt=\"", (int)addressOrigin, recipientFlags);
            if (routingType != null)
            {
                Utilities.SanitizeHtmlEncode(routingType, writer);
            }
            writer.Write("\" _em=\"");
            if (routingAddress != null)
            {
                Utilities.SanitizeHtmlEncode(routingAddress, writer);
            }
            if (storeObjectId != null)
            {
                writer.Write("\" _id=\"");
                Utilities.SanitizeHtmlEncode(storeObjectId.ToBase64String(), writer);
                writer.Write("\" _ei=\"");
                writer.Write((int)emailAddressIndex);
            }
            else if (adObjectId != null)
            {
                writer.Write("\" _id=\"");
                Utilities.SanitizeHtmlEncode(Convert.ToBase64String(adObjectId.ObjectGuid.ToByteArray()), writer);
            }
            writer.Write("\" title=\"");
            if (smtpAddress != null)
            {
                Utilities.SanitizeHtmlEncode(smtpAddress, writer);
            }
            if (!flag || addressOrigin == AddressOrigin.OneOff || (addressOrigin == AddressOrigin.Directory && !userContext.IsFeatureEnabled(Feature.GlobalAddressList)))
            {
                if (smtpAddress != null)
                {
                    writer.Write("\" _sa=\"");
                    Utilities.SanitizeHtmlEncode(smtpAddress, writer);
                }
                else if (routingType != null && routingAddress != null)
                {
                    writer.Write("\" _imcea=\"");
                    Utilities.SanitizeHtmlEncode(ImceaAddress.Encode(routingType, routingAddress, OwaConfigurationManager.Configuration.DefaultAcceptedDomain.DomainName.ToString()), writer);
                }
            }
            if (userContext.IsInstantMessageEnabled() && userContext.InstantMessagingType == InstantMessagingTypeOptions.Ocs && sipUri != null)
            {
                writer.Write("\" ");
                if (adObjectId == null)
                {
                    writer.Write("_sipTrsp=1 ");
                }
                writer.Write("_uri=\"");
                Utilities.SanitizeHtmlEncode(sipUri, writer);
            }
            if (userContext.IsSmsEnabled && mobilePhoneNumber != null)
            {
                writer.Write("\" _mo=\"");
                Utilities.SanitizeHtmlEncode(mobilePhoneNumber, writer);
            }
            if ((smtpAddress != null || routingAddress != null || mobilePhoneNumber != null || Utilities.IsMapiPDL(routingType)) && (!flag || addressOrigin == AddressOrigin.OneOff || (addressOrigin == AddressOrigin.Store && (!userContext.IsFeatureEnabled(Feature.Contacts) || userContext.IsSmsEnabled)) || (addressOrigin == AddressOrigin.Directory && (!userContext.IsFeatureEnabled(Feature.GlobalAddressList) || userContext.IsSmsEnabled))) && displayName != null)
            {
                writer.Write("\" _dn=\"");
                Utilities.SanitizeHtmlEncode(displayName, writer);
            }
            if (!flag && alias != null)
            {
                writer.Write("\" _al=\"");
                Utilities.SanitizeHtmlEncode(alias, writer);
            }
            writer.Write("\">");
            if (userContext.IsInstantMessageEnabled() && flag && !string.IsNullOrEmpty(routingType) && ((string.CompareOrdinal(routingType, "EX") == 0 && (recipientFlags & 1) == 0) || string.CompareOrdinal(routingType, "SMTP") == 0))
            {
                RenderingUtilities.RenderPresenceJellyBean(writer, userContext, true, "onRwCmJb(event);", false, null);
            }
            if (displayName != null)
            {
                Utilities.SanitizeHtmlEncode(displayName, writer);
            }
            RecipientWellNode.RenderFormattedAddress(writer, userContext, displayName, smtpAddress, routingAddress, routingType);
            writer.Write("</span>");
            if (!flag)
            {
                writer.Write("</span>");
            }
            return(true);
        }