Пример #1
0
        public IMEFApplication Start(string featurePath)
        {
            if (string.IsNullOrWhiteSpace(featurePath))
            {
                throw new ArgumentException(nameof(featurePath));
            }

            IMEFApplication application = MEFApplicationProvider.GetMEFApplication();

            application.Initialize(featurePath);
            return(application);
        }
Пример #2
0
        static async Task Main(string[] args)
        {
            string featurePath = Path.Combine(Environment.CurrentDirectory, "DeviceFeatures");

            IMEFApplication application = activator.Start(featurePath);
            await application.Run().ConfigureAwait(false);

            while (Console.ReadKey().Key != ConsoleKey.Q)
            {
                await Task.Delay(50).ConfigureAwait(false);
            }

            application.Shutdown();
        }