A
Alexander Vasilevsky
Something I did not understand the joke humor
What's the magic of 0 in enums?
class Program
{
static void Main(string[] args)
{
Foo a_obj = new Foo();
SubjectStatus a_s = a_obj.Status;
Console.WriteLine(a_s + "-" + a_obj.Status);
a_obj.Status = SubjectStatus.New;
Console.WriteLine(a_obj.Status);
a_obj.Status = 0;
Console.WriteLine(a_obj.Status);
// a_obj.Status = 3;
// Console.WriteLine(a_obj.Status);
}
}
public class Foo
{
private SubjectStatus m_Status;
public virtual SubjectStatus Status
{
get { return m_Status; }
set { m_Status = value; }
}
}
/// <summary>
/// Subject Status
/// </summary>
public enum SubjectStatus
{
New = 3,
Actual = 5,
Acrhive = 6
}
And why, if the comment to remove the program does not compile? do not see
the logic.
http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
Gift
What's the magic of 0 in enums?
class Program
{
static void Main(string[] args)
{
Foo a_obj = new Foo();
SubjectStatus a_s = a_obj.Status;
Console.WriteLine(a_s + "-" + a_obj.Status);
a_obj.Status = SubjectStatus.New;
Console.WriteLine(a_obj.Status);
a_obj.Status = 0;
Console.WriteLine(a_obj.Status);
// a_obj.Status = 3;
// Console.WriteLine(a_obj.Status);
}
}
public class Foo
{
private SubjectStatus m_Status;
public virtual SubjectStatus Status
{
get { return m_Status; }
set { m_Status = value; }
}
}
/// <summary>
/// Subject Status
/// </summary>
public enum SubjectStatus
{
New = 3,
Actual = 5,
Acrhive = 6
}
And why, if the comment to remove the program does not compile? do not see
the logic.
http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
Gift