First, fields of the class should be
private
. For access to the instance from the our-of-class code better use properties.
Secondly,
public
is only needed if you want to have access from another assembly. In other cases, use
internal
(or
internal protected
).
Think about what properties should be read-only. You can initialize them from constructor. It includes your
sName
.
Do not violate Microsoft naming conventions. Don't abbreviate. Worst thins is your prefixes. Type are all in meta-data, no need to prefix with type. The idea came from C, but C# is rather opposite to C in main ideas.
public class Project
{
public class ProjectListClass
{
public int Pom { get; set; }
public string Name { get; set; }
public int TotPom { get; set; }
public int ExtraTime { get; set; }
public bool IsSelected { get; set; }
}
}
Project Project = new Project();
Project.Name = MyForm.textBoxName.Text;
Any questions?
—SA