Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DateTime.Tomorrow();
- static DateTime Tomorrow(this Datetime value) { //... }
- public static MyClass {
- public static Tomorrow() { //... }
- }
- static class DateTimeHelper
- {
- public static DateTime Tomorrow
- {
- get { return DateTime.Now.AddDays(1); }
- }
- }
- DateTime tomorrow = DateTimeHelper.Tomorrow;
- namespace ExtensionMethods
- {
- public static class MyExtensionMethods
- {
- public static DateTime Tomorrow(this DateTime date)
- {
- return date.AddDays(1);
- }
- }
- }
- DateTime.Now.Tomorrow();
- or (any object of type DateTime).Tomorrow();
- public static class Foo
- {
- public static void Bar()
- {
- var now = DateTime.Now;
- var tomorrow = typeof(DateTime).Tomorrow();
- }
- public static DateTime Tomorrow(this System.Type type)
- {
- if (type == typeof(DateTime)) {
- return DateTime.Now.AddDays(1);
- } else {
- throw new InvalidOperationException();
- }
- }
- }
- public static class DateTimeUtils
- {
- public static DateTime Tomorrow { get { ... } }
- }
- WriteLine("{0}", DateTimeUtils.Tomorrow)
- DateTime.Tomorrow
- DateTimeUtil.Tomorrow
Add Comment
Please, Sign In to add comment