// OrtizOL - xCSw - http://o...content-available-to-author-only...t.com
using System;
public class Email
{
[ObsoleteAttribute]
public bool ComprobarEmail()
{
// Implementacion versión 1.
return false;
}
public bool ValidarEmail()
{
// Implementación versiones 2, y 3.
return false;
}
}
public class EmailTest
{
public static void Main()
{
Console.WriteLine(Environment.NewLine);
Email email = new Email();
email.ComprobarEmail(); // Se genera advertencia en tiempo de compilación: CS0612
email.ValidarEmail(); // No genera ninguna advertencia o error en tiempo de compilación.
Console.WriteLine(Environment.NewLine);
}
}
Ly8gT3J0aXpPTCAtIHhDU3cgLSBodHRwOi8vby4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4udC5jb20KIAp1c2luZyBTeXN0ZW07CiAKcHVibGljIGNsYXNzIEVtYWlsCnsKICAgIFtPYnNvbGV0ZUF0dHJpYnV0ZV0KICAgIHB1YmxpYyBib29sIENvbXByb2JhckVtYWlsKCkKICAgIHsKICAgICAgICAgLy8gSW1wbGVtZW50YWNpb24gdmVyc2nDs24gMS4KICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQogCiAgICBwdWJsaWMgYm9vbCBWYWxpZGFyRW1haWwoKQogICAgewogICAgICAgICAvLyBJbXBsZW1lbnRhY2nDs24gdmVyc2lvbmVzIDIsIHkgMy4KICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQp9CiAKcHVibGljIGNsYXNzIEVtYWlsVGVzdAp7CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCiAgICB7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoRW52aXJvbm1lbnQuTmV3TGluZSk7CiAgICAgICAgCiAgICAgICAgRW1haWwgZW1haWwgPSBuZXcgRW1haWwoKTsKICAgICAgICAKICAgICAgICBlbWFpbC5Db21wcm9iYXJFbWFpbCgpOyAgICAgICAgLy8gU2UgZ2VuZXJhIGFkdmVydGVuY2lhIGVuIHRpZW1wbyBkZSBjb21waWxhY2nDs246IENTMDYxMgogICAgICAgIGVtYWlsLlZhbGlkYXJFbWFpbCgpOyAgICAgICAgLy8gTm8gZ2VuZXJhIG5pbmd1bmEgYWR2ZXJ0ZW5jaWEgbyBlcnJvciBlbiB0aWVtcG8gZGUgY29tcGlsYWNpw7NuLgogICAgICAgIAogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKEVudmlyb25tZW50Lk5ld0xpbmUpOwogICAgfQp9