Takes -ages- by hand. Can I not just select my properties and click a button?
They look like this:
private bool _Monday = false;
private bool _Tuesday = false;
private bool _Wednesday = false;
private bool _Thursday = false;
private bool _Friday = false;
private bool _Saturday = false;
private bool _Sunday = false;
and there are LOADS of them.
The current version of C# (3.0) has auto properties:
public bool Monday { get; set; }
// etc …
(You don’t need your fields now, backing fields are generated by the compiler.)
Unfortunately, they do not support (yet) initialization expressions – but in your example you don’t need them since false is the default value for bools anyway.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With