New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move file name based I/O to extension methods for facilitated adaptation to PCL #69
Comments
Sounds nice. Given the async/await that's all through it I suppose this depends on #65 being done first. Have you used this library for your fo-DICOM portable fork? Any drawbacks or other weird things? |
NOTE! The proposal in this comment is obsolete! See this comment for updated proposal. @IanYates It is not necessary that #65 is done first, it is possible to (temporarily) apply synchronous embeddings on the PCLStorage calls. Personally I would prefer to implement this task first, I think it is easier to overview the implications of In my portable fork, I have chosen another strategy, namely to keep the original fo-dicom source code as intact as possible, and instead use e.g. the So far I have not used PCLStorage extensively, but it is a well established project by renowned MS employee and PCL expert Daniel Plaisted, so I am fairly confident that it should well fit our needs. |
@anders9ustafsson - sounds good. |
NOTE! The proposal in this comment is obsolete! See this comment for updated proposal. I have used the following construct for example in Shim:
which means that you limit the |
@IanYates @GMZ @hdesouky I have given this issue some more thought, and I would like to modify the proposal. Rather than adapting the internal file based I/O operations to use portable constructs, I suggest that we make the core I/O operations entirely Example
In the case of Using this approach it would be much easier to eventually split the DICOM assembly into a Please also note that these modifications can be made without adding any third-party library dependencies to fo-dicom. What do you think? Would it be worthwhile if I prepared a pull request to demonstrate this proposal in practice? |
@anders9ustafsson - that does seem like a sensible approach and it's how I handle some of my API code internally when I need to read from disk or from a stream. I haven't thought it through completely yet but are there places in fo-dicom that only take a file or byte[] at the moment? (I don't have the code handy) Similarly, are there places in fo-dicom that would expect the stream to now be "owned" and thus automatically disposed? |
Many thanks, @IanYates , these items will definitely need to be kept in mind when refactoring the code. I cannot say for sure right now if there are any random access parts that are not already using |
Use interfaces for file and directory I/O operations. Connected to #69
NOTE! The proposal in this comment is obsolete! See this comment for updated proposal.
The .NET file I/O operations in the
System.IO
namespace are generally not applicable to other platforms.PCLStorage provides a platform agnostic abstraction layer for common file I/O operations.
To facilitate porting fo-dicom to other platforms such as Windows 8/Windows Phone 8.1/Universal Windows 10 as well as Xamarin iOS and Xamarin Android, I suggest that the internal calls to
System.IO.File
,System.IO.Directory
etc. should be refactored to use PCLStorage constructs instead.Please share your thoughts on this issue.
The text was updated successfully, but these errors were encountered: