2013-09-02 15:40:14 +02:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Configuration;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Core.Configuration.UmbracoSettings
|
|
|
|
|
|
{
|
2013-09-13 13:41:07 +10:00
|
|
|
|
internal class RepositoryElement : ConfigurationElement, IRepository
|
2013-09-02 15:40:14 +02:00
|
|
|
|
{
|
2013-09-16 11:22:11 +10:00
|
|
|
|
[ConfigurationProperty("name", IsRequired = true)]
|
2013-09-13 13:41:07 +10:00
|
|
|
|
public string Name
|
2013-09-02 15:40:14 +02:00
|
|
|
|
{
|
|
|
|
|
|
get { return (string)base["name"]; }
|
2013-09-12 19:12:21 +10:00
|
|
|
|
set { base["name"] = value; }
|
2013-09-02 15:40:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-09-16 11:22:11 +10:00
|
|
|
|
[ConfigurationProperty("guid", IsRequired = true)]
|
2013-09-13 13:41:07 +10:00
|
|
|
|
public Guid Id
|
2013-09-02 15:40:14 +02:00
|
|
|
|
{
|
|
|
|
|
|
get { return (Guid)base["guid"]; }
|
2013-09-12 19:12:21 +10:00
|
|
|
|
set { base["guid"] = value; }
|
2013-09-02 15:40:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-11-19 18:01:09 +01:00
|
|
|
|
[ConfigurationProperty("repositoryurl", DefaultValue = "http://packages.umbraco.org")]
|
2013-09-16 11:22:11 +10:00
|
|
|
|
public string RepositoryUrl
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return (string)base["repositoryurl"]; }
|
|
|
|
|
|
set { base["repositoryurl"] = value; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2013-09-25 16:52:26 +10:00
|
|
|
|
[ConfigurationProperty("webserviceurl", DefaultValue = "/umbraco/webservices/api/repository.asmx")]
|
2013-09-16 11:22:11 +10:00
|
|
|
|
public string WebServiceUrl
|
|
|
|
|
|
{
|
2013-09-25 16:52:26 +10:00
|
|
|
|
get { return (string)base["webserviceurl"]; }
|
|
|
|
|
|
set { base["webserviceurl"] = value; }
|
2013-09-16 11:22:11 +10:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool HasCustomWebServiceUrl
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2013-09-25 16:52:26 +10:00
|
|
|
|
var prop = Properties["webserviceurl"];
|
2013-09-16 11:22:11 +10:00
|
|
|
|
var repoUrl = this[prop] as ConfigurationElement;
|
|
|
|
|
|
return (repoUrl != null && repoUrl.ElementInformation.IsPresent);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2013-09-02 15:40:14 +02:00
|
|
|
|
}
|
2013-08-31 11:28:19 +10:00
|
|
|
|
}
|