Exercise 1: Build AutoCount Accounting 2.0 Plug-In: Difference between revisions
Content added Content deleted
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
{{Note|Project in this tutorial is created with Microsoft Visual Studio 2017 Community}} |
{{Note|Project in this tutorial is created with Microsoft Visual Studio 2017 Community}} |
||
== |
==Starting new AutoCount Accounting 2.0 Plug-In== |
||
===Create New Plug-In Project=== |
|||
[[File:VSNewProject.PNG|link=]] |
[[File:VSNewProject.PNG|link=]] |
||
# Create a new "Visual C#" Project |
# Create a new "Visual C#" Project |
||
Line 29: | Line 30: | ||
<br /> |
<br /> |
||
===Add Class PlugInMain.cs=== |
===Add Class "PlugInMain.cs"=== |
||
[[File:CreatePluginMain.PNG|link=]] |
[[File:CreatePluginMain.PNG|link=]] |
||
# Add a class to project. |
# Add a class to project. |
||
# Name the class "PlugInMain.cs" |
# Name the class "PlugInMain.cs" |
||
*Click [Add] |
*Click [Add] |
||
<br /> |
|||
==Plug-In Entry Point== |
|||
===PlugInMain to Inherit from AutoCount.PlugIn.BasePlugIn=== |
|||
# Inherit AutoCount.PlugIn.BasePlugIn to PlugInMain |
|||
# Add Constructor that is required by the base class, which constructor requires 3 arguments:- |
|||
#*Generate a new GUID for this plug-in. |
|||
#*Name this Plug-In |
|||
#*Version of this Plug-In |
|||
<syntaxhighlight lang="csharp"> |
|||
public class PlugInMain : AutoCount.PlugIn.BasePlugIn |
|||
{ |
|||
public PlugInMain() : base(new Guid("12D34B4A-692D-46DE-8D7D-B3520D4CA679"), |
|||
"My PlugIn for AC 2.0", "2.0.0") |
|||
{ |
|||
} |
|||
} |
|||
</syntaxhighlight> |
|||
{{Note|While every Plug-In must not assigned with a same GUID.<br />It is advised to use the same GUID for the same plug-in, when the plug-in version is updated.}} |
|||
===Set Plug-In Profile and Properties=== |
|||
<syntaxhighlight lang="csharp" highlight="5-9,12,14"> |
|||
public PlugInMain() : base(new Guid("12D34B4A-692D-46DE-8D7D-B3520D4CA679"), |
|||
"My PlugIn for AC 2.0", "2.0.0") |
|||
{ |
|||
//Enter your Company Profile registered with AutoCount's Developer ID |
|||
SetManufacturer("Auto Count Sdn. Bhd."); |
|||
SetManufacturerUrl("http://www.autocountsoft.com"); |
|||
SetCopyright("Copyright 2015 © Auto Count Sdn. Bhd."); |
|||
SetSalesPhone("1-800-88-7766"); |
|||
SetSupportPhone("+60-3-3324-2148"); |
|||
//Minimum AutoCount Accounting version is required |
|||
SetMinimumAccountingVersionRequired("2.0.55"); |
|||
//Set this Plug-In is free |
|||
SetIsFreeLicense(true); |
|||
} |
|||
</syntaxhighlight> |
|||
<syntaxhighlight lang="csharp"> |
|||
SetMinimumAccountingVersionRequired("2.0.55"); |
|||
</syntaxhighlight> |
|||
* AutoCount Accounting version that is lower than 2.0.55 will not be able to run this Plug-In. |
|||
* To ensure assemblies version compatibility between AutoCount Accounting and Plug-In; |
|||
* when Plug-In applies methods and properties that are introduced in newer version of AutoCount Accounting. |
|||
===BeforeLoad=== |
|||
===GetLicenseStatus=== |
Revision as of 09:20, 16 November 2017
Go to top
|
Resources For AutoCount Software Developers
|
Objectives: Create a new Plug-in project for AutoCount Accounting 2.0 This exercise is to build an AutoCount Accounting Plug-in Package, and successfully load the Plug-in at AutoCount Accounting 2.0 Plug-in Manager.
Project in this tutorial is created with Microsoft Visual Studio 2017 Community |
Starting new AutoCount Accounting 2.0 Plug-In
Create New Plug-In Project
- Create a new "Visual C#" Project
- Framework is .Net Framework 4.5
- Select "Windows Forms App (.Net Framework)
- Enter project name: MyPlugIn2
- Click [OK]
Add AutoCount Accounting 2.0 References to Project
Suggest to copy the dll to a folder and rename the folder to AutoCount Accounting version. Eg.: AC2.0.55. So that when necessity arises, programmer can maintain multiple versions of Plug-Ins. |
- Add References Window
- Browse to AutoCount Accounting 2.0 folder
- Default path of 64bit AutoCount Accounting is C:\Program Files\AutoCount\Accounting 2.0\
- DLL files are assemblies of AutoCount Accounting that can be added to project references
- Click [Add]
Adding AutoCount Accounting 2.0 Base Assemblies
- AutoCount.dll
- AutoCount.CommonAccounting.dll
- AutoCount.MainEntry.dll
- AutoCount.WinForms.dll
Add Class "PlugInMain.cs"
- Add a class to project.
- Name the class "PlugInMain.cs"
- Click [Add]
Plug-In Entry Point
PlugInMain to Inherit from AutoCount.PlugIn.BasePlugIn
- Inherit AutoCount.PlugIn.BasePlugIn to PlugInMain
- Add Constructor that is required by the base class, which constructor requires 3 arguments:-
- Generate a new GUID for this plug-in.
- Name this Plug-In
- Version of this Plug-In
public class PlugInMain : AutoCount.PlugIn.BasePlugIn
{
public PlugInMain() : base(new Guid("12D34B4A-692D-46DE-8D7D-B3520D4CA679"),
"My PlugIn for AC 2.0", "2.0.0")
{
}
}
While every Plug-In must not assigned with a same GUID. It is advised to use the same GUID for the same plug-in, when the plug-in version is updated. |
Set Plug-In Profile and Properties
public PlugInMain() : base(new Guid("12D34B4A-692D-46DE-8D7D-B3520D4CA679"),
"My PlugIn for AC 2.0", "2.0.0")
{
//Enter your Company Profile registered with AutoCount's Developer ID
SetManufacturer("Auto Count Sdn. Bhd.");
SetManufacturerUrl("http://www.autocountsoft.com");
SetCopyright("Copyright 2015 © Auto Count Sdn. Bhd.");
SetSalesPhone("1-800-88-7766");
SetSupportPhone("+60-3-3324-2148");
//Minimum AutoCount Accounting version is required
SetMinimumAccountingVersionRequired("2.0.55");
//Set this Plug-In is free
SetIsFreeLicense(true);
}
SetMinimumAccountingVersionRequired("2.0.55");
- AutoCount Accounting version that is lower than 2.0.55 will not be able to run this Plug-In.
- To ensure assemblies version compatibility between AutoCount Accounting and Plug-In;
- when Plug-In applies methods and properties that are introduced in newer version of AutoCount Accounting.