Exemplo n.º 1
0
        // Token: 0x06001D79 RID: 7545 RVA: 0x000AA7A0 File Offset: 0x000A89A0
        private string GetUri()
        {
            if (!this.IsContactView)
            {
                ProxyAddressCollection itemProperty = this.DataSource.GetItemProperty <ProxyAddressCollection>(ADRecipientSchema.EmailAddresses, null);
                string text = InstantMessageUtilities.GetSipUri(itemProperty);
                if (string.IsNullOrEmpty(text))
                {
                    text = InstantMessageUtilities.ToSipFormat(this.DataSource.GetItemProperty <SmtpAddress>(ADRecipientSchema.PrimarySmtpAddress, SmtpAddress.Empty).ToString());
                }
                return(text);
            }
            string itemProperty2 = this.DataSource.GetItemProperty <string>(ContactSchema.IMAddress, string.Empty);

            if (!string.IsNullOrEmpty(itemProperty2))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty2));
            }
            Participant itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email1, null);

            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email2, null);
            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            itemProperty3 = this.DataSource.GetItemProperty <Participant>(ContactSchema.Email3, null);
            if (itemProperty3 != null && !string.IsNullOrEmpty(itemProperty3.EmailAddress))
            {
                return(InstantMessageUtilities.ToSipFormat(itemProperty3.EmailAddress));
            }
            return(string.Empty);
        }
Exemplo n.º 2
0
        // Token: 0x06001D6C RID: 7532 RVA: 0x000AA120 File Offset: 0x000A8320
        private string GetEmailRenderedAsIMAddress(string email, string explicitIMAddress, string mobilePhoneNumber)
        {
            email = base.RemoveVLVAnchors(email);
            if (string.IsNullOrEmpty(explicitIMAddress))
            {
                explicitIMAddress = email;
            }
            string result;

            using (StringWriter stringWriter = new StringWriter())
            {
                base.RenderVLVAnchorOpen(stringWriter);
                stringWriter.Write(InstantMessageUtilities.GetSingleEmailAddress(this.DataSource, email, email, email, null, EmailAddressIndex.None, RecipientAddress.RecipientAddressFlags.None, null, InstantMessageUtilities.ToSipFormat(explicitIMAddress), mobilePhoneNumber, false));
                base.RenderVLVAnchorClose(stringWriter);
                result = stringWriter.ToString();
            }
            return(result);
        }
