Hi guys!
I was wondering if there is a way to apply date when marking a method as obsolete? What I mean about a date is that this date represents the "date" when this function should be removed for good.
And a NooB question, is there a way to display error message in winform using MessageBox.show()?
Code:
`
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[Obsolete("This class is obsolete; use class B instead")]
class A
{
public void F() { }
}
class B
{
public void F() { }
}
private void button1_Click(object sender, EventArgs e)
{
A a = new A(); // Warning
a.F();
}
private void button2_Click(object sender, EventArgs e)
{
B b = new B();
b.F();
}
}
}
`