Пример #1
0
        /// <summary>
        /// Parses the given string to a new AccessIP
        /// </summary>
        /// <param name="source">A string representation of the entry</param>
        /// <param name="target"></param>
        /// <returns>True if parsing was succesful, otherwise false</returns>
        public static bool TryParse(string source, out AccessListEntry target)
        {
            IPAddress address;

            if (IPAddress.TryParse(source, out address))
            {
                target = new AccessIP(address);
                return(true);
            }

            target = null;
            return(false);
        }
Пример #2
0
        /// <summary>
        /// Parses the given string to a new AccessIP
        /// </summary>
        /// <param name="source">A string representation of the entry</param>
        /// <param name="target"></param>
        /// <returns>True if parsing was succesful, otherwise false</returns>
        public static bool TryParse(string source, out AccessListEntry target)
        {
            IPAddress address;

            if (IPAddress.TryParse(source, out address))
            {
                target = new AccessIP(address);
                return true;
            }

            target = null;
            return false;
        }