Exemplo n.º 3
0
        private bool RenderEmailAddresses(TextWriter writer)
        {
            Dictionary <EmailAddressIndex, StorePropertyDefinition> dictionary  = new Dictionary <EmailAddressIndex, StorePropertyDefinition>();
            Dictionary <EmailAddressIndex, Participant>             dictionary2 = new Dictionary <EmailAddressIndex, Participant>();

            dictionary.Add(EmailAddressIndex.Email1, ContactSchema.Email1);
            dictionary.Add(EmailAddressIndex.Email2, ContactSchema.Email2);
            dictionary.Add(EmailAddressIndex.Email3, ContactSchema.Email3);
            dictionary.Add(EmailAddressIndex.BusinessFax, ContactSchema.ContactBusinessFax);
            dictionary.Add(EmailAddressIndex.HomeFax, ContactSchema.ContactHomeFax);
            dictionary.Add(EmailAddressIndex.OtherFax, ContactSchema.ContactOtherFax);
            EmailAddressIndex emailAddressIndex = EmailAddressIndex.None;

            foreach (KeyValuePair <EmailAddressIndex, StorePropertyDefinition> keyValuePair in dictionary)
            {
                Participant itemProperty = this.dataSource.GetItemProperty <Participant>(keyValuePair.Value, null);
                if (itemProperty != null && !string.IsNullOrEmpty(itemProperty.EmailAddress))
                {
                    emailAddressIndex = keyValuePair.Key;
                    dictionary2.Add(keyValuePair.Key, itemProperty);
                }
            }
            string itemProperty2 = this.dataSource.GetItemProperty <string>(ContactSchema.IMAddress, null);
            bool   flag          = string.IsNullOrEmpty(itemProperty2) || itemProperty2.Trim().Length == 0;
            string text          = null;
            string text2         = null;
            string text3         = null;
            string text4         = null;
            string text5         = Utilities.NormalizePhoneNumber(this.dataSource.GetItemProperty <string>(ContactSchema.MobilePhone, null));

            if (dictionary2.Count > 1)
            {
                bool flag2 = false;
                bool flag3 = !string.IsNullOrEmpty(text5);
                writer.Write("<select id=\"ea\">");
                foreach (KeyValuePair <EmailAddressIndex, Participant> keyValuePair2 in dictionary2)
                {
                    Participant value = keyValuePair2.Value;
                    if (value != null && !string.IsNullOrEmpty(value.EmailAddress))
                    {
                        ListViewContents2.GetEmailAddressData(value, out text, out text2, out text3, out text4);
                        writer.Write("<option aO=1 dn=\"");
                        Utilities.HtmlEncode(text3, writer);
                        writer.Write("\" rt=\"");
                        if (string.IsNullOrEmpty(text4))
                        {
                            writer.Write("SMTP");
                        }
                        else
                        {
                            writer.Write(text4);
                        }
                        writer.Write("\" rf=\"");
                        writer.Write(0);
                        writer.Write("\" em=\"");
                        Utilities.HtmlEncode(text, writer);
                        writer.Write("\" ei=\"");
                        writer.Write((int)keyValuePair2.Key);
                        if (!flag2)
                        {
                            string imAddress = flag ? text : itemProperty2;
                            writer.Write("\" uri=\"");
                            Utilities.HtmlEncode(InstantMessageUtilities.ToSipFormat(imAddress), writer);
                            flag2 = true;
                        }
                        if (flag3)
                        {
                            writer.Write("\" mo=\"");
                            Utilities.HtmlEncode(text5, writer);
                            flag3 = false;
                        }
                        writer.Write("\">");
                        Utilities.HtmlEncode(text2, writer);
                        writer.Write("</option>");
                    }
                }
                writer.Write("</select>");
            }
            else
            {
                if (dictionary2.Count != 1)
                {
                    return(false);
                }
                Participant participant = dictionary2[emailAddressIndex];
                ListViewContents2.GetEmailAddressData(participant, out text, out text2, out text3, out text4);
                this.RenderSingleEmailAddress(writer, text3, text, text2, string.Empty, emailAddressIndex, RecipientAddress.RecipientAddressFlags.None, text4, InstantMessageUtilities.ToSipFormat(flag ? text : itemProperty2), text5);
            }
            return(true);
        }
        public void DeclineBuddy()
        {
            ExTraceGlobals.OehCallTracer.TraceDebug((long)this.GetHashCode(), "InstantMessageEventHandler.DeclineBuddy");
            this.ThowIfInvalidProvider("DeclineBuddy");
            InstantMessageBuddy instantMessageBuddy = InstantMessageBuddy.Create(string.Empty, InstantMessageUtilities.ToSipFormat((string)base.GetParameter("bdyAddr")), string.Empty);

            if (base.IsParameterSet("iType"))
            {
                instantMessageBuddy.AddressType = (int)base.GetParameter("iType");
            }
            base.UserContext.InstantMessageManager.Provider.DeclineBuddy(instantMessageBuddy);
        }
