[3.0/LINQ] embed a class in a user control
I have recently taken up the idea of makeing user Controls for things that i use quiet often.
One user control i have created is a datagridview , load button and a save button, for editing csv files that we use quiet frequently at work.
on save is use a class called WriteCSV to save the data. I can add the class to the project no problem but to increase the portablity of the user control is there a way that i can add the class directly to the user control so that i (or another coworker) dont have to remember to add the class WriteCSV.cs as well as CsvDisplay.cs as well?
Thanks
Re: [3.0/LINQ] embed a class in a user control
Why would you have to add either? Both those classes should be compiled into their own DLLs. If you want to use that UC you reference the library it's defined in and away you go, just like any other control. Note that, if you add a control to a form from the Toolbox, the required reference will be added to your project automatically.
Re: [3.0/LINQ] embed a class in a user control
If i created a user control as a dll. and then the class as a dll
when i created a new project i would have to make sure thouse two files were present with the exe?
(when i deploy it)
Re: [3.0/LINQ] embed a class in a user control
Quote:
Originally Posted by Crash893
If i created a user control as a dll. and then the class as a dll
when i created a new project i would have to make sure thouse two files were present with the exe?
(when i deploy it)
If your issue is deploying more than one file then either use IExpress, which is part of Windows, to create a self-extracting executable or else use ILMerge, which you can download from Microsoft, to merge the assemblies into one. That way you develop with multiple assemblies and then simply create a single file for deployment when you're done. The difference is that with ILMerge you're creating a single assembly where IExpress will create a file that will extract the multiple original assemblies.