You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The list is a starting point to decide, where we can leave DateTime, and where to replace it with IDateTime. #406 could be a good starting point
Click to toggle code that produces the list
publicvoidFindDateTime(){varassembly=Assembly.Load("Ical.Net");// Load your assembly herevartypes=assembly.GetTypes();foreach(vartypeintypes){// Find methods with DateTime or DateTime? parametersvarmethods=type.GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.Static).Where(m =>m.GetParameters().Any(p =>p.ParameterType==typeof(DateTime)||p.ParameterType==typeof(DateTime?)));foreach(varmethodinmethods){Console.WriteLine($"Type: {type.FullName}, Method: {method.Name}");}// Find public fields of type DateTime or DateTime?varfields=type.GetFields(BindingFlags.Public|BindingFlags.Instance|BindingFlags.Static).Where(f =>f.FieldType==typeof(DateTime)||f.FieldType==typeof(DateTime?));foreach(varfieldinfields){Console.WriteLine($"Type: {type.FullName}, Field: {field.Name}");}// Find public properties of type DateTime or DateTime? that are not getters-onlyvarproperties=type.GetProperties(BindingFlags.Public|BindingFlags.Instance|BindingFlags.Static).Where(p =>(p.PropertyType==typeof(DateTime)||p.PropertyType==typeof(DateTime?))&&p.CanWrite);foreach(varpropertyinproperties){Console.WriteLine($"Type: {type.FullName}, Property: {property.Name}");}}}
The text was updated successfully, but these errors were encountered:
@axunonb I started some effort in this direction end of last year. See #704 and #705
axunonb
changed the title
Replace public methods / properties using DateTime with IDateTime
Replace public methods / properties using DateTime with CalDateTimeJan 22, 2025
Here is a list of all public methods, fields, and properties (getters) in the project that use
DateTime
orDateTime?
.The list is a starting point to decide, where we can leave
DateTime
, and where to replace it withIDateTime
.#406 could be a good starting point
Click to toggle code that produces the list
The text was updated successfully, but these errors were encountered: