예제 #1
0
        private string GetContactPropertyStringValue(ContactPropertyInfo property)
        {
            string result = string.Empty;

            if (this.Contact == null)
            {
                return(result);
            }
            string result2 = null;
            string result3 = null;

            if (property == ContactUtilities.Email1EmailAddress || property == ContactUtilities.Email2EmailAddress || property == ContactUtilities.Email3EmailAddress)
            {
                EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(property);
                ContactUtilities.GetContactEmailAddress(this.Contact, emailPropertyIndex, out result2, out result3);
                return(result2);
            }
            if (property == ContactUtilities.Email1DisplayName || property == ContactUtilities.Email2DisplayName || property == ContactUtilities.Email3DisplayName)
            {
                EmailAddressIndex emailPropertyIndex2 = ContactUtilities.GetEmailPropertyIndex(property);
                ContactUtilities.GetContactEmailAddress(this.Contact, emailPropertyIndex2, out result2, out result3);
                return(result3);
            }
            string text = this.Contact.TryGetProperty(property.PropertyDefinition) as string;

            if (text != null)
            {
                result = text;
            }
            return(result);
        }
예제 #2
0
        // Token: 0x060027F1 RID: 10225 RVA: 0x000E220C File Offset: 0x000E040C
        protected void RenderPhoneProperties()
        {
            int num = ContactUtilities.PhoneNumberProperties.Length;

            DropDownListItem[] array         = new DropDownListItem[num];
            StringBuilder      stringBuilder = new StringBuilder();

            for (int i = 0; i < num; i++)
            {
                ContactPropertyInfo contactPropertyInfo = ContactUtilities.PhoneNumberProperties[i];
                string propertyValue = this.GetPropertyValue(contactPropertyInfo.PropertyDefinition);
                stringBuilder.Append("<input id=\"");
                stringBuilder.Append(contactPropertyInfo.Id);
                stringBuilder.Append("\"");
                array[i] = new DropDownListItem(contactPropertyInfo.Id, contactPropertyInfo.Label, "drp_" + contactPropertyInfo.Id, !string.IsNullOrEmpty(propertyValue.Trim()));
                if (contactPropertyInfo != this.firstPhoneProperty)
                {
                    stringBuilder.Append(" style=\"display:none\"");
                }
                stringBuilder.Append(" maxlength=\"256\" class=\"cntWell\" type=\"text\" value=\"");
                stringBuilder.Append(Utilities.HtmlEncode(propertyValue));
                stringBuilder.Append("\">");
            }
            base.Response.Write("<div class=\"cntLabelCombo\">");
            DropDownList dropDownList = new DropDownList("divPH", this.firstPhoneProperty.Id, array);

            dropDownList.Render(base.Response.Output);
            base.Response.Write("</div><div class=\"cntField\">");
            base.Response.Write(stringBuilder);
            base.Response.Write("</div>");
        }
예제 #3
0
        // Token: 0x06002DA2 RID: 11682 RVA: 0x001023C4 File Offset: 0x001005C4
        private void SetTextPropertyValue(Contact contact, ContactPropertyInfo propertyInfo)
        {
            string text = (string)base.GetParameter(propertyInfo.Id);

            if (text != null)
            {
                contact[propertyInfo.PropertyDefinition] = text;
            }
        }
예제 #4
0
        // Token: 0x06002DA3 RID: 11683 RVA: 0x001023F4 File Offset: 0x001005F4
        private void SetEmailPropertyValue(Contact contact, ContactPropertyInfo propertyInfo)
        {
            ContactPropertyInfo emailDisplayAsProperty = ContactUtilities.GetEmailDisplayAsProperty(propertyInfo);
            EmailAddressIndex   emailPropertyIndex     = ContactUtilities.GetEmailPropertyIndex(propertyInfo);
            string email       = (string)base.GetParameter(propertyInfo.Id);
            string displayName = (string)base.GetParameter(emailDisplayAsProperty.Id);

            ContactUtilities.SetContactEmailAddress(contact, emailPropertyIndex, email, displayName);
        }
예제 #5
0
        private void SetInt(ContactPropertyInfo propertyInfo)
        {
            int num;

            if (int.TryParse(this.GetFormParameterStringValue(propertyInfo.Id), out num))
            {
                this.Contact[propertyInfo.PropertyDefinition] = num;
            }
        }
