コード例 #1
0
 public WindowsUpdatesHandler(
     IClientHandlerCallBack callback,
     ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
コード例 #2
0
 public CertificateHandler(
     IClientHandlerCallBack deviceManagementClient,
     ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = deviceManagementClient;
 }
コード例 #3
0
 public RebootInfoHandler(
     IClientHandlerCallBack callback,
     ISystemConfiguratorProxy systemConfiguratorProxy,
     JObject desiredCache)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
     _desiredCache            = desiredCache;
 }
コード例 #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);
        }
コード例 #5
0
 public RebootCmdHandler(IClientHandlerCallBack callback,
                         ISystemConfiguratorProxy systemConfiguratorProxy,
                         IDeviceManagementRequestHandler hostAppHandler,
                         WindowsUpdatePolicyHandler windowsUpdatePolicyHandler)
 {
     _systemConfiguratorProxy    = systemConfiguratorProxy;
     _deviceManagementClient     = callback;
     _hostAppHandler             = hostAppHandler;
     _windowsUpdatePolicyHandler = windowsUpdatePolicyHandler;
 }
コード例 #6
0
        public async Task <string> DownloadToTempAsync(ISystemConfiguratorProxy systemConfiguratorProxy)
        {
            var info = new AzureFileTransferInfo()
            {
                ConnectionString = ConnectionString,
                ContainerName    = ContainerName,
                BlobName         = BlobName,
                Upload           = false,

                RelativeLocalPath = BlobName
            };

            await AzureBlobFileTransfer.TransferFileAsync(info, systemConfiguratorProxy);

            return(BlobName);
        }
コード例 #7
0
        public static async Task DownloadCertificates(
            ISystemConfiguratorProxy systemConfiguratorProxy,
            string connectionString,
            CertificatesDataContract.DesiredProperties desiredProperties)
        {
            HashSet <string> certificateFilesSet = new HashSet <string>();

            MergeCertificateFileNames(desiredProperties.rootCATrustedCertificates_Root, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.rootCATrustedCertificates_CA, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.rootCATrustedCertificates_TrustedPublisher, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.rootCATrustedCertificates_TrustedPeople, certificateFilesSet);

            MergeCertificateFileNames(desiredProperties.certificateStore_CA_System, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.certificateStore_Root_System, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.certificateStore_My_User, certificateFilesSet);
            MergeCertificateFileNames(desiredProperties.certificateStore_My_System, certificateFilesSet);

            await DownloadCertificates(systemConfiguratorProxy, connectionString, certificateFilesSet);
        }
コード例 #8
0
        private static async Task DownloadCertificates(ISystemConfiguratorProxy systemConfiguratorProxy, string connectionString, HashSet <string> certificateFilesSet)
        {
            // ToDo: since our cache is temporary, we might have to download those files everytime to verify the hashes.
            Debug.Assert(certificateFilesSet != null);

            foreach (string fileName in certificateFilesSet)
            {
                string [] fileNameParts = fileName.Split('\\');
                if (fileNameParts.Length != 2)
                {
                    throw new Exception("Incorrect azure storage specification! The format should be containerName\\blobName.");
                }
                IoTDMClient.BlobInfo blobInfo = new IoTDMClient.BlobInfo();
                blobInfo.ConnectionString = connectionString;
                blobInfo.ContainerName    = fileNameParts[0];
                blobInfo.BlobName         = fileNameParts[1];
                Debug.WriteLine("Downloading " + blobInfo.BlobName);
                await blobInfo.DownloadToTempAsync(systemConfiguratorProxy);
            }
        }
コード例 #9
0
        private DeviceManagementClient(IDeviceTwin deviceTwin, IDeviceManagementRequestHandler hostAppHandler, ISystemConfiguratorProxy systemConfiguratorProxy)
        {
            Logger.Log("Entering DeviceManagementClient constructor.", LoggingLevel.Verbose);

            this._lastDesiredPropertyVersion = -1;
            this._deviceTwin                   = deviceTwin;
            this._hostAppHandler               = hostAppHandler;
            this._systemConfiguratorProxy      = systemConfiguratorProxy;
            this._desiredPropertyMap           = new Dictionary <string, IClientPropertyHandler>();
            this._desiredPropertyDependencyMap = new Dictionary <string, List <IClientPropertyDependencyHandler> >();
        }
コード例 #10
0
 public StorageHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback = callback;
 }
コード例 #11
0
 internal static DeviceManagementClient Create(IDeviceTwin deviceTwin, IDeviceManagementRequestHandler requestHandler, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     return(new DeviceManagementClient(deviceTwin, requestHandler, systemConfiguratorProxy));
 }
コード例 #12
0
 public FactoryResetHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
コード例 #13
0
 public AppxLifeCycleHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
コード例 #14
0
 public DmAppStoreUpdateHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
コード例 #15
0
 public TimeSettingsHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _callback = callback;
 }
コード例 #16
0
        public static async Task TransferFileAsync(AzureFileTransferInfo transferInfo, ISystemConfiguratorProxy systemConfiguratorProxy)
        {
            //
            // C++ Azure Blob SDK not supported for ARM, so use Service to copy file to/from
            // App's LocalData and then use C# Azure Blob SDK to transfer
            //
            var appLocalDataFile = await ApplicationData.Current.TemporaryFolder.CreateFileAsync(transferInfo.BlobName, CreationCollisionOption.ReplaceExisting);

            transferInfo.AppLocalDataPath = appLocalDataFile.Path;

            if (!transferInfo.Upload)
            {
                transferInfo.AppLocalDataPath = await DownloadFile(transferInfo, appLocalDataFile);
            }

            // use C++ service to copy file to/from App LocalData
            var request = new AzureFileTransferRequest(transferInfo);
            var result  = await systemConfiguratorProxy.SendCommandAsync(request);

            if (transferInfo.Upload)
            {
                await UploadFile(transferInfo, appLocalDataFile);
            }

            await appLocalDataFile.DeleteAsync();
        }
コード例 #17
0
 public AppxManagement(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy, JObject desiredCache)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback     = callback;
     this._desiredCache = desiredCache;
 }
コード例 #18
0
 public RemoteWipeHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _deviceManagementClient  = callback;
 }
コード例 #19
0
        private DeviceManagement(ISystemConfiguratorProxy systemConfiguratorProxy)
        {
            Logger.Log("Entering DeviceManagementClient constructor without Azure connection.", LoggingLevel.Verbose);

            this._systemConfiguratorProxy = systemConfiguratorProxy;
        }
コード例 #20
0
 public EventTracingHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy, JObject desiredCache)
 {
     _systemConfiguratorProxy = systemConfiguratorProxy;
     _callback     = callback;
     _desiredCache = desiredCache;
 }
コード例 #21
0
 private DeviceManagementClient(IDeviceTwin deviceTwin, IDeviceManagementRequestHandler requestHandler, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     this._deviceTwin              = deviceTwin;
     this._requestHandler          = requestHandler;
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._externalStorage         = new ExternalStorage();
 }
コード例 #22
0
 public WindowsTelemetryHandler(IClientHandlerCallBack callback, ISystemConfiguratorProxy systemConfiguratorProxy)
 {
     this._systemConfiguratorProxy = systemConfiguratorProxy;
     this._callback = callback;
 }