EmbeddedData is a Visual Studio Extension that creates C#-Code to access EmbeddedResources. UsageSet the Build Action to Embedded Resource and Custom Tool to EmbeddedData. After attaching the EmbeddedData Custom Tool, Visual Studio will create the Code to access the Embedded Resource Currently the Extension creates 6 Methods. Open returns a Stream containing the Data. AsFile takes a delegate that is executed with the Name of the temporary generated File. The File is deleted after executing the delegate. AsByte returns a byte-Array with the Data. AsString returns the Content of Stream interpreted as UTF8 encoded String. CopyTo copies the content of the EmbeddedResource as File into the specified Directory. OpenFile returns an Instance of the inner class FileHandle. This class Has a Property with the Path of the File and a Delete Method. It also implements IDisposeable and deletes the File when Dispose() is called.
ConfigurationThe behaviour of the Extension can be configured with a Configuration file (embbeddata.config.json). The Configuration file can be placed in the same directory as the Files to integrate or any directory up in the hierarchy. EmbeddedData looks in every Directory and merges all files it finds.
UseResharperAnnotations: true to use Resharper Annotations in the generated Code, otherwiese false. The Default is false. ResharperAnnotationsNamespace: The Namepsace of the Resharper Annnotations. The Default is Jetbrains.Annotations. More about Resharper Annotations can be found here: https://blog.jetbrains.com/dotnet/2015/08/12/how-to-use-jetbrains-annotations-to-improve-resharper-inspections/ ClassNameWithExtension: true to add the file extension to the generated class name, otherwise false. The Default is false. |