예제 #6
0
        private void SetText(ContactPropertyInfo propertyInfo)
        {
            string text = this.GetFormParameterStringValue(propertyInfo.Id);

            if (Utilities.WhiteSpaceOnlyOrNullEmpty(text))
            {
                text = string.Empty;
            }
            this.Contact[propertyInfo.PropertyDefinition] = text;
        }
예제 #7
0
        // Token: 0x060027E9 RID: 10217 RVA: 0x000E1F70 File Offset: 0x000E0170
        private void GetEmailAddressValue(ContactPropertyInfo propertyInfo, out string displayName, out string email)
        {
            displayName = string.Empty;
            email       = string.Empty;
            if (base.Item == null)
            {
                return;
            }
            EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(propertyInfo);

            ContactUtilities.GetContactEmailAddress(this.contact, emailPropertyIndex, out email, out displayName);
        }
예제 #8
0
        protected override DropDownListItem[] CreateListItems()
        {
            int num = ContactUtilities.EmailAddressProperties.Length;

            DropDownListItem[] array = new DropDownListItem[num];
            for (int i = 0; i < num; i++)
            {
                ContactPropertyInfo contactPropertyInfo = ContactUtilities.EmailAddressProperties[i];
                array[i] = new DropDownListItem(contactPropertyInfo.Id, contactPropertyInfo.Label);
            }
            return(array);
        }
예제 #9
0
        protected void RenderPropertyStringValue(ContactPropertyInfo propertyInfo, string defaultValue)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException("propertyInfo");
            }
            string stringValue = this.helper.GetStringValue(propertyInfo, defaultValue);

            if (!string.IsNullOrEmpty(stringValue))
            {
                Utilities.HtmlEncode(stringValue, base.Response.Output);
            }
        }
예제 #10
0
        // Token: 0x060027F2 RID: 10226 RVA: 0x000E2358 File Offset: 0x000E0558
        protected void RenderEmailProperties()
        {
            EmailDropDownList emailDropDownList = new EmailDropDownList("divEM", this.firstEmailProperty);

            base.Response.Write("<div class=\"cntLabelCombo\">");
            emailDropDownList.Render(base.Response.Output);
            base.Response.Write("</div><div class=\"cntField\">");
            string[] array = new string[ContactUtilities.EmailAddressProperties.Length];
            for (int i = 0; i < ContactUtilities.EmailAddressProperties.Length; i++)
            {
                string text = null;
                string s    = null;
                ContactPropertyInfo contactPropertyInfo = ContactUtilities.EmailAddressProperties[i];
                this.GetEmailAddressValue(contactPropertyInfo, out text, out s);
                array[i] = text;
                base.Response.Write("<input id=\"");
                base.Response.Write(contactPropertyInfo.Id);
                base.Response.Write("\"");
                if (contactPropertyInfo != this.firstEmailProperty)
                {
                    base.Response.Write(" style=\"display:none\"");
                }
                ContactPropertyInfo emailDisplayAsProperty = ContactUtilities.GetEmailDisplayAsProperty(contactPropertyInfo);
                base.Response.Write(" maxlength=\"256\" class=\"cntWell\" type=\"text\" value=\"");
                Utilities.HtmlEncode(s, base.Response.Output);
                base.Response.Write("\" _da=\"");
                base.Response.Write(emailDisplayAsProperty.Id);
                base.Response.Write("\">");
            }
            base.Response.Write("</div>");
            base.Response.Write("<div class=\"cntLabel\">");
            base.Response.Write(LocalizedStrings.GetHtmlEncoded(1019177604));
            base.Response.Write("</div><div class=\"cntField\">");
            for (int j = 0; j < ContactUtilities.EmailAddressProperties.Length; j++)
            {
                ContactPropertyInfo contactPropertyInfo2 = ContactUtilities.EmailAddressProperties[j];
                string s2 = array[j];
                base.Response.Write("<input id=\"");
                base.Response.Write(ContactUtilities.GetEmailDisplayAsProperty(contactPropertyInfo2).Id);
                base.Response.Write("\"");
                if (contactPropertyInfo2 != this.firstEmailProperty)
                {
                    base.Response.Write(" style=\"display:none\"");
                }
                base.Response.Write(" maxlength=\"256\" class=\"cntWell\" type=\"text\" value=\"");
                Utilities.HtmlEncode(s2, base.Response.Output);
                base.Response.Write("\">");
            }
            base.Response.Write("</div>");
        }
