Esempio n. 1
0
 public async Task<bool> DeleteApplicationVersionAsync(string applicationName, int version)
 {
     if (version == 1)
     {
         throw new SettingsException("Cannot delete version 1");
     }
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
     return await applicationProvider.DeleteVerion(version);
 }
Esempio n. 2
0
 public async Task<bool> VersionExists(string applicationName, int version)
 {
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
     return await applicationProvider.VerionExists(version);
 }
Esempio n. 3
0
 public async Task<SettingsApplication> GetApplication(string applicatinName)
 {
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicatinName);
     return await applicationProvider.Get();
 }
Esempio n. 4
0
 public async Task<bool> CreateApplicationVersionAsync(string applicationName, int version)
 {
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
     return await applicationProvider.CreateVerion(version);
 }
Esempio n. 5
0
 public async Task<bool> DirectoryExists(string applicationName, string directoryName)
 {
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
     return await applicationProvider.DirectoryExists(directoryName);
 }
Esempio n. 6
0
        public async Task<WorkingDirectoryObject> OpenDirectoryAsync(string applicationName, int version, string directoryName, int objectId)
        {
            var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
            var application = await applicationProvider.Get();

            if (application == null)
            {
                throw new SettingNotFoundException(directoryName);
            }

            var directory = application.Directories.SingleOrDefault(d => string.Equals(d.Name, directoryName));

            if (directory == null)
            {
                throw new SettingNotFoundException(directoryName);
            }

            var workingDirectory = new WorkingDirectoryObject(directory, applicationName, version, objectId, _url, _apiKey);

            workingDirectory.UseCache = true;
            workingDirectory.ExplicitlySave = false;
 
            await workingDirectory.Reload();

            return workingDirectory;
        }
Esempio n. 7
0
        public async Task<bool> DeleteDirectoryAsync(string applicationName, string directoryName)
        {
            if (string.Equals(directoryName, "root", StringComparison.CurrentCultureIgnoreCase) || string.Equals(directoryName, "root", StringComparison.CurrentCultureIgnoreCase))
            {
                throw new SettingsException("This directory can not be deleted");
            }

            var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
            return await applicationProvider.DeleteDirectory(directoryName);
        }
Esempio n. 8
0
 public async Task<bool> CopyDirectoryAsync(string applicationName, string directoryName, string newDirectoryName, int version)
 {
     var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);
     return await applicationProvider.CopyDirectory(directoryName, newDirectoryName, version);
 }
Esempio n. 9
0
        public async Task<bool> UpdateDirectoryAsync(string applicationName, string directoryName, string newDirectoryName, string description)
        {
            var applicationProvider = new ApplicationProvider(_url, _apiKey, applicationName);

            return await applicationProvider.UpdateDirectory(directoryName, newDirectoryName, description);
        }