public WindowsUpdatesHandler(
     IClientHandlerCallBack callback,
     ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
Exemplo n.º 2
0
 public CertificateHandler(
     IClientHandlerCallBack deviceManagementClient,
     ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = deviceManagementClient;
 }
 public RebootInfoHandler(
     IClientHandlerCallBack callback,
     ISystemConfiguratorProxy systemConfiguratorProxy,
     JObject desiredCache)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
     _desiredCache            = desiredCache;
 }
Exemplo n.º 4
0
        public DeviceHealthAttestationHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
        {
            this._systemConfiguratorProxy = systemConfiguratorProxy;
            this._callback       = callback;
            this._reportInterval = TimeSpan.Zero;

            // Create the settings container
            this._container = ApplicationData.Current.LocalSettings.CreateContainer(ApplicationDataContainerName, ApplicationDataCreateDisposition.Always);
        }
 public RebootCmdHandler(IClientHandlerCallBack callback,
                         ISystemConfiguratorProxy systemConfiguratorProxy,
                         IDeviceManagementRequestHandler hostAppHandler,
                         WindowsUpdatePolicyHandler windowsUpdatePolicyHandler)
 {
     _systemConfiguratorProxy    = systemConfiguratorProxy;
     _deviceManagementClient     = callback;
     _hostAppHandler             = hostAppHandler;
     _windowsUpdatePolicyHandler = windowsUpdatePolicyHandler;
 }
Exemplo n.º 6
0
        public static async Task EnsureErrorsLogged(IClientHandlerCallBack _callback, string sectionName, Func <Task> action)
        {
            try
            {
                await action();
            }
            catch (Error ex)
            {
                StatusSection status = new StatusSection(StatusSection.StateType.Failed, ex);

                Logger.Log(status.ToString(), LoggingLevel.Error);
                await _callback.ReportStatusAsync(sectionName, status);
            }
            catch (Exception ex)
            {
                Error         e      = new Error(ErrorSubSystem.Unknown, ex.HResult, ex.Message);
                StatusSection status = new StatusSection(StatusSection.StateType.Failed, e);

                Logger.Log(status.ToString(), LoggingLevel.Error);
                await _callback.ReportStatusAsync(sectionName, status);
            }
        }
 public AppxLifeCycleHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
 public FactoryResetHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
Exemplo n.º 9
0
 public ClearReportedPropertiesHandler(IClientHandlerCallBack callback)
 {
     _deviceManagementClient = callback;
 }
 public AppxManagement(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy, JObject desiredCache)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback     = callback;
     this._desiredCache = desiredCache;
 }
Exemplo n.º 11
0
 public DmAppStoreUpdateHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
 public EventTracingHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy, JObject desiredCache)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _callback     = callback;
     _desiredCache = desiredCache;
 }
 public RemoteWipeHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
 public TimeSettingsHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _callback = callback;
 }
