Esempio n. 1
0
        private void RenderContactAddress(TextWriter writer)
        {
            PhysicalAddressType physicalAddressType = PhysicalAddressType.Business;

            PhysicalAddressType[] array = new PhysicalAddressType[4];
            array[0] = PhysicalAddressType.Business;
            array[1] = PhysicalAddressType.Home;
            array[2] = PhysicalAddressType.Other;
            PhysicalAddressType[] array2 = array;
            object obj = base.Item.TryGetProperty(ContactSchema.PostalAddressId);

            if (obj is int)
            {
                physicalAddressType = (PhysicalAddressType)obj;
            }
            if (physicalAddressType == PhysicalAddressType.Business || physicalAddressType == PhysicalAddressType.Home || physicalAddressType == PhysicalAddressType.Other)
            {
                this.RenderAddress(writer, physicalAddressType, true);
            }
            for (int i = 0; i < array2.Length; i++)
            {
                if (array2[i] != PhysicalAddressType.None && array2[i] != physicalAddressType)
                {
                    this.RenderAddress(writer, array2[i], false);
                }
            }
        }
Esempio n. 2
0
        // Token: 0x06002AAB RID: 10923 RVA: 0x000EFCBC File Offset: 0x000EDEBC
        private void RenderAddressSectionData()
        {
            this.isSectionStarted = false;
            this.sectionHeader    = LocalizedStrings.GetHtmlEncoded(-1159205642);
            this.sectionId        = "spnSAd";
            PhysicalAddressType physicalAddressType = PhysicalAddressType.Business;

            PhysicalAddressType[] array = new PhysicalAddressType[4];
            array[0] = PhysicalAddressType.Business;
            array[1] = PhysicalAddressType.Home;
            array[2] = PhysicalAddressType.Other;
            PhysicalAddressType[] array2 = array;
            object obj = base.Item.TryGetProperty(ContactSchema.PostalAddressId);

            if (obj is int)
            {
                physicalAddressType = (PhysicalAddressType)obj;
            }
            if (physicalAddressType == PhysicalAddressType.Business || physicalAddressType == PhysicalAddressType.Home || physicalAddressType == PhysicalAddressType.Other)
            {
                this.isFirstLine = true;
                this.RenderAddress(physicalAddressType, true);
            }
            for (int i = 0; i < array2.Length; i++)
            {
                if (array2[i] != PhysicalAddressType.None && array2[i] != physicalAddressType)
                {
                    this.RenderAddress(array2[i], false);
                }
            }
        }
        public MailingAddressDropDownList(string id, PhysicalAddressType addressType)
        {
            int num = (int)addressType;

            base..ctor(id, num.ToString(), null);
            this.addressType = addressType;
        }
Esempio n. 4
0
        private void RenderAddress(TextWriter writer, PhysicalAddressType type, bool isMailingAddress)
        {
            IDictionary <AddressFormatTable.AddressPart, AddressComponent> addressInfo = ContactUtilities.GetAddressInfo(base.Item, type);

            if (addressInfo.Count == 0)
            {
                return;
            }
            this.isAddressRendered = true;
            string value = string.Empty;

            switch (type)
            {
            case PhysicalAddressType.Home:
                value = LocalizedStrings.GetHtmlEncoded(1414246315);
                break;

            case PhysicalAddressType.Business:
                value = LocalizedStrings.GetHtmlEncoded(-765825260);
                break;

            case PhysicalAddressType.Other:
                value = LocalizedStrings.GetHtmlEncoded(-582599340);
                break;
            }
            if (isMailingAddress)
            {
                writer.Write("<tr><td colspan=2 class=\"hd lp\">");
                writer.Write(value);
                writer.Write(" <span class=\"brkt\">(");
                writer.Write(LocalizedStrings.GetHtmlEncoded(1912536019));
                writer.Write(")</span></td></tr>");
            }
            else
            {
                writer.Write("<tr><td colspan=2 class=\"hd lp\">");
                writer.Write(value);
                writer.Write("</td></tr>");
            }
            foreach (KeyValuePair <AddressFormatTable.AddressPart, AddressComponent> keyValuePair in addressInfo)
            {
                writer.Write("<tr><td class=\"lbl lp\">");
                writer.Write(keyValuePair.Value.Label);
                writer.Write("</td><td class=\"txvl\">");
                Utilities.HtmlEncode(keyValuePair.Value.Value, writer);
                writer.Write("</td></tr>");
            }
            writer.Write("<tr><td colspan=2 class=\"lbl lp\"><a href=\"");
            writer.Write("<tr><td class=\"spcOP\" colspan=2></td></tr>");
        }