예제 #11
0
        private int?GetContactPropertyIntValue(ContactPropertyInfo propertyInfo)
        {
            if (propertyInfo == ContactUtilities.FileAsId)
            {
                return(new int?((int)ContactUtilities.GetFileAs(this.Contact)));
            }
            object obj = this.Contact.TryGetProperty(propertyInfo.PropertyDefinition);

            if (obj != null && obj is int)
            {
                return(new int?((int)obj));
            }
            return(null);
        }
예제 #12
0
 // Token: 0x060027E8 RID: 10216 RVA: 0x000E1E14 File Offset: 0x000E0014
 protected override void OnLoad(EventArgs e)
 {
     ExTraceGlobals.ContactsCallTracer.TraceDebug((long)this.GetHashCode(), "EditContact.OnLoad");
     base.OnLoad(e);
     this.contact            = base.Initialize <Contact>(false, EditContact.prefetchProperties);
     this.firstPhoneProperty = null;
     this.firstEmailProperty = null;
     if (this.contact != null)
     {
         for (int i = 0; i < ContactUtilities.PhoneNumberProperties.Length; i++)
         {
             ContactPropertyInfo contactPropertyInfo = ContactUtilities.PhoneNumberProperties[i];
             string propertyValue = this.GetPropertyValue(contactPropertyInfo.PropertyDefinition);
             if (this.firstPhoneProperty == null && !string.IsNullOrEmpty(propertyValue))
             {
                 this.firstPhoneProperty = contactPropertyInfo;
                 break;
             }
         }
         for (int j = 0; j < ContactUtilities.EmailAddressProperties.Length; j++)
         {
             ContactPropertyInfo contactPropertyInfo2 = ContactUtilities.EmailAddressProperties[j];
             string value  = null;
             string value2 = null;
             this.GetEmailAddressValue(contactPropertyInfo2, out value, out value2);
             this.GetPropertyValue(contactPropertyInfo2.PropertyDefinition);
             if (this.firstEmailProperty == null && (!string.IsNullOrEmpty(value) || !string.IsNullOrEmpty(value2)))
             {
                 this.firstEmailProperty = contactPropertyInfo2;
                 break;
             }
         }
         InfobarMessageBuilder.AddFlag(this.infobar, this.contact, base.UserContext);
     }
     if (this.firstPhoneProperty == null)
     {
         this.firstPhoneProperty = ContactUtilities.AssistantPhoneNumber;
     }
     if (this.firstEmailProperty == null)
     {
         this.firstEmailProperty = ContactUtilities.Email1EmailAddress;
     }
     this.isPhoneticNamesEnabled = Utilities.IsJapanese;
     this.toolbar             = new EditContactToolbar(this.contact);
     this.toolbar.ToolbarType = ToolbarType.View;
 }
예제 #13
0
        private void SetEmail(ContactPropertyInfo propertyInfo)
        {
            ContactPropertyInfo emailDisplayAsProperty = ContactUtilities.GetEmailDisplayAsProperty(propertyInfo);
            string            text  = this.GetFormParameterStringValue(propertyInfo.Id);
            string            text2 = this.GetFormParameterStringValue(emailDisplayAsProperty.Id);
            EmailAddressIndex emailPropertyIndex = ContactUtilities.GetEmailPropertyIndex(propertyInfo);

            if (Utilities.WhiteSpaceOnlyOrNullEmpty(text))
            {
                text = null;
            }
            if (Utilities.WhiteSpaceOnlyOrNullEmpty(text2))
            {
                text2 = null;
            }
            ContactUtilities.SetContactEmailAddress(this.Contact, emailPropertyIndex, text, text2);
        }