Exemplo n.º 5
0
        protected virtual bool InternalRenderColumn(TextWriter writer, ColumnId columnId)
        {
            Column column = ListViewColumns.GetColumn(columnId);

            if (columnId <= ColumnId.ADIcon)
            {
                switch (columnId)
                {
                case ColumnId.MailIcon:
                case ColumnId.ContactIcon:
                    break;

                case ColumnId.From:
                case ColumnId.To:
                case ColumnId.Subject:
                case ColumnId.Department:
                    goto IL_68B;

                case ColumnId.HasAttachment:
                {
                    string itemClass    = this.dataSource.GetItemClass();
                    bool   itemProperty = this.dataSource.GetItemProperty <bool>(ItemSchema.HasAttachment, false);
                    return(ListViewContentsRenderingUtilities.RenderHasAttachments(writer, this.userContext, itemProperty, itemClass));
                }

                case ColumnId.Importance:
                    goto IL_17B;

                case ColumnId.DeliveryTime:
                {
                    ExDateTime itemProperty2 = this.dataSource.GetItemProperty <ExDateTime>(ItemSchema.ReceivedTime, ExDateTime.MinValue);
                    return(this.RenderSmartDate(writer, itemProperty2));
                }

                case ColumnId.SentTime:
                {
                    ExDateTime itemProperty3 = this.dataSource.GetItemProperty <ExDateTime>(ItemSchema.SentTime, ExDateTime.MinValue);
                    return(this.RenderSmartDate(writer, itemProperty3));
                }

                case ColumnId.Size:
                {
                    int itemProperty4 = this.dataSource.GetItemProperty <int>(ItemSchema.Size, 0);
                    Utilities.RenderSizeWithUnits(writer, (long)itemProperty4, true);
                    return(true);
                }

                default:
                    switch (columnId)
                    {
                    case ColumnId.EmailAddresses:
                        if (ObjectClass.IsDistributionList(this.dataSource.GetItemClass()))
                        {
                            this.RenderSingleEmailAddress(writer, this.dataSource.GetItemProperty <string>(ContactBaseSchema.FileAs, string.Empty), string.Empty, string.Empty, null, EmailAddressIndex.None, RecipientAddress.RecipientAddressFlags.DistributionList);
                            return(true);
                        }
                        return(this.RenderEmailAddresses(writer));

                    case ColumnId.Email1:
                    case ColumnId.Email2:
                    case ColumnId.Email3:
                        goto IL_428;

                    case ColumnId.GivenName:
                    case ColumnId.Surname:
                    case ColumnId.SharepointDocumentDisplayName:
                    case ColumnId.SharepointDocumentLastModified:
                    case ColumnId.SharepointDocumentModifiedBy:
                    case ColumnId.SharepointDocumentCheckedOutTo:
                    case ColumnId.UncDocumentDisplayName:
                    case ColumnId.UncDocumentLastModified:
                        goto IL_68B;

                    case ColumnId.Categories:
                    case ColumnId.ContactCategories:
                        goto IL_32C;

                    case ColumnId.SharepointDocumentIcon:
                        return(this.RenderSharepointDocumentIcon(writer));

                    case ColumnId.SharepointDocumentFileSize:
                    {
                        long itemProperty5 = this.dataSource.GetItemProperty <long>(SharepointDocumentSchema.FileSize, 0L);
                        Utilities.RenderSizeWithUnits(writer, itemProperty5, true);
                        return(true);
                    }

                    case ColumnId.UncDocumentIcon:
                        return(this.RenderUncDocumentIcon(writer));

                    case ColumnId.UncDocumentLibraryIcon:
                        return(ListViewContentsRenderingUtilities.RenderItemIcon(writer, this.userContext, "ipf.documentlibrary.sharepoint"));

                    case ColumnId.UncDocumentFileSize:
                    {
                        long itemProperty6 = this.dataSource.GetItemProperty <long>(UncDocumentSchema.FileSize, 0L);
                        Utilities.RenderSizeWithUnits(writer, itemProperty6, true);
                        return(true);
                    }

                    case ColumnId.SharepointDocumentLibraryIcon:
                        return(ListViewContentsRenderingUtilities.RenderItemIcon(writer, this.userContext, "ipf.documentlibrary.sharepoint"));

                    default:
                        if (columnId != ColumnId.ADIcon)
                        {
                            goto IL_68B;
                        }
                        break;
                    }
                    break;
                }
            }
            else
            {
                if (columnId == ColumnId.EmailAddressAD)
                {
                    return(this.RenderADEmailAddress(this.dataSource, writer));
                }
                switch (columnId)
                {
                case ColumnId.YomiFullName:
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    string        itemProperty7 = this.dataSource.GetItemProperty <string>(ContactSchema.YomiLastName, string.Empty);
                    if (!string.IsNullOrEmpty(itemProperty7))
                    {
                        Utilities.HtmlEncode(itemProperty7, stringBuilder);
                    }
                    string itemProperty8 = this.dataSource.GetItemProperty <string>(ContactSchema.YomiFirstName, string.Empty);
                    if (!string.IsNullOrEmpty(itemProperty8))
                    {
                        if (stringBuilder.Length > 0)
                        {
                            stringBuilder.Append(" ");
                        }
                        Utilities.HtmlEncode(itemProperty8, stringBuilder);
                    }
                    if (stringBuilder.Length == 0)
                    {
                        return(false);
                    }
                    writer.Write(stringBuilder.ToString());
                    return(true);
                }

                case ColumnId.YomiLastName:
                case ColumnId.YomiDisplayNameAD:
                case ColumnId.YomiDepartmentAD:
                case ColumnId.ResourceCapacityAD:
                case ColumnId.FlagStartDate:
                case ColumnId.ContactFlagStartDate:
                case ColumnId.MemberDisplayName:
                case ColumnId.ConversationLastDeliveryTime:
                case ColumnId.ConversationIcon:
                case ColumnId.ConversationSubject:
                case ColumnId.ConversationUnreadCount:
                case ColumnId.ConversationHasAttachment:
                case ColumnId.ConversationSenderList:
                    goto IL_68B;

                case ColumnId.FlagDueDate:
                case ColumnId.ContactFlagDueDate:
                case ColumnId.TaskFlag:
                {
                    FlagStatus  itemProperty9  = this.dataSource.GetItemProperty <FlagStatus>(ItemSchema.FlagStatus, FlagStatus.NotFlagged);
                    int         itemProperty10 = this.dataSource.GetItemProperty <int>(ItemSchema.ItemColor, int.MinValue);
                    ThemeFileId themeFileId    = ThemeFileId.FlagEmpty;
                    if (itemProperty9 == FlagStatus.NotFlagged)
                    {
                        string itemClass2 = this.dataSource.GetItemClass();
                        if (ObjectClass.IsTask(itemClass2))
                        {
                            bool itemProperty11 = this.dataSource.GetItemProperty <bool>(ItemSchema.IsComplete, false);
                            if (itemProperty11)
                            {
                                themeFileId = (this.IsAssignedTask ? ThemeFileId.FlagCompleteDisabled : ThemeFileId.FlagComplete);
                            }
                            else
                            {
                                themeFileId = (this.IsAssignedTask ? ThemeFileId.FlagDisabled : ThemeFileId.Flag);
                            }
                        }
                    }
                    else if (itemProperty10 == -2147483648 && itemProperty9 == FlagStatus.Flagged)
                    {
                        themeFileId = ThemeFileId.FlagSender;
                    }
                    else if (itemProperty9 == FlagStatus.Flagged)
                    {
                        themeFileId = ThemeFileId.Flag;
                    }
                    else
                    {
                        themeFileId = ThemeFileId.FlagComplete;
                    }
                    this.userContext.RenderThemeImage(writer, themeFileId, null, new object[]
                        {
                            "id=\"imgFlg\""
                        });
                    return(true);
                }

                case ColumnId.TaskIcon:
                case ColumnId.MemberIcon:
                    break;

                case ColumnId.MarkCompleteCheckbox:
                {
                    bool itemProperty12 = this.dataSource.GetItemProperty <bool>(ItemSchema.IsComplete, false);
                    writer.Write("<input id=\"chkMkCmp\" type=checkbox class=\"mkCmp\"");
                    if (this.IsAssignedTask)
                    {
                        writer.Write(" disabled");
                    }
                    writer.Write(itemProperty12 ? " checked>" : ">");
                    return(true);
                }

                case ColumnId.DueDate:
                {
                    ExDateTime itemProperty13 = this.dataSource.GetItemProperty <ExDateTime>(TaskSchema.DueDate, ExDateTime.MinValue);
                    if (itemProperty13 != ExDateTime.MinValue)
                    {
                        writer.Write(itemProperty13.ToString(this.userContext.UserOptions.DateFormat));
                        return(true);
                    }
                    return(false);
                }

                case ColumnId.MemberEmail:
                    goto IL_428;

                case ColumnId.DeletedOnTime:
                {
                    ExDateTime itemProperty14 = this.dataSource.GetItemProperty <ExDateTime>(StoreObjectSchema.LastModifiedTime, ExDateTime.MinValue);
                    return(this.RenderWeekdayDateTime(writer, itemProperty14));
                }

                case ColumnId.DumpsterReceivedTime:
                {
                    ExDateTime itemProperty15 = this.dataSource.GetItemProperty <ExDateTime>(ItemSchema.ReceivedTime, ExDateTime.MinValue);
                    return(this.RenderWeekdayDateTime(writer, itemProperty15));
                }

                case ColumnId.ObjectDisplayName:
                {
                    string itemProperty16 = this.dataSource.GetItemProperty <string>(FolderSchema.DisplayName, string.Empty);
                    if (string.IsNullOrEmpty(itemProperty16))
                    {
                        itemProperty16 = this.dataSource.GetItemProperty <string>(ItemSchema.Subject, string.Empty);
                    }
                    if (itemProperty16.Length == 0)
                    {
                        return(false);
                    }
                    Utilities.HtmlEncode(itemProperty16, writer);
                    return(true);
                }

                case ColumnId.ObjectIcon:
                {
                    VersionedId itemProperty17 = this.dataSource.GetItemProperty <VersionedId>(FolderSchema.Id);
                    if (itemProperty17 != null)
                    {
                        return(ListViewContentsRenderingUtilities.RenderItemIcon(writer, this.userContext, ThemeFileId.Folder));
                    }
                    return(this.RenderIcon(writer));
                }

                case ColumnId.ConversationImportance:
                    goto IL_17B;

                case ColumnId.ConversationCategories:
                    goto IL_32C;

                default:
                {
                    if (columnId != ColumnId.IMAddress)
                    {
                        goto IL_68B;
                    }
                    string itemProperty18    = this.dataSource.GetItemProperty <string>(ContactSchema.IMAddress, string.Empty);
                    string mobilePhoneNumber = Utilities.NormalizePhoneNumber(this.dataSource.GetItemProperty <string>(ContactSchema.MobilePhone, null) ?? this.dataSource.GetItemProperty <string>(ADOrgPersonSchema.MobilePhone, null));
                    if (!string.IsNullOrEmpty(itemProperty18))
                    {
                        this.RenderSingleEmailAddress(writer, itemProperty18, itemProperty18, itemProperty18, null, EmailAddressIndex.None, RecipientAddress.RecipientAddressFlags.None, null, InstantMessageUtilities.ToSipFormat(itemProperty18), mobilePhoneNumber);
                        return(true);
                    }
                    return(false);
                }
                }
            }
            return(this.RenderIcon(writer));

