Exemple #1
0
 protected static bool ShouldColumnHaveAnchor(ColumnId columnId)
 {
     if (ListViewContents2.columnsWithAnchorsMap == null)
     {
         ListViewContents2.InitializeColumnsWithAnchorsMap();
     }
     return(ListViewContents2.columnsWithAnchorsMap[(int)columnId]);
 }
Exemple #2
0
        protected ListViewContents2 CreateGroupByList(ListViewContents2 originalContents)
        {
            Column column = ListViewColumns.GetColumn(this.SortedColumn);

            if (column.GroupType == GroupType.Expanded)
            {
                return(new GroupByList2(this.sortedColumn, this.sortOrder, (ItemList2)originalContents, this.userContext));
            }
            return(originalContents);
        }
Exemple #3
0
        protected bool RenderColumn(TextWriter writer, ColumnId columnId, bool nonBreakingSpaceOnEmpty)
        {
            bool flag;

            using (StringWriter stringWriter = new StringWriter())
            {
                flag = this.InternalRenderColumn(stringWriter, columnId);
                bool flag2 = ListViewContents2.ShouldColumnHaveAnchor(columnId) && !string.IsNullOrEmpty(stringWriter.ToString());
                if (flag2)
                {
                    this.RenderVLVAnchorOpen(writer);
                }
                writer.Write(stringWriter.ToString());
                if (!flag && nonBreakingSpaceOnEmpty)
                {
                    writer.Write(" ");
                }
                if (flag2)
                {
                    this.RenderVLVAnchorClose(writer);
                }
            }
            return(flag);
        }
Exemple #4
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);
        }