Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class A
- {
- public A(string text)
- {
- }
- }
- public class Gen<T> where T : new(string text)
- {
- }
- int? i = myRec.Field;
- myRec.Field = null;
- int? i = (int?)myRec.IsFieldNull() ? (int?)null : myRec.Field;
- myRec.SetFieldNull();
- Dim a = Function(x) x * (x - 1)
- var a = x => x * (x - 1);
- Func<int, int> a = x => x * (x - 1);
- switch (a) {
- 1 : do_something;
- 2 : do_something_else;
- 3,4 : do_something_different;
- else : do_something_weird;
- }
- public class MyMixin<T> : T
- {
- // etc...
- }
- var newMixin = new MyMixin<string>();
- private string password;
- public string Password
- {
- // Called when being set by a deserializer or a persistence
- // framework
- deserialize
- {
- // I could put some backward-compat hacks in here. Like
- // weak passwords are grandfathered in without blowing up
- this.password = value;
- }
- get
- {
- if (Thread.CurrentPrincipal.IsInRole("Administrator"))
- {
- return this.password;
- }
- else
- {
- throw new PermissionException();
- }
- }
- set
- {
- if (MeetsPasswordRequirements(value))
- {
- throw new BlahException();
- }
- this.password = value;
- }
- serialize
- {
- return this.password;
- }
- }
- enum Colors { white, blue, green, red, black, yellow }
- enum SpecialColors { Colors.blue, Colors.red, Colors.Yellow }
Add Comment
Please, Sign In to add comment