IL_17B:
            Importance importance = Importance.Normal;
            object itemProperty19 = this.dataSource.GetItemProperty <object>(ListViewColumns.GetColumn(columnId)[0]);

            if (itemProperty19 is Importance || itemProperty19 is int)
            {
                importance = (Importance)itemProperty19;
            }
            return(ListViewContentsRenderingUtilities.RenderImportance(writer, this.UserContext, importance));

IL_32C:
            this.RenderCategories(writer, columnId == ColumnId.ConversationCategories);
            return(true);

IL_428:
            PropertyDefinition propertyDefinition = ContactSchema.Email1;

            switch (columnId)
            {
            case ColumnId.Email1:
                break;

            case ColumnId.Email2:
                propertyDefinition = ContactSchema.Email2;
                goto IL_467;

            case ColumnId.Email3:
                propertyDefinition = ContactSchema.Email3;
                goto IL_467;

            default:
                if (columnId != ColumnId.MemberEmail)
                {
                    goto IL_467;
                }
                break;
            }
            propertyDefinition = ContactSchema.Email1;
IL_467:
            Participant itemProperty20 = this.dataSource.GetItemProperty <Participant>(propertyDefinition, null);

            if (itemProperty20 == null)
            {
                return(false);
            }
            string text  = null;
            string text2 = null;

            ContactUtilities.GetParticipantEmailAddress(itemProperty20, out text2, out text);
            if (string.IsNullOrEmpty(text2))
            {
                return(false);
            }
            Utilities.HtmlEncode(text2, writer);
            return(true);

