ical.net
ical.net copied to clipboard
Create an Attachment constructor that takes a URI and a constructor that takes a string
v2's Attachment constructor takes a string, which it uses as a Uri. Consider creating an nth Attachment constructor that takes a Uri, and uses it as a URI as the spec intends.
In addition, it might be helpful to retain the string constructor, and auto-convert that a base64-encoded payload.
Caveats: this could create subtle bugs in existing applications. Maybe in the string constructor, we could add a Uri.TryParse call that calls the Uri-based constructor if the string looks like a URL as a workaround.