本文整理汇总了C#中ICmsConfiguration类的典型用法代码示例。如果您正苦于以下问题:C# ICmsConfiguration类的具体用法?C# ICmsConfiguration怎么用?C# ICmsConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICmsConfiguration类属于命名空间,在下文中一共展示了ICmsConfiguration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DefaultMediaService
/// <summary>
/// Initializes a new instance of the <see cref="DefaultMediaService"/> class.
/// </summary>
public DefaultMediaService(IRepository repository, IUnitOfWork unitOfWork, IAccessControlService accessControlService, ICmsConfiguration configuration)
{
this.repository = repository;
this.unitOfWork = unitOfWork;
this.accessControlService = accessControlService;
this.configuration = configuration;
}
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:10,代码来源:DefaultMediaService.cs
示例2: FtpStorageService
public FtpStorageService(ICmsConfiguration config)
{
try
{
var serviceSection = config.Storage;
var mode = serviceSection.GetValue("UsePassiveMode");
rootUrl = config.Storage.ContentRoot;
usePassiveMode = mode != null && bool.Parse(mode);
ftpRoot = serviceSection.GetValue("FtpRoot");
userName = serviceSection.GetValue("FtpUserName");
password = serviceSection.GetValue("FtpPassword");
if (string.IsNullOrEmpty(rootUrl))
{
throw new StorageException("ContentRoot is missing in a storage configuration.");
}
rootUrl = rootUrl.TrimEnd('/');
}
catch (Exception e)
{
throw new StorageException(string.Format("Failed to initialize storage service {0}.", GetType()), e);
}
}
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:25,代码来源:FtpStorageService.cs
示例3: DefaultModuleManager
public DefaultModuleManager(IPackageRepository packageRepository, ICmsConfiguration cmsConfiguration)
{
this.packageRepository = PackageRepositoryFactory.Default.CreateRepository(cmsConfiguration.ModuleGallery.FeedUrl);
this.packageManager = new PackageManager(
this.packageRepository,
cmsConfiguration.WorkingDirectoryRootPath) { Logger = null };
}
开发者ID:wezmag,项目名称:BetterCMS,代码行数:7,代码来源:DefaultModuleManager.cs
示例4: CmsController
/// <summary>
/// Initializes a new instance of the <see cref="CmsController" /> class.
/// </summary>
/// <param name="pageAccessor">The page accessor.</param>
/// <param name="cmsConfiguration">The configuration loader.</param>
/// <param name="cacheService">The cache service.</param>
/// <param name="securityService">The security service.</param>
public CmsController(IPageAccessor pageAccessor, ICmsConfiguration cmsConfiguration, ICacheService cacheService, ISecurityService securityService)
{
this.securityService = securityService;
this.pageAccessor = pageAccessor;
this.cmsConfiguration = cmsConfiguration;
this.cacheService = cacheService;
}
开发者ID:pmaciulis,项目名称:BetterCMS,代码行数:14,代码来源:CmsController.cs
示例5: Up
public override void Up(ICmsConfiguration configuration)
{
using (var pagesApi = CmsContext.CreateApiContextOf<PagesApiContext>())
{
const string WidgetPath = "~/Areas/bcms-newsletter/Views/Widgets/SubscribeToNewsletter.cshtml";
var request = new GetServerControlWidgetsRequest(e => e.Url == WidgetPath);
var widgets = pagesApi.GetServerControlWidgets(request);
if (widgets.Items.Count > 0)
{
return;
}
using (var transactionScope = new TransactionScope())
{
pagesApi.CreateServerControlWidget(
new CreateServerControlWidgetRequest()
{
Name = "Newsletter Widget",
WidgetPath = WidgetPath,
Options =
new List<ContentOptionDto>()
{
new ContentOptionDto() { Type = OptionType.Text, Key = "Email placeholder", DefaultValue = "email..." },
new ContentOptionDto() { Type = OptionType.Text, Key = "Label title", DefaultValue = "Subscribe to newsletter" },
new ContentOptionDto() { Type = OptionType.Text, Key = "Submit title", DefaultValue = "Submit" },
new ContentOptionDto() { Type = OptionType.Text, Key = "Submit is disabled", DefaultValue = "false" }
}
});
transactionScope.Complete();
}
}
}
开发者ID:tkirda,项目名称:BetterCMS,代码行数:32,代码来源:Migration201305231541.cs
示例6: PopulateRolesFromConfiguration
/// <summary>
/// Populates the roles from configuration.
/// </summary>
/// <param name="config">The config.</param>
/// <param name="filterContext">The filter context.</param>
protected internal virtual void PopulateRolesFromConfiguration(ICmsConfiguration config, AuthorizationContext filterContext)
{
this.Roles = config.AdminRoles;
if (config.HostAuthorizations.Any())
{
var host = util.GetTenantHost(filterContext.HttpContext.Request.Url);
var found = config.HostAuthorizations.FirstOrDefault(cfg => string.Compare(host, cfg.Key, StringComparison.OrdinalIgnoreCase) == 0);
if (found != null)
{
this.Roles = found.Value;
}
else
{
// attempt to resolve with wildcard
foreach (var auth in config.HostAuthorizations.Where(ha => ha.Key.Contains("*")))
{
var endHost = auth.Key.Replace("*", string.Empty);
if (host.EndsWith(endHost, StringComparison.OrdinalIgnoreCase))
{
this.Roles = auth.Value;
break;
}
}
}
}
}
开发者ID:noogen,项目名称:phuncms,代码行数:31,代码来源:CmsAdminAuthorizeAttribute.cs
示例7: RegisterStyleSheetFiles
/// <summary>
/// Registers the style sheet files.
/// </summary>
/// <param name="containerBuilder">The container builder.</param>
/// <param name="configuration">The configuration.</param>
/// <returns>Enumerator of known module style sheet files.</returns>
public override IEnumerable<string> RegisterStyleSheetFiles(ContainerBuilder containerBuilder, ICmsConfiguration configuration)
{
return new[]
{
"/file/bcms-users/Content/Css/bcms.users.css"
};
}
开发者ID:pmaciulis,项目名称:BetterCMS,代码行数:13,代码来源:UsersModuleDescriptor.cs
示例8: MediaManagerModuleDescriptor
/// <summary>
/// Initializes a new instance of the <see cref="MediaManagerModuleDescriptor" /> class.
/// </summary>
public MediaManagerModuleDescriptor(ICmsConfiguration cmsConfiguration)
: base(cmsConfiguration)
{
mediaJsModuleIncludeDescriptor = new MediaManagerJsModuleIncludeDescriptor(this);
mediaUploadModuleIncludeDescriptor = new MediaUploadJsModuleIncludeDescriptor(this);
imageEditorModuleIncludeDescriptor = new ImageEditorJsModuleIncludeDescriptor(this);
}
开发者ID:eiu165,项目名称:BetterCMS,代码行数:10,代码来源:MediaManagerModuleDescriptor.cs
示例9: BlogModuleDescriptor
/// <summary>
/// Initializes a new instance of the <see cref="BlogModuleDescriptor" /> class.
/// </summary>
public BlogModuleDescriptor(ICmsConfiguration configuration)
: base(configuration)
{
blogJsModuleIncludeDescriptor = new BlogJsModuleIncludeDescriptor(this);
RootApiContext.Events.PageRetrieved += Events_PageRetrieved;
}
开发者ID:tkirda,项目名称:BetterCMS,代码行数:10,代码来源:BlogModuleDescriptor.cs
示例10: LuceneSearchModuleDescriptor
/// <summary>
/// Initializes a new instance of the <see cref="LuceneSearchModuleDescriptor" class./>
/// </summary>
/// <param name="configuration">The configuration</param>
public LuceneSearchModuleDescriptor(ICmsConfiguration configuration)
: base(configuration)
{
WebCoreEvents.Instance.HostStart += x =>
{
Logger.Info("OnHostStart: preparing Lucene Search index workers...");
// Content indexer
TimeSpan indexerFrequency;
if (TimeSpan.TryParse(configuration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexerFrequency), out indexerFrequency))
{
if (indexerFrequency > TimeSpan.FromSeconds(0))
{
workers.Add(new DefaultContentIndexingRobot(indexerFrequency));
}
}
// New page URLs watcher
TimeSpan watcherFrequency;
if (TimeSpan.TryParse(configuration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LucenePagesWatcherFrequency), out watcherFrequency))
{
if (watcherFrequency > TimeSpan.FromSeconds(0))
{
workers.Add(new DefaultIndexSourceWatcher(watcherFrequency));
}
}
workers.ForEach(f => f.Start());
Logger.Info("OnHostStart: preparing Lucene Search index workers completed.");
};
}
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:36,代码来源:LuceneSearchModuleDescriptor.cs
示例11: DefaultCategoryNodeService
public DefaultCategoryNodeService(IRepository repository, ICmsConfiguration cmsConfiguration, ISessionFactoryProvider sessionFactoryProvider, IUnitOfWork unitOfWork)
{
Repository = repository;
this.cmsConfiguration = cmsConfiguration;
this.sessionFactoryProvider = sessionFactoryProvider;
this.unitOfWork = unitOfWork;
}
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:7,代码来源:DefaultCategoryNodeService.cs
示例12: Up
/// <summary>
/// Ups the specified configuration.
/// </summary>
/// <param name="configuration">The configuration.</param>
public override void Up(ICmsConfiguration configuration)
{
using (var api = CmsContext.CreateApiContextOf<MigrationApiContext>())
{
api.UpdateFolderContentTypes();
}
}
开发者ID:tkirda,项目名称:BetterCMS,代码行数:11,代码来源:Migration201306201216.cs
示例13: DefaultWebCrawlerService
public DefaultWebCrawlerService(ICmsConfiguration cmsConfiguration)
{
this.cmsConfiguration = cmsConfiguration;
webServer = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneWebSiteUrl) ?? string.Empty;
bool.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexPrivatePages), out indexPrivatePages);
if (indexPrivatePages)
{
var authModeString = cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneAuthorizationMode);
if (!string.IsNullOrWhiteSpace(authModeString))
{
switch (authModeString.ToLower().Trim())
{
case "windows":
authMode = AuthMode.Windows;
break;
default:
authMode = AuthMode.Forms;
break;
}
}
}
HtmlAgilityPackHelper.FixMissingTagClosings();
TimeSpan timeout;
if (TimeSpan.TryParse(cmsConfiguration.Search.GetValue(LuceneSearchConstants.ConfigurationKeys.LuceneIndexerPageFetchTimeout), out timeout)
&& timeout > TimeSpan.FromSeconds(0))
{
fetchTimeout = timeout;
}
}
开发者ID:devbridge,项目名称:BetterCMS,代码行数:34,代码来源:DefaultWebCrawlerService.cs
示例14: WindowsAzureStorageService
public WindowsAzureStorageService(ICmsConfiguration config)
{
try
{
var serviceSection = config.Storage;
string accountName = serviceSection.GetValue("AzureAccountName");
string secretKey = serviceSection.GetValue("AzureSecondaryKey");
bool useHttps = bool.Parse(serviceSection.GetValue("AzureUseHttps"));
if (!TimeSpan.TryParse(serviceSection.GetValue("AzureTokenExpiryTime"), out tokenExpiryTime))
{
tokenExpiryTime = TimeSpan.FromMinutes(10);
}
timeout = serviceSection.ProcessTimeout;
accessControlEnabledGlobally = config.Security.AccessControlEnabled;
containerName = serviceSection.GetValue("AzureContainerName");
securedContainerName = serviceSection.GetValue("AzureSecuredContainerName");
if (string.IsNullOrWhiteSpace(securedContainerName))
{
securedContainerName = containerName;
}
cloudStorageAccount = new CloudStorageAccount(new StorageCredentials(accountName, secretKey), useHttps);
}
catch (Exception e)
{
throw new StorageException(string.Format("Failed to initialize storage service {0}.", GetType()), e);
}
}
开发者ID:vivekmalikymca,项目名称:BetterCMS,代码行数:31,代码来源:WindowsAzureStorageService.cs
示例15: UploadFileService
public UploadFileService(IRepository repository, IMediaFileService mediaFileService, IAccessControlService accessControlService, ICmsConfiguration configuration)
{
this.repository = repository;
this.mediaFileService = mediaFileService;
this.accessControlService = accessControlService;
this.configuration = configuration;
}
开发者ID:wezmag,项目名称:BetterCMS,代码行数:7,代码来源:UploadFileService.cs
示例16: RegisterStyleSheetFiles
public override System.Collections.Generic.IEnumerable<string> RegisterStyleSheetFiles(Autofac.ContainerBuilder containerBuilder, ICmsConfiguration configuration)
{
return new[]
{
"/file/bcms-blog/Content/Styles/bcms.blog.css"
};
}
开发者ID:pmaciulis,项目名称:BetterCMS,代码行数:7,代码来源:BlogModuleDescriptor.cs
示例17: RegisterModuleTypes
/// <summary>
/// Registers module types.
/// </summary>
/// <param name="context">The area registration context.</param>
/// <param name="containerBuilder">The container builder.</param>
/// <param name="configuration">The configuration.</param>
public override void RegisterModuleTypes(ModuleRegistrationContext context, ContainerBuilder containerBuilder, ICmsConfiguration configuration)
{
if (configuration.Cache.CacheType == CacheServiceType.Auto)
{
containerBuilder.RegisterType<AppFabricCacheService>().As<ICacheService>().SingleInstance();
}
}
开发者ID:pmaciulis,项目名称:BetterCMS,代码行数:13,代码来源:AppFabricCacheModuleDescriptor.cs
示例18: RegisterJavaScriptModules
public override System.Collections.Generic.IEnumerable<JavaScriptModuleDescriptor> RegisterJavaScriptModules(Autofac.ContainerBuilder containerBuilder, ICmsConfiguration configuration)
{
return new[]
{
blogJavaScriptModuleDescriptor
};
}
开发者ID:pmaciulis,项目名称:BetterCMS,代码行数:7,代码来源:BlogModuleDescriptor.cs
示例19: BlogModuleDescriptor
/// <summary>
/// Initializes a new instance of the <see cref="BlogModuleDescriptor" /> class.
/// </summary>
public BlogModuleDescriptor(ICmsConfiguration configuration)
: base(configuration)
{
blogJsModuleIncludeDescriptor = new BlogJsModuleIncludeDescriptor(this);
Events.RootEvents.Instance.PageRetrieved += Events_PageRetrieved;
}
开发者ID:navid60,项目名称:BetterCMS,代码行数:10,代码来源:BlogModuleDescriptor.cs
示例20: DefaultIndexerService
public DefaultIndexerService(ICmsConfiguration cmsConfiguration, IRepository repository, ISecurityService securityService, IAccessControlService accessControlService)
{
this.repository = repository;
this.cmsConfiguration = cmsConfiguration;
this.securityService = securityService;
this.accessControlService = accessControlService;
}
开发者ID:JMFURY,项目名称:BetterCMS,代码行数:7,代码来源:DefaultIndexerService.cs
注:本文中的ICmsConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论