Esempio n. 5
0
        // Token: 0x060027F4 RID: 10228 RVA: 0x000E25CC File Offset: 0x000E07CC
        protected int GetMailingAddress()
        {
            PhysicalAddressType result = PhysicalAddressType.None;

            if (base.Item != null)
            {
                object obj = base.Item.TryGetProperty(ContactSchema.PostalAddressId);
                if (obj is int)
                {
                    result = (PhysicalAddressType)obj;
                }
            }
            return((int)result);
        }
Esempio n. 6
0
        public static List <ContactPropertyInfo> GetAddressInfo(PhysicalAddressType type)
        {
            if (type != PhysicalAddressType.Business && type != PhysicalAddressType.Home && type != PhysicalAddressType.Other)
            {
                throw new ArgumentOutOfRangeException("type", "type must be Business, Home or Other");
            }
            List <ContactPropertyInfo> list = new List <ContactPropertyInfo>();

            AddressFormatTable.AddressPart[] cultureAddressMap = AddressFormatTable.GetCultureAddressMap(Culture.GetUserCulture().LCID);
            foreach (AddressFormatTable.AddressPart addressPart in cultureAddressMap)
            {
                ContactPropertyInfo item = ContactUtilities.LookupAddressProperty(addressPart, type);
                list.Add(item);
            }
            return(list);
        }
Esempio n. 7
0
            public override void Export(ContactWriter writer, Contact contact, OutboundVCardConverter.PropertyExporter.Context context)
            {
                writer.StartProperty(PropertyId.Address);
                writer.StartParameter(ParameterId.Type);
                writer.WriteParameterValue(this.type);
                PhysicalAddressType valueOrDefault = contact.GetValueOrDefault <PhysicalAddressType>(ContactSchema.PostalAddressId);

                if (valueOrDefault == this.addrType)
                {
                    writer.WriteParameterValue("PREF");
                }
                for (int i = 0; i < this.props.Length; i++)
                {
                    string text = string.Empty;
                    if (this.props[i] != null)
                    {
                        text = (contact.TryGetProperty(this.props[i]) as string);
                        if (text == null)
                        {
                            text = string.Empty;
                        }
                    }
                    writer.WritePropertyValue(text, ContactValueSeparators.Semicolon);
                }
                string text2 = contact.TryGetProperty(this.labelProp) as string;

                if (text2 != null)
                {
                    writer.StartProperty(PropertyId.Label);
                    writer.StartParameter(ParameterId.Type);
                    writer.WriteParameterValue(this.type);
                    if (valueOrDefault == this.addrType)
                    {
                        writer.WriteParameterValue("PREF");
                    }
                    writer.WritePropertyValue(text2);
                }
            }
Esempio n. 8
0
 public static string GetPhysicalAddressString(PhysicalAddressType enumValue)
 {
     return(LocalizedStrings.GetNonEncoded(ContactUtilities.physicalAddressEnumToStringMap[enumValue]));
 }
Esempio n. 9
0
        public static IDictionary <AddressFormatTable.AddressPart, AddressComponent> GetAddressInfo(Item item, PhysicalAddressType type)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            if (type != PhysicalAddressType.Business && type != PhysicalAddressType.Home && type != PhysicalAddressType.Other)
            {
                throw new ArgumentOutOfRangeException("type", "type must be Business, Home or Other");
            }
            IDictionary <AddressFormatTable.AddressPart, AddressComponent> dictionary = new Dictionary <AddressFormatTable.AddressPart, AddressComponent>();

            AddressFormatTable.AddressPart[] cultureAddressMap = AddressFormatTable.GetCultureAddressMap(Culture.GetUserCulture().LCID);
            foreach (AddressFormatTable.AddressPart addressPart in cultureAddressMap)
            {
                PropertyDefinition propertyDefinition = AddressFormatTable.LookupAddressProperty(addressPart, type);
                string             property           = ItemUtility.GetProperty <string>(item, propertyDefinition, string.Empty);
                if (property.Length > 0)
                {
                    AddressComponent value = ContactUtilities.ProcessAddressPartInternal(property, addressPart);
                    dictionary[addressPart] = value;
                }
            }
            return(dictionary);
        }
Esempio n. 10
0
 private static ContactPropertyInfo LookupAddressProperty(AddressFormatTable.AddressPart addressPart, PhysicalAddressType type)
 {
     ContactPropertyInfo[] array;
     if (ContactUtilities.addressPropertyTable.TryGetValue(type, out array))
     {
         return(array[(int)addressPart]);
     }
     return(null);
 }
 // Token: 0x060006D7 RID: 1751 RVA: 0x00035F8C File Offset: 0x0003418C
 public static PropertyDefinition LookupAddressProperty(AddressFormatTable.AddressPart addressPart, PhysicalAddressType type)
 {
     PropertyDefinition[] array;
     if (AddressFormatTable.addressPropertyTable.TryGetValue(type, out array))
     {
         return(array[(int)addressPart]);
     }
     return(null);
 }
Esempio n. 12
0
 private AddressExporter(NativeStorePropertyDefinition[] props, PropertyDefinition labelProp, PhysicalAddressType addrType, string type)
 {
     this.props     = props;
     this.labelProp = labelProp;
     this.addrType  = addrType;
     this.type      = type;
 }
Esempio n. 13
0
        // Token: 0x06002AAC RID: 10924 RVA: 0x000EFD68 File Offset: 0x000EDF68
        private void RenderAddress(PhysicalAddressType type, bool isSelected)
        {
            IDictionary <AddressFormatTable.AddressPart, AddressComponent> addressInfo = ContactUtilities.GetAddressInfo(base.Item, type);

            if (addressInfo.Count == 0)
            {
                return;
            }
            this.isSubsectionStarted = false;
            this.RenderSectionStart(true);
            string s    = string.Empty;
            string text = string.Empty;

            base.Response.Write("<div ");
            switch (type)
            {
            case PhysicalAddressType.Home:
                s    = LocalizedStrings.GetHtmlEncoded(1414246315);
                text = "AH";
                break;

            case PhysicalAddressType.Business:
                s    = LocalizedStrings.GetHtmlEncoded(-765825260);
                text = "AB";
                break;

            case PhysicalAddressType.Other:
                s    = LocalizedStrings.GetHtmlEncoded(-582599340);
                text = "AO";
                break;
            }
            base.Response.Write(" id=td");
            base.Response.Write(text);
            base.Response.Write(" class=\"bLn");
            if (!this.isFirstLine)
            {
                base.Response.Write(" indent");
            }
            base.Response.Write("\">");
            base.Response.Write(s);
            base.Response.Write("</div><div");
            base.Response.Write(" id=td");
            base.Response.Write(text);
            base.Response.Write("S class=\"fld bLn\">");
            if (isSelected)
            {
                base.Response.Write("<span id=spnSel class=gryTxt>");
                base.Response.Write(base.UserContext.IsRtl ? string.Empty : " ");
                base.Response.Write(base.UserContext.DirectionMark);
                base.Response.Write("(");
                base.Response.Write(LocalizedStrings.GetHtmlEncoded(1912536019));
                base.Response.Write(")");
                base.Response.Write(base.UserContext.DirectionMark);
                base.Response.Write("</span>");
            }
            base.Response.Write("</div></div>");
            this.isFirstLine = true;
            foreach (KeyValuePair <AddressFormatTable.AddressPart, AddressComponent> keyValuePair in addressInfo)
            {
                string id = text + ((int)keyValuePair.Key).ToString();
                if (this.isFirstLine)
                {
                    this.isFirstLine = false;
                    base.Response.Write("<div class=\"clear row noindent\">");
                }
                else
                {
                    base.Response.Write("<div class=\"clear row\">");
                }
                this.RenderLabelValueAndUrl(keyValuePair.Value.Label, id, keyValuePair.Value.Value, null, false, null);
            }
        }