本文整理汇总了C#中Orchard.Environment.Descriptor.Models.ShellDescriptor类的典型用法代码示例。如果您正苦于以下问题:C# ShellDescriptor类的具体用法?C# ShellDescriptor怎么用?C# ShellDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ShellDescriptor类属于Orchard.Environment.Descriptor.Models命名空间,在下文中一共展示了ShellDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdminController
public AdminController(
IEnumerable<IExtensionDisplayEventHandler> extensionDisplayEventHandlers,
IOrchardServices services,
IModuleService moduleService,
IDataMigrationManager dataMigrationManager,
IReportsCoordinator reportsCoordinator,
IExtensionManager extensionManager,
IFeatureManager featureManager,
IRecipeHarvester recipeHarvester,
IRecipeManager recipeManager,
ShellDescriptor shellDescriptor,
ShellSettings shellSettings,
IShapeFactory shapeFactory)
{
Services = services;
_extensionDisplayEventHandler = extensionDisplayEventHandlers.FirstOrDefault();
_moduleService = moduleService;
_dataMigrationManager = dataMigrationManager;
_reportsCoordinator = reportsCoordinator;
_extensionManager = extensionManager;
_featureManager = featureManager;
_recipeHarvester = recipeHarvester;
_recipeManager = recipeManager;
_shellDescriptor = shellDescriptor;
_shellSettings = shellSettings;
Shape = shapeFactory;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
}
示例2: foreach
void IShellDescriptorManagerEventHandler.Changed(ShellDescriptor descriptor, string tenant) {
// deduce and apply state changes involved
var shellState = _stateManager.GetShellState();
foreach (var feature in descriptor.Features) {
var featureName = feature.Name;
var featureState = shellState.Features.SingleOrDefault(f => f.Name == featureName);
if (featureState == null) {
featureState = new ShellFeatureState {
Name = featureName
};
shellState.Features = shellState.Features.Concat(new[] { featureState });
}
if (!featureState.IsInstalled) {
_stateManager.UpdateInstalledState(featureState, ShellFeatureState.State.Rising);
}
if (!featureState.IsEnabled) {
_stateManager.UpdateEnabledState(featureState, ShellFeatureState.State.Rising);
}
}
foreach (var featureState in shellState.Features) {
var featureName = featureState.Name;
if (descriptor.Features.Any(f => f.Name == featureName)) {
continue;
}
if (!featureState.IsDisabled) {
_stateManager.UpdateEnabledState(featureState, ShellFeatureState.State.Falling);
}
}
FireApplyChangesIfNeeded();
}
示例3: Store
public void Store(string name, ShellDescriptor descriptor) {
if (Disabled) {
return;
}
lock (_synLock) {
VerifyCacheFile();
var text = _appDataFolder.ReadFile(DescriptorCacheFileName);
bool tenantCacheUpdated = false;
var saveWriter = new StringWriter();
var xmlDocument = new XmlDocument();
xmlDocument.LoadXml(text);
XmlNode rootNode = xmlDocument.DocumentElement;
if (rootNode != null) {
foreach (XmlNode tenantNode in rootNode.ChildNodes) {
if (String.Equals(tenantNode.Name, name, StringComparison.OrdinalIgnoreCase)) {
tenantNode.InnerText = GetCacheTextForShellDescriptor(descriptor);
tenantCacheUpdated = true;
break;
}
}
if (!tenantCacheUpdated) {
XmlElement newTenant = xmlDocument.CreateElement(name);
newTenant.InnerText = GetCacheTextForShellDescriptor(descriptor);
rootNode.AppendChild(newTenant);
}
}
xmlDocument.Save(saveWriter);
_appDataFolder.CreateFile(DescriptorCacheFileName, saveWriter.ToString());
}
}
示例4: FeatureCommands
public FeatureCommands(IModuleService moduleService, INotifier notifier, IFeatureManager featureManager, ShellDescriptor shellDescriptor)
{
_moduleService = moduleService;
_notifier = notifier;
_featureManager = featureManager;
_shellDescriptor = shellDescriptor;
}
示例5: AdminController
public AdminController(
IEnumerable<IExtensionDisplayEventHandler> extensionDisplayEventHandlers,
IOrchardServices services,
IDataMigrationManager dataMigraitonManager,
IFeatureManager featureManager,
ISiteThemeService siteThemeService,
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor,
IPreviewTheme previewTheme,
IThemeService themeService,
IReportsCoordinator reportsCoordinator) {
Services = services;
_extensionDisplayEventHandler = extensionDisplayEventHandlers.FirstOrDefault();
_dataMigrationManager = dataMigraitonManager;
_siteThemeService = siteThemeService;
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
_featureManager = featureManager;
_previewTheme = previewTheme;
_themeService = themeService;
_reportsCoordinator = reportsCoordinator;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
}
示例6: ShapePlacementParsingStrategy
public ShapePlacementParsingStrategy(
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor,
IPlacementFileParser placementFileParser) {
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
_placementFileParser = placementFileParser;
}
示例7: ThemeCommands
public ThemeCommands(IDataMigrationManager dataMigrationManager,
ISiteThemeService siteThemeService,
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor,
IThemeService themeService) {
_dataMigrationManager = dataMigrationManager;
_siteThemeService = siteThemeService;
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
_themeService = themeService;
}
示例8: ShapePlacementParsingStrategy
public ShapePlacementParsingStrategy(
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor,
IPlacementFileParser placementFileParser,
IEnumerable<IPlacementPredicateProvider> predicateBuilders,
IPlacementAlterationProvider alterationBuilder) {
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
_placementFileParser = placementFileParser;
_predicateBuilders = predicateBuilders;
_alterationBuilder = alterationBuilder;
}
示例9:
string IProcessingEngine.AddTask(ShellSettings shellSettings, ShellDescriptor shellDescriptor, string messageName, Dictionary<string, object> parameters)
{
_addedTasks.Add(new ProcessingEngineTask
{
ShellSettings = shellSettings,
ShellDescriptor = shellDescriptor,
MessageName = messageName,
Parameters = parameters
});
// As in DefaultProcessingEngine.
return Guid.NewGuid().ToString("n");
}
示例10: ThemeAwareViewEngine
public ThemeAwareViewEngine(
WorkContext workContext,
IEnumerable<IViewEngineProvider> viewEngineProviders,
IConfiguredEnginesCache configuredEnginesCache,
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor) {
_workContext = workContext;
_viewEngineProviders = viewEngineProviders;
_configuredEnginesCache = configuredEnginesCache;
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
Logger = NullLogger.Instance;
}
示例11: AdminController
public AdminController(
IOrchardServices orchardServices,
ISettingsService settingsService,
IExtensionManager extensionManager,
ShellDescriptor shellDescriptor,
IEnumerable<IThemeSelectionRule> rules) {
Services = orchardServices;
_settingsService = settingsService;
_extensionManager = extensionManager;
_shellDescriptor = shellDescriptor;
_rules = rules;
T = NullLocalizer.Instance;
}
示例12: AdminController
public AdminController(
IEnumerable<Orchard.Modules.Events.IExtensionDisplayEventHandler> extensionDisplayEventHandlers,
IOrchardServices services,
IModuleService moduleService,
IDataMigrationManager dataMigrationManager,
IReportsCoordinator reportsCoordinator,
IExtensionManager extensionManager,
IFeatureManager featureManager,
IRecipeHarvester recipeHarvester,
IRecipeManager recipeManager,
ShellDescriptor shellDescriptor,
ShellSettings shellSettings,
IShapeFactory shapeFactory,
IPackageService packageService,
IMimeTypeProvider mimeTypeProvider,
ISiteThemeService siteThemeService,
IThemeService themeService)
{
Services = services;
_extensionDisplayEventHandler = extensionDisplayEventHandlers.FirstOrDefault();
_moduleService = moduleService;
_dataMigrationManager = dataMigrationManager;
_reportsCoordinator = reportsCoordinator;
_extensionManager = extensionManager;
_featureManager = featureManager;
_recipeHarvester = recipeHarvester;
_recipeManager = recipeManager;
_shellDescriptor = shellDescriptor;
_shellSettings = shellSettings;
Shape = shapeFactory;
_packageService = packageService;
_mimeTypeProvider = mimeTypeProvider;
_siteThemeService = siteThemeService;
_themeService = themeService;
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
_tempPackageStoragePath = new Lazy<string>(() =>
{
var path = HostingEnvironment.MapPath("~/App_Data/Packages");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(path);
}
return path;
});
}
示例13: GetShellDescriptor
public ShellDescriptor GetShellDescriptor()
{
var shellDescriptor = ShellDescriptor;
if (shellDescriptor == null)
{
var defaultShellDescriptor = _defaultTransientShellDescriptorProvider.GetDefaultShellDescriptor();
if (defaultShellDescriptor != null)
{
shellDescriptor = ShellDescriptor = defaultShellDescriptor;
}
}
return shellDescriptor;
}
示例14: CreateDescribedContext
public ShellContext CreateDescribedContext(ShellSettings settings, ShellDescriptor shellDescriptor)
{
Logger.Debug("Creating described context for tenant {0}", settings.Name);
var blueprint = _compositionStrategy.Compose(settings, shellDescriptor);
var shellScope = _shellContainerFactory.CreateContainer(settings, blueprint);
return new ShellContext
{
Settings = settings,
Descriptor = shellDescriptor,
Blueprint = blueprint,
LifetimeScope = shellScope,
Shell = shellScope.Resolve<IOrchardShell>()
};
}
示例15: AddTask
public string AddTask(ShellSettings shellSettings, ShellDescriptor shellDescriptor, string eventName, Dictionary<string, object> parameters) {
var entry = new Entry {
ShellSettings = shellSettings,
ShellDescriptor = shellDescriptor,
MessageName = eventName,
EventData = parameters,
TaskId = Guid.NewGuid().ToString("n"),
ProcessId = Guid.NewGuid().ToString("n"),
};
Logger.Information("Adding event {0} to process {1} for shell {2}",
eventName,
entry.ProcessId,
shellSettings.Name);
_entries.GetState().Add(entry);
return entry.ProcessId;
}