本文整理汇总了C#中IDefinitionManager类的典型用法代码示例。如果您正苦于以下问题:C# IDefinitionManager类的具体用法?C# IDefinitionManager怎么用?C# IDefinitionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDefinitionManager类属于命名空间,在下文中一共展示了IDefinitionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopularityReordererScheduledAction
public PopularityReordererScheduledAction(IDefinitionManager definitions, IPersister persister, IHost host, PopularityChildrenSorter sorter)
{
this.definitions = definitions;
this.persister = persister;
this.host = host;
this.sorter = sorter;
}
示例2: DiagnosticController
public DiagnosticController(IContentItemRepository repository, IHost host, IDefinitionManager definitions,
ILinkGenerator linkGenerator, IUrlParser parser, DatabaseSection config, IFlushable flushable, IReplicationStorage repstore,
IFileSystemFactory fileSystemFactory)
{
_repository = repository;
_host = host;
_definitions = definitions;
_linkGenerator = linkGenerator;
_parser = parser;
_flushable = flushable;
_tablePrefix = config.TablePrefix;
_repstore = repstore;
if (_forceWriteLockManager != null) return;
// Create Force Write Lock Manager
var storageConfig = (FileSystemNamespace) Enum.Parse(typeof (FileSystemNamespace),
ConfigurationManager.AppSettings["AzureReplicationStorageContainerName"] ??
"ReplicationStorageDebug");
var fileSystem = fileSystemFactory.Create(storageConfig);
_forceWriteLockManager = new ReplicationForceWriteLockManager(fileSystem);
_writeLockManager = new ReplicationWriteLockManager(fileSystem);
}
示例3: DirectUrlInjector
public DirectUrlInjector(IHost host, IUrlParser parser, IContentItemRepository repository, IDefinitionManager definitions)
{
this.host = host;
this.parser = parser;
this.repository = repository;
this.definitions = definitions;
}
示例4: ControllerMapper
public ControllerMapper(ITypeFinder typeFinder, IDefinitionManager definitionManager)
{
IList<ControlsAttribute> controllerDefinitions = FindControllers(typeFinder);
foreach (ItemDefinition id in definitionManager.GetDefinitions())
{
IAdapterDescriptor controllerDefinition = GetControllerFor(id, controllerDefinitions);
if(controllerDefinition != null)
{
ControllerMap[id.ItemType] = controllerDefinition.ControllerName;
// interacting with static context is tricky, here I made the assumtion that the last
// finder is the most relevat and takes the place of previous ones, this makes a few
// tests pass and doesn't seem to be called in production
foreach (var finder in PathDictionary.GetFinders(id.ItemType).Where(f => f is ActionResolver))
PathDictionary.RemoveFinder(id.ItemType, finder);
// Use MVC's ReflectedControllerDescriptor to find all actions on the Controller
var methods = new ReflectedControllerDescriptor(controllerDefinition.AdapterType)
.GetCanonicalActions()
.Select(m => m.ActionName).ToArray();
var actionResolver = new ActionResolver(this, methods);
_controllerActionMap[controllerDefinition.ControllerName] = methods;
PathDictionary.PrependFinder(id.ItemType, actionResolver);
}
}
}
示例5: GetDefinition
public virtual ItemDefinition GetDefinition(IDefinitionManager definitions)
{
foreach (ItemDefinition definition in definitions.GetDefinitions())
if (definition.Discriminator == ItemDiscriminator)
return definition;
return null;
}
示例6: ItemXmlReader
public ItemXmlReader(IDefinitionManager definitions, ContentActivator activator, IRepository<ContentItem> repository)
{
this.definitions = definitions;
this.activator = activator;
this.readers = DefaultReaders();
this.repository = repository;
}
示例7: LanguageInterceptor
public LanguageInterceptor(IPersister persister, IDefinitionManager definitions, IWebContext context, ILanguageGateway gateway)
{
this.persister = persister;
this.definitions = definitions;
this.context = context;
this.gateway = gateway;
}
示例8: Populate
public override void Populate(IDefinitionManager definitionManager, IPlanet planet, IChunkColumn column00, IChunkColumn column10, IChunkColumn column01, IChunkColumn column11)
{
// Tree Definitions initialisieren
if (treeDefinitions == null)
{
treeDefinitions = definitionManager.GetDefinitions<ITreeDefinition>().OrderBy(d => d.Order).ToArray();
foreach (var treeDefinition in treeDefinitions)
treeDefinition.Init(definitionManager);
}
int salt = (column00.Index.X & 0xffff) + ((column00.Index.Y & 0xffff) << 16);
Random random = new Random(planet.Seed + salt);
Index3 sample = new Index3(column00.Index.X * Chunk.CHUNKSIZE_X, column00.Index.Y * Chunk.CHUNKSIZE_Y, column00.Heights[0, 0]);
foreach (var treeDefinition in treeDefinitions)
{
int density = treeDefinition.GetDensity(planet, sample);
if (density <= 0) continue;
for (int i = 0; i < density; i++)
{
int x = random.Next(Chunk.CHUNKSIZE_X / 2, Chunk.CHUNKSIZE_X * 3 / 2);
int y = random.Next(Chunk.CHUNKSIZE_Y / 2, Chunk.CHUNKSIZE_Y * 3 / 2);
int z = LocalBuilder.GetSurfaceHeight(column00, column10, column01, column11, x, y);
LocalBuilder builder = new LocalBuilder(x, y, z + 1, column00, column10, column01, column11);
treeDefinition.PlantTree(definitionManager, planet, new Index3(x, y, z), builder, random.Next(int.MaxValue));
}
}
}
示例9: SetUp
public void SetUp()
{
parentDefinition = new ItemDefinition(typeof(DefinitionControllingParent)) { TemplateKey = "List" };
childDefinition = new ItemDefinition(typeof(DefinitionOppressedChild)) { TemplateKey = "Wide" };
definitions = MockRepository.GenerateStub<IDefinitionManager>();
definitions.Expect(d => d.GetDefinitions()).Return(new[] { parentDefinition, childDefinition }).Repeat.Any();
}
示例10: FixZoneNamePartsMigration
public FixZoneNamePartsMigration(IContentItemRepository repository, IDefinitionManager definitions)
{
this.repository = repository;
this.definitions = definitions;
Title = "Fixes zone name on parts with null zone name";
Description = "In the database parts are defined by having a non-null ZoneName property. This migrations updates parts which have a null zone name and changes it to empty string.";
}
示例11: EditableItemMigration
public EditableItemMigration(IDefinitionManager definitions, IRepository<ContentItem> itemRepository)
{
this.definitions = definitions;
this.itemRepository = itemRepository;
Title = "Upgrade parts and pages using [EditableItem]";
Description = "This migration will change the name of sub-items and remove the reference from the containing page.";
}
示例12: AllowedBelow
public static IEnumerable<TemplateDefinition> AllowedBelow(this IEnumerable<TemplateDefinition> allTemplates, ItemDefinition parentDefinition, ContentItem parentItem, IDefinitionManager definitions)
{
foreach (var template in allTemplates)
{
if (IsAllowed(template.Definition, parentItem, parentDefinition, definitions))
yield return template;
}
}
示例13: PartsModifyingAjaxService
protected PartsModifyingAjaxService(Navigator navigator, IIntegrityManager integrity, IVersionManager versions, ContentVersionRepository versionRepository, IDefinitionManager definitionManager)
{
this.navigator = navigator;
this.integrity = integrity;
this.versions = versions;
this.versionRepository = versionRepository;
this.definitionManager = definitionManager;
}
示例14: CreateUrlProvider
public CreateUrlProvider(IPersister persister, IEditUrlManager editUrlManager, IDefinitionManager definitions, AjaxRequestDispatcher dispatcher, Navigator navigator)
: base(dispatcher)
{
this.persister = persister;
this.editUrlManager = editUrlManager;
this.definitions = definitions;
this.navigator = navigator;
}
示例15: CreateUrlProvider
public CreateUrlProvider(IPersister persister, IEditUrlManager editUrlManager, IDefinitionManager definitions, ContentActivator activator, Navigator navigator)
{
this.persister = persister;
this.managementPaths = editUrlManager;
this.definitions = definitions;
this.activator = activator;
this.navigator = navigator;
}