IL_68B:
            object itemProperty21 = this.dataSource.GetItemProperty <object>(column[0]);

            if (itemProperty21 is ExDateTime)
            {
                writer.Write(((ExDateTime)itemProperty21).ToString());
            }
            else if (itemProperty21 is DateTime)
            {
                ExDateTime exDateTime = new ExDateTime(this.userContext.TimeZone, (DateTime)itemProperty21);
                writer.Write(exDateTime.ToString());
            }
            else if (itemProperty21 is string)
            {
                string text3 = (string)itemProperty21;
                if (text3.Length == 0)
                {
                    return(false);
                }
                Utilities.HtmlEncode(text3, writer);
            }
            else if (itemProperty21 is int)
            {
                Utilities.HtmlEncode(((int)itemProperty21).ToString(CultureInfo.CurrentCulture.NumberFormat), writer);
            }
            else if (itemProperty21 is long)
            {
                Utilities.HtmlEncode(((long)itemProperty21).ToString(CultureInfo.CurrentCulture.NumberFormat), writer);
            }
            else if (itemProperty21 is Unlimited <int> )
            {
                if (((Unlimited <int>)itemProperty21).IsUnlimited)
                {
                    return(false);
                }
                Utilities.HtmlEncode(((Unlimited <int>)itemProperty21).Value.ToString(CultureInfo.CurrentCulture.NumberFormat), writer);
            }
            else
            {
                if (itemProperty21 is PropertyError)
                {
                    return(false);
                }
                if (itemProperty21 is PropertyError)
                {
                    return(false);
                }
            }
            return(false);
        }