Exemplo n.º 1
0
        /// <summary>
        /// Determeins if this TEL is equal to another TEL
        /// </summary>
        public bool Equals(TEL other)
        {
            bool result = false;

            if (other != null)
            {
                result = base.Equals((PDV <String>)other) &&
                         (other.Use != null ? other.Use.Equals(this.Use) : this.Use == null) &&
                         (other.UseablePeriod != null ? other.UseablePeriod.Equals(this.UseablePeriod) : this.UseablePeriod == null) &&
                         (other.Capabilities != null ? other.Capabilities.Equals(this.Capabilities) : this.Capabilities == null);
            }
            return(result);
        }
Exemplo n.º 2
0
        public static bool IsValidUrlFlavor(TEL tel)
        {
            // Nothing to validate
            if (tel.Value == null)
            {
                return(true);
            }

            string[] allowedSchemes = new string[] { "#", "file:", "nfs://", "ftp://", "cid://", "http://", "https://" };
            bool     valid          = tel.Use == null;

            foreach (string s in allowedSchemes)
            {
                if (((string)tel).StartsWith(s, StringComparison.InvariantCulture))
                {
                    return(valid);
                }
            }
            return(false);
        }
Exemplo n.º 3
0
 public static bool IsValidEMailFlavor(TEL tel)
 {
     return(tel.Value != null && tel.Value.StartsWith("mailto:"));
 }
Exemplo n.º 4
0
 public static bool IsValidPersonFlavor(TEL tel)
 {
     return(IsValidPhoneFlavor(tel) || IsValidEMailFlavor(tel));
 }
Exemplo n.º 5
0
 public static bool IsValidUriFlavor(TEL tel)
 {
     return(IsValidUrlFlavor(tel));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create an instance of ED that links to a real location <paramref name="reference"/>
 /// </summary>
 /// <param name="reference">The reference to the real data</param>
 public ED(TEL reference) : this()
 {
     this.Reference = reference;
 }