public AEditor <ARepositoryManagerSettings> GetEditor(ARepositoryManagerSettings repositoryManagerSettings)
        {
            if (repositoryManagerSettings is BitBucketRepositoryManagerSettings)
            {
                this.bitBucketRepositoryManagerSettingsEditor.ObjectEdited = (BitBucketRepositoryManagerSettings)repositoryManagerSettings;
                return(this.bitBucketRepositoryManagerSettingsEditor);
            }
            else if (repositoryManagerSettings is FileSystemRepositoryManagerSettings)
            {
                this.fileSystemRepositoryManagerSettingsEditor.ObjectEdited = (FileSystemRepositoryManagerSettings)repositoryManagerSettings;
                return(this.fileSystemRepositoryManagerSettingsEditor);
            }
            else if (repositoryManagerSettings is SSHServerRepositoryManagerSettings)
            {
                this.sshServerRepositoryManagerSettingsEditor.ObjectEdited = (SSHServerRepositoryManagerSettings)repositoryManagerSettings;
                return(this.sshServerRepositoryManagerSettingsEditor);
            }

            throw new NotSupportedException("There is no editor available for this type of settings.");
        }
Beispiel #2
0
        public IRepositoryManager CreateRepositoryManagerFromSettings(ARepositoryManagerSettings repositoryManagerSettings)
        {
            IRepositoryManager repositoryManager = null;

            if (repositoryManagerSettings is BitBucketRepositoryManagerSettings)
            {
                repositoryManager = new BitBucketRepositoryManager();
            }
            else if (repositoryManagerSettings is SSHServerRepositoryManagerSettings)
            {
                repositoryManager = new SSHServerRepositoryManager();
            }
            else if (repositoryManagerSettings is FileSystemRepositoryManagerSettings)
            {
                repositoryManager = new FileSystemRepositoryManager();
            }
            else
            {
                throw new NotSupportedException("The repository manager associated with these settings is not supported by the factory.");
            }
            repositoryManager.Settings = repositoryManagerSettings;
            return(repositoryManager);
        }
 public string GetSettingsTypeName(ARepositoryManagerSettings repositoryManagerSettings)
 {
     return(repositoryManagerSettings.GetType().Name);
 }