public LightroomImporterService()
 {
     InitializeComponent();
     ConfigurationManager = new ConfigurationManager();
     PortableDeviceConnectivityManager.Instance();
     DeviceListManager = new DeviceListManager(ConfigurationManager);
 }
        public DeviceListManager(ConfigurationManager configurationManager)
        {
            ConfigurationManager = configurationManager;

            ManagementEventWatcher = new ManagementEventWatcher();
            WqlEventQuery query = new WqlEventQuery(DeviceChangeEventQuery);
            ManagementEventWatcher.EventArrived += Watcher_EventArrived;
            ManagementEventWatcher.Query = query;
            IsKeepRunning = false;
        }
        static void Main(string[] args)
        {
            System.Console.WriteLine(
                "{0}: Starting Program. Please connect a camera.",
                DateTime.Now.ToString("d MMM yyyy HH:mm:ss"));

            ConfigurationManager configurationManager = new ConfigurationManager();
            PortableDeviceConnectivityManager.Instance();
            DeviceListManager deviceListManager = new DeviceListManager(configurationManager);
            deviceListManager.Start();

            System.Console.WriteLine(
                "{0}: Program Closing.",
                DateTime.Now.ToString("d MMM yyyy HH:mm:ss"));
        }