Exemplo n.º 15
0
 public StorageHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback = callback;
 }
        public static async Task <DeviceManagementClient> CreateAsync(IDeviceTwin deviceTwin, IDeviceManagementRequestHandler hostAppHandler)
        {
            Logger.Log("Creating Device Management objects.", LoggingLevel.Verbose);

            var systemConfiguratorProxy = new SystemConfiguratorProxy();
            DeviceManagementClient deviceManagementClient = Create(deviceTwin, hostAppHandler, systemConfiguratorProxy);
            IClientHandlerCallBack clientCallback         = deviceManagementClient;

            // Attach methods...
            await deviceTwin.SetMethodHandlerAsync(CommonDataContract.ReportAllAsync, deviceManagementClient.ReportAllDevicePropertiesMethodHandler);

            // Create/Attach handlers...
            deviceManagementClient._externalStorageHandler = new ExternalStorageHandler(clientCallback, systemConfiguratorProxy);
            deviceManagementClient.AddPropertyHandler(deviceManagementClient._externalStorageHandler);

            var deviceHealthAttestationHandler = new DeviceHealthAttestationHandler(clientCallback, systemConfiguratorProxy);

            deviceManagementClient.AddPropertyHandler(deviceHealthAttestationHandler);
            await deviceManagementClient.AddDirectMethodHandlerAsync(deviceHealthAttestationHandler);

            deviceManagementClient._factoryResetHandler = new FactoryResetHandler(clientCallback, systemConfiguratorProxy);
            await deviceManagementClient.AddDirectMethodHandlerAsync(deviceManagementClient._factoryResetHandler);

            deviceManagementClient._windowsUpdatePolicyHandler = new WindowsUpdatePolicyHandler(clientCallback, systemConfiguratorProxy);
            deviceManagementClient.AddPropertyHandler(deviceManagementClient._windowsUpdatePolicyHandler);

            var windowsUpdatesHandler = new WindowsUpdatesHandler(clientCallback, systemConfiguratorProxy);

            deviceManagementClient.AddPropertyHandler(windowsUpdatesHandler);

            var wifiHandler = new WifiHandler(clientCallback, systemConfiguratorProxy);

            deviceManagementClient.AddPropertyHandler(wifiHandler);
            await deviceManagementClient.AddDirectMethodHandlerAsync(wifiHandler);

            var appxHandler = new AppxManagement(clientCallback, systemConfiguratorProxy, deviceManagementClient._desiredCache);

            deviceManagementClient.AddPropertyHandler(appxHandler);

            var appxLifeCycleHandler = new AppxLifeCycleHandler(clientCallback, systemConfiguratorProxy);
            await deviceManagementClient.AddDirectMethodHandlerAsync(appxLifeCycleHandler);

            var eventTracingHandler = new EventTracingHandler(clientCallback, systemConfiguratorProxy, deviceManagementClient._desiredCache);

            deviceManagementClient.AddPropertyHandler(eventTracingHandler);

            var storageHandler = new StorageHandler(clientCallback, systemConfiguratorProxy);
            await deviceManagementClient.AddDirectMethodHandlerAsync(storageHandler);

            var timeSettingsHandler = new TimeSettingsHandler(clientCallback, systemConfiguratorProxy);

            deviceManagementClient.AddPropertyHandler(timeSettingsHandler);

            deviceManagementClient._timeServiceHandler = new TimeServiceHandler(clientCallback, systemConfiguratorProxy);
            deviceManagementClient.AddPropertyHandler(deviceManagementClient._timeServiceHandler);

            deviceManagementClient._rebootCmdHandler = new RebootCmdHandler(
                clientCallback,
                systemConfiguratorProxy,
                deviceManagementClient._hostAppHandler,
                deviceManagementClient._windowsUpdatePolicyHandler);
            await deviceManagementClient.AddDirectMethodHandlerAsync(deviceManagementClient._rebootCmdHandler);

            var rebootInfoHandler = new RebootInfoHandler(clientCallback, systemConfiguratorProxy, deviceManagementClient._desiredCache);

            deviceManagementClient.AddPropertyHandler(rebootInfoHandler);

            deviceManagementClient._windowsTelemetryHandler = new WindowsTelemetryHandler(clientCallback, systemConfiguratorProxy);
            deviceManagementClient.AddPropertyHandler(deviceManagementClient._windowsTelemetryHandler);

            var deviceInfoHandler = new DeviceInfoHandler(clientCallback, systemConfiguratorProxy);

            deviceManagementClient.AddPropertyHandler(deviceInfoHandler);

            var dmAppStoreUpdate = new DmAppStoreUpdateHandler(clientCallback, systemConfiguratorProxy);
            await deviceManagementClient.AddDirectMethodHandlerAsync(dmAppStoreUpdate);

            deviceManagementClient._certificateHandler = new CertificateHandler(clientCallback, systemConfiguratorProxy);
            deviceManagementClient.AddPropertyHandler(deviceManagementClient._certificateHandler);
            await deviceTwin.SetMethodHandlerAsync(MethodGetCertificateDetails, deviceManagementClient._certificateHandler.GetCertificateDetailsHandlerAsync);

            var clearReportedPropertiesHandler = new ClearReportedPropertiesHandler(clientCallback);
            await deviceManagementClient.AddDirectMethodHandlerAsync(clearReportedPropertiesHandler);

            return(deviceManagementClient);
        }
Exemplo n.º 17
0
 public WindowsTelemetryHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback = callback;
 }