AssemblyInitializerBase.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace FastReport.Utils
  5. {
  6. /// <summary>
  7. /// Base class for plugin's assembly initializer.
  8. /// </summary>
  9. /// <remarks>
  10. /// FastReport has an open architecture. That means you can extend it with own classes
  11. /// such as report objects, wizards, export filters. Usually such classes are
  12. /// placed in separate dlls (plugins). FastReport has mechanism to load plugin dlls. You can specify
  13. /// which plugins to load at first start, in the FastReport configuration file (by default it is located in the
  14. /// C:\Documents and Settings\User_Name\Local Settings\Application Data\FastReport\FastReport.config file).
  15. /// To do this, add an xml item with your plugin name inside the &lt;Plugins&gt; item:
  16. /// <code>
  17. /// &lt;?xml version="1.0" encoding="utf-8"?&gt;
  18. /// &lt;Config&gt;
  19. /// &lt;Plugins&gt;
  20. /// &lt;Plugin Name="c:\Program Files\MyProgram\MyPlugin.dll"/&gt;
  21. /// &lt;/Plugins&gt;
  22. /// &lt;/Config&gt;
  23. /// </code>
  24. /// When you run your application and use the <b>Report</b> object first time, all plugins will be loaded.
  25. /// To register objects contained in a plugin, FastReport searches for classes of type
  26. /// <b>AssemblyInitializerBase</b> and instantiates them.
  27. /// <para>Use this class to register custom report objects, controls, wizards, exports that
  28. /// are contained in the assembly. To do this, make your own class of the <b>AssemblyInitializerBase</b>
  29. /// type and override its default constructor. In the constructor, call <b>RegisteredObjects.Add</b>
  30. /// methods to register all necessary items.</para>
  31. /// </remarks>
  32. public class AssemblyInitializerBase
  33. {
  34. /// <summary>
  35. /// Registers plugins contained in this assembly.
  36. /// </summary>
  37. /// <remarks>
  38. /// This constructor is called automatically when the assembly is loaded.
  39. /// </remarks>
  40. /// <example>This example show how to create own assembly initializer to register own items.
  41. /// <code>
  42. /// public class MyAssemblyInitializer : AssemblyInitializerBase
  43. /// {
  44. /// public MyAssemblyInitializer()
  45. /// {
  46. /// // register own wizard
  47. /// RegisteredObjects.AddWizard(typeof(MyWizard), myWizBmp, "My Wizard", true);
  48. /// // register own export filter
  49. /// RegisteredObjects.AddExport(typeof(MyExport), "My Export");
  50. /// // register own report object
  51. /// RegisteredObjects.Add(typeof(MyObject), "ReportPage", myObjBmp, "My Object");
  52. /// }
  53. /// }
  54. /// </code>
  55. /// </example>
  56. public AssemblyInitializerBase()
  57. {
  58. }
  59. }
  60. }