Click or drag to resize

How to Create a .NET Extension Application Project

To complete the steps below you will need the following items

  • Visual Studio 2013 (or later)

  • The PosCore.dll, PosCommonClasses.dll and Ops.dll libraries from the version of Simphony targeted by the extension application. These files can be found in the wwwroot\EGateway\Handlers folder on the POS Client system.

The Extension Application are supported by Simphony hardware running the Windows .NET platform, they are not currently supported on hardware running the Android Mono.NET platform.

Create .NET Extension Application

  1. In Visual Studio create a new Class Library Project.

  2. Add reference to the following required Simphony class libraries

    • Ops.dll

    • PosCommonClasses.dll

    • PosCore.dll

    Set "Copy Local" property of all references to "False". This will avoid having multiple instances of libraries loaded when debugging the extension application.

    Please consult the Simphony Hardware Guide to determine the minimum version of the .NET Framework that the library must target. As of this writing the two options are .NET Framework 3.5 and .NET Framework 4.6.1

  3. Replace the class created by Visual Studio when the class library project was started with code from the Example below.

  4. Build the project.

    If you get an error indicating types or namespace name can not be found, and you have included the required Simphony class libraries please check to make sure the correct Target Framework has been selected in the Project Properties | Application.

  5. See How To Install a .NET Extension Application to learn how to install the Extension Application.

Example
Boiler-plate code to create an Extension Application
using System;
using System.Text;
using Micros.Ops;
using Micros.Ops.Extensibility;
using Micros.PosCore.Extensibility;
using Micros.PosCore.Extensibility.Ops;

namespace MyExtensionApplication
{

    /// <summary>
    /// Implements the extension application
    /// </summary>
    public class Application : OpsExtensibilityApplication
    {
        /// <summary>
        /// Extension application constructor
        /// </summary>
        /// <param name="context">the execution context for the application</param>
        public Application(IExecutionContext context)
            : base(context)
        {
            // TODO: Add initialization code and hook up event handlers here
        }

        [ExtensibilityMethod]
        public void MyExtensionMethod()
        {
            // TODO: rename method and implement
            OpsContext.ShowMessage(string.Format("Hello World from {0}", this.ApplicationName));
        }
    }

    /// <summary>
    ///  Implements interface used by Simphony POS Client to create an instance of the extension application
    /// </summary>
    public class ApplicationFactory : IExtensibilityAssemblyFactory
    {
        public ExtensibilityAssemblyBase Create(IExecutionContext context)
        {
            return new Application(context);
        }

        public void Destroy(ExtensibilityAssemblyBase app)
        {
            app.Destroy();
        }
    }
}
See Also