/// <summary>
        /// Initializes a new instance of the <see cref="StartTunnelOld"/> class.
        /// </summary>
        public NgrokExtensionsPackage()
        {
            // Inside this method you can place any initialization code that does not require
            // any Visual Studio service because at this point the package object is created but
            // not sited yet inside Visual Studio environment. The place to do all the other
            // initialization is the Initialize method.
            IAsyncServiceContainer serviceContainer = this;

            serviceContainer.AddService(typeof(SLoggerService), CreateLoggerServiceAsync, true);
            serviceContainer.AddService(typeof(SRepositoryService), CreateRepositoryServiceAsync, true);
            serviceContainer.AddService(typeof(SProcessManagerService), CreateProcessManagerServiceAsync, true);
            serviceContainer.AddService(typeof(SWebApplicationsManagerService), CreateWebApplicationsManagerServiceAsync, true);
            serviceContainer.AddService(typeof(STunnelManagerService), CreateTunnelManagerServiceAsync, true);
        }
 public static void AddServiceAsync <T>(this IAsyncServiceContainer container, Func <Task <T> > createCallback, bool promote)
 {
     container.AddService(typeof(T), async(c, ct, t) => await createCallback(), promote);
 }
Exemplo n.º 3
0
 internal static void Register(IAsyncServiceContainer serviceContainer)
 {
     serviceContainer.AddService(typeof(TemplateLocator), CreateService, true);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Adds the <see cref="ITransformationContextProvider"/> service in the specified <paramref name="container"/>.
 /// </summary>
 /// <param name="container">
 /// An <see cref="IServiceContainer"/> object that will be providing the <see cref="ITransformationContextProvider"/> service.
 /// </param>
 internal static void Register(IAsyncServiceContainer container)
 {
     container.AddService(typeof(ITransformationContextProvider), CreateService, promote: true);
 }