Пример #1
0
        public RegistryHttpClient(RegistryClientSettings registryClientSettings = null)
        {
            Settings = registryClientSettings ?? RegistryClientSettings.LoadSettings();

            LoadSettings(Settings);
            JsonSerializerSettings = new JsonStandardSettings();
        }
Пример #2
0
        public FileBasedRegistry(FileBasedRegistrySettings settings = null)
        {
            Settings = settings ?? FileBasedRegistrySettings.LoadSettings();
            JsonSerializerSettings = new JsonStandardSettings();

            FolderPath = Settings.Miscellaneous["FolderPath"];

            if (string.IsNullOrEmpty(FolderPath))
            {
                logger.Error("FolderPath is null or empty");
                throw new ArgumentNullException("FolderPath");
            }
            if (!Directory.Exists(FolderPath))
            {
                DirectoryInfo info;
                try
                {
                    info = Directory.CreateDirectory(FolderPath);
                }
                catch (Exception e)
                {
                    logger.Error("FolderPath does not exist and cannot be created: " + e.Message);
                    throw;
                }

                if (!info.Exists)
                {
                    logger.Error("FolderPath does not exist and cannot be created");
                    throw new InvalidOperationException("FolderPath does not exist and cannot be created");
                }
            }
        }
 private AssetAdministrationShellHttpClient()
 {
     JsonSerializerSettings = new JsonStandardSettings();
 }
Пример #4
0
 private SubmodelHttpClient()
 {
     JsonSerializerSettings = new JsonStandardSettings();
 }