Exercise 1: Build My First Plug-In

From AutoCount Resource Center
Objectives: Create a new Plug-in project for AutoCount Accounting 1.8
This exercise is to build an AutoCount Accounting Plug-in Package, and successfully load the Plug-in at AutoCount Accounting Plug-in Manager.


Step 1 Add References to Plug-In Project

1. Create new “Class Library” project in Microsoft Visual Studio 2015.

  • Visual C# | Windows | Class Library

2. Name this project as “Tutorial.PRG201”



3. After the project is created, go to project “Properties”, select “Application”.

4. Set Target framework to .NET Framework 4.0

  • Output type is set to “Class Library”.
AutoCount Accounting 1.8.x, Target framework is .NET Framework 4.0


5. Add below AutoCount Accounting assemblies to project references.





Add AutoCount Accounting base assemblies to project's references




Step 2 Create Plug-In Entry Point

6. Create a class, and Inherit BCE.AutoCount.PlugIn.BasePlugIn.

Plug-in Entry Point

7. Base class requires 3 parameters at the constructor of derived class.

Parameter 1 - Guid
Guid is a unique identifier for this Plug-in.
Every Plug-in must be assigned with a new Guid.
Parameter 2 - Name
Name of this plug-in.
Given name is displayed in Plug-In Manager.
Parameter 3 - version
The version of this plug-in.


8. Add feature to Prompt message when the plug-in is successfully loaded in AutoCount Accounting.


Insert below code into Plugin class (the class that inherits BasePlugIn)

public override void AfterLoad(BaseArgs e)
{
    BCE.Application.AppMessage.ShowMessage(string.Format("Account book {0}\nhas loaded My First Plugin", e.CompanyName));
    base.AfterLoad(e);
}




Step 3 Build Project into DLL

9. Run Build Solution to build Tutorial.PRG201.dll

10. Create a folder “packing” in Solution folder.

(Solution folder is where the “.sln” file is stored.)

11. Copy Tutorial.PRG101.dll to “packing” folder

Next step will build the Tutorial.PRG101.dll into AutoCount Plug-in Package (.app)




Step 4 Pack Plug-In in AutoCount Plug-In Package (.app)

Developer ID is required to build Plug-In for AutoCount Accounting.
Register Developer ID Form

12. Run AutoCount Plug-in Builder

13. Click [Change Developer Id] to enter Developer Id.

In order to verify login Developer ID, the device must be connected to internet.
Login with Developer ID
Login with Developer ID













14. Click [Open Plug-in Assembly File] to load Tutorial.PRG101.dll.

Select the file Tutorial.PRG201.dll in “packing” folder.


15. Description is required, and cannot be emptied.

Enter the features of this plug-in and other information that helps the user to understand the functionalities.

16. Save this as “.appp” (AutoCount Plugin Package Project),

  • click [Save Project]
  • Name this project as “Tutorial.PRG201.appp”, and save it in “packing” folder.
Description is saved in the AutoCount Plugin Package Project (.appp). To retrieve the Description, load the project.
To load existing project, click [Open Project].
To start a new empty project, click [New Project].

17. Click [Build Package] to create “.app file” (AutoCount Plug-in Package).

Device must be connected to internet, in order to proceed.
Name the plug-in package as “Tutorial.PRG201.app”, and save it in “packing” folder.




Step 5 Load AutoCount Plug-In Package into AutoCount Accounting

18. Login AutoCount Accounting

  • Go to Tools | Plug-In Manager
User must be able to access to “Plug-Ins Manager” in Access Rights



19. At Plug-In Manager

  • click [Install]
Select “Tutorial.PRG201.app” and click [Open].
Below screen shows the plug-in is successfully loaded.



See Also





Go to menu

Go to top
Resources For AutoCount Software Developers