예제 #14
0
 // Token: 0x060027EA RID: 10218 RVA: 0x000E1FAC File Offset: 0x000E01AC
 protected void RenderTextProperty(ContactPropertyInfo propertyInfo)
 {
     if (propertyInfo == null)
     {
         throw new ArgumentNullException("propertyInfo");
     }
     base.Response.Write("<div class=\"cntLabel\">");
     base.Response.Write(LocalizedStrings.GetHtmlEncoded(propertyInfo.Label));
     base.Response.Write("</div><div class=\"cntField\"><input type=\"text\" id=\"");
     base.Response.Write(propertyInfo.Id);
     base.Response.Write("\" class=\"cntWell\" maxlength=\"255\" value=\"");
     if (base.Item != null)
     {
         string propertyValue = this.GetPropertyValue(propertyInfo.PropertyDefinition);
         Utilities.HtmlEncode(propertyValue, base.Response.Output);
     }
     base.Response.Write("\"></div><div class=\"clear\" />");
 }
예제 #15
0
 // Token: 0x060027EB RID: 10219 RVA: 0x000E2054 File Offset: 0x000E0254
 protected void RenderMultiLineTextProperty(ContactPropertyInfo propertyInfo)
 {
     if (propertyInfo == null)
     {
         throw new ArgumentNullException("propertyInfo");
     }
     base.Response.Write("<div class=\"cntLabelMulti\">");
     base.Response.Write(LocalizedStrings.GetHtmlEncoded(propertyInfo.Label));
     base.Response.Write("</div><div class=\"cntMulti\"><textarea id=\"");
     base.Response.Write(propertyInfo.Id);
     base.Response.Write("\" class=\"cntWellMulti\">");
     if (base.Item != null)
     {
         string propertyValue = this.GetPropertyValue(propertyInfo.PropertyDefinition);
         Utilities.HtmlEncode(propertyValue, base.Response.Output);
     }
     base.Response.Write("</textarea></div>");
 }
예제 #16
0
        public string GetStringValue(ContactPropertyInfo propertyInfo, string defaultValue)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException("propertyInfo");
            }
            string formParameterStringValue = this.GetFormParameterStringValue(propertyInfo.Id);

            if (this.Contact != null)
            {
                string contactPropertyStringValue = this.GetContactPropertyStringValue(propertyInfo);
                if (formParameterStringValue != null && !string.Equals(formParameterStringValue, contactPropertyStringValue))
                {
                    this.isPropertiesChanged = true;
                }
                return((formParameterStringValue ?? contactPropertyStringValue) ?? defaultValue);
            }
            if (formParameterStringValue != null && formParameterStringValue != defaultValue)
            {
                this.isPropertiesChanged = true;
            }
            return(formParameterStringValue ?? defaultValue);
        }
예제 #17
0
        public int GetIntValue(ContactPropertyInfo propertyInfo, int defaultValue)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException("propertyInfo");
            }
            int?formParameterIntValue = this.GetFormParameterIntValue(propertyInfo);

            if (this.Contact != null)
            {
                int?contactPropertyIntValue = this.GetContactPropertyIntValue(propertyInfo);
                if (formParameterIntValue != null && formParameterIntValue != contactPropertyIntValue)
                {
                    this.isPropertiesChanged = true;
                }
                int?num = formParameterIntValue ?? contactPropertyIntValue;
                if (num == null)
                {
                    return(defaultValue);
                }
                return(num.GetValueOrDefault());
            }
            else
            {
                if (formParameterIntValue != null && formParameterIntValue != defaultValue)
                {
                    this.isPropertiesChanged = true;
                }
                int?num2 = formParameterIntValue;
                if (num2 == null)
                {
                    return(defaultValue);
                }
                return(num2.GetValueOrDefault());
            }
        }
예제 #18
0
 protected void RenderPropertyStringValue(ContactPropertyInfo propertyInfo)
 {
     this.RenderPropertyStringValue(propertyInfo, string.Empty);
 }
예제 #19
0
 private int?GetFormParameterIntValue(ContactPropertyInfo property)
 {
     return(this.GetFormParameterIntValue(property.Id));
 }
예제 #20
0
 public EmailDropDownList(string id, ContactPropertyInfo selectedEmailProperty) : base(id, selectedEmailProperty.Id, null)
 {
     this.selectedEmailProperty = selectedEmailProperty;
 }
예제 #21
0
 public string GetStringValue(ContactPropertyInfo propertyInfo)
 {
     return(this.GetStringValue(propertyInfo, string.Empty));
 }