本文整理汇总了C#中IContentManager类的典型用法代码示例。如果您正苦于以下问题:C# IContentManager类的具体用法?C# IContentManager怎么用?C# IContentManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IContentManager类属于命名空间,在下文中一共展示了IContentManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
var newCameraFirstPerson = new CameraStatic(new Vector3(100,100,100), - new Vector3(100,100,100) );
this.World.CameraManager.AddCamera(newCameraFirstPerson);
SimpleConcreteGestureInputPlayable SimpleConcreteGestureInputPlayable = new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.DoubleTap, (sample) => doubleTapCount++);
this.BindInput(SimpleConcreteGestureInputPlayable);
this.BindInput(new SimpleConcreteGestureInputPlayable(Microsoft.Xna.Framework.Input.Touch.GestureType.Hold,
(sample) =>
{
this.RemoveInputBinding(SimpleConcreteGestureInputPlayable);
doubleTapDisabled = true;
}
));
}
示例2: PublicationService
public PublicationService(IOrchardServices orchardServices, IContentManager contentManager, IShapeFactory shapeFactory, ISiteService siteService)
{
_orchardServices = orchardServices;
_contentManager = contentManager;
_shapeFactory = shapeFactory;
_siteService = siteService;
}
示例3: ContentDisplayAlchemyProvider
public ContentDisplayAlchemyProvider(
IContentManager contentManager,
IOrigamiService origamiService
) {
_contentManager = contentManager;
_origami = origamiService;
}
示例4: LoadContent
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory ,IContentManager contentManager)
{
///cast to out world instance
PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld;
base.LoadContent(GraphicInfo, factory, contentManager);
{
SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
///Physic Triangle mesh (same as bepu)
PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld,simpleModel,
Matrix.Identity, Vector3.One);
ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
ForwardMaterial fmaterial = new ForwardMaterial(shader);
IObject obj = new IObject(fmaterial, simpleModel, tmesh);
this.World.AddObject(obj);
}
///Ball Throw !!!
BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory);
this.AttachCleanUpAble(BallThrowBullet);
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
}
示例5: TermsPartHandler
public TermsPartHandler(
IContentDefinitionManager contentDefinitionManager,
IRepository<TermsPartRecord> repository,
ITaxonomyService taxonomyService,
IContentManager contentManager,
IProcessingEngine processingEngine,
ShellSettings shellSettings,
IShellDescriptorManager shellDescriptorManager) {
_contentDefinitionManager = contentDefinitionManager;
_contentManager = contentManager;
Filters.Add(StorageFilter.For(repository));
OnPublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
OnUnpublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
OnRemoved<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
// Tells how to load the field terms on demand, when a content item it loaded or when it has been created
OnInitialized<TermsPart>((context, part) => InitializerTermsLoader(part));
OnLoading<TermsPart>((context, part) => InitializerTermsLoader(part));
OnUpdating<TermsPart>((context, part) => InitializerTermsLoader(part));
OnIndexing<TermsPart>(
(context, part) => {
foreach (var term in part.Terms) {
var termContentItem = context.ContentManager.Get(term.TermRecord.Id);
context.DocumentIndex.Add(term.Field, termContentItem.As<TitlePart>().Title).Analyze();
context.DocumentIndex.Add(term.Field + "-id", termContentItem.Id).Store();
// tag the current content item with all parent terms
foreach (var parent in taxonomyService.GetParents(termContentItem.As<TermPart>())) {
context.DocumentIndex.Add(term.Field + "-id", parent.Id).Store();
}
}
});
}
示例6: Init
public void Init() {
var builder = new ContainerBuilder();
// builder.RegisterModule(new ImplicitCollectionSupportModule());
builder.RegisterModule(new ContentModule());
builder.RegisterType<DefaultContentManager>().As<IContentManager>().SingleInstance();
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
builder.RegisterType<AlphaHandler>().As<IContentHandler>();
builder.RegisterType<BetaHandler>().As<IContentHandler>();
builder.RegisterType<GammaHandler>().As<IContentHandler>();
builder.RegisterType<DeltaHandler>().As<IContentHandler>();
builder.RegisterType<EpsilonHandler>().As<IContentHandler>();
builder.RegisterType<FlavoredHandler>().As<IContentHandler>();
builder.RegisterType<StyledHandler>().As<IContentHandler>();
builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));
_session = _sessionFactory.OpenSession();
builder.RegisterInstance(new DefaultContentManagerTests.TestSessionLocator(_session)).As<ISessionLocator>();
_session.Delete(string.Format("from {0}", typeof(GammaRecord).FullName));
_session.Delete(string.Format("from {0}", typeof(DeltaRecord).FullName));
_session.Delete(string.Format("from {0}", typeof(EpsilonRecord).FullName));
_session.Delete(string.Format("from {0}", typeof(ContentItemVersionRecord).FullName));
_session.Delete(string.Format("from {0}", typeof(ContentItemRecord).FullName));
_session.Delete(string.Format("from {0}", typeof(ContentTypeRecord).FullName));
_session.Flush();
_session.Clear();
_container = builder.Build();
_manager = _container.Resolve<IContentManager>();
}
示例7: CodeSamplesFilterController
public CodeSamplesFilterController(ICommonDataService commonDataService, ITaxonomyService taxonomyService, IContentManager contentManager)
{
_commonDataService = commonDataService;
_taxonomyService = taxonomyService;
_contentManager = contentManager;
Logger = NullLogger.Instance;
}
示例8: LoadContent
/// <summary>
/// Load content for the screen.
/// </summary>
/// <param name="GraphicInfo"></param>
/// <param name="factory"></param>
/// <param name="contentManager"></param>
protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
{
base.LoadContent(GraphicInfo, factory, contentManager);
{
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
float x, y;
x = -i * 100;
y = -j * 100;
TreeModel tm = new TreeModel(factory, "Trees\\Pine", null, null);
ForwardTreeShader ts = new ForwardTreeShader();
TreeMaterial tmat = new TreeMaterial(ts, new WindStrengthSin());
GhostObject go = new GhostObject(new Vector3(x, 0, y), Matrix.Identity, new Vector3(0.05f));
IObject ox = new IObject(tmat, tm, go);
this.World.AddObject(ox);
}
}
}
///add a camera
this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo.Viewport));
}
示例9: ThreadPartHandler
public ThreadPartHandler(IRepository<ThreadPartRecord> repository,
IPostService postService,
IThreadService threadService,
IForumService forumService,
IContentManager contentManager)
{
_postService = postService;
_threadService = threadService;
_forumService = forumService;
_contentManager = contentManager;
Filters.Add(StorageFilter.For(repository));
OnGetDisplayShape<ThreadPart>(SetModelProperties);
OnGetEditorShape<ThreadPart>(SetModelProperties);
OnUpdateEditorShape<ThreadPart>(SetModelProperties);
OnActivated<ThreadPart>(PropertySetHandlers);
OnLoading<ThreadPart>((context, part) => LazyLoadHandlers(part));
OnCreated<ThreadPart>((context, part) => UpdateForumPartCounters(part));
OnPublished<ThreadPart>((context, part) => UpdateForumPartCounters(part));
OnUnpublished<ThreadPart>((context, part) => UpdateForumPartCounters(part));
OnVersioning<ThreadPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
OnVersioned<ThreadPart>((context, part, newVersionPart) => UpdateForumPartCounters(newVersionPart));
OnRemoved<ThreadPart>((context, part) => UpdateForumPartCounters(part));
OnRemoved<ForumPart>((context, b) =>
_threadService
.Get(context.ContentItem.As<ForumPart>())
.ToList()
.ForEach(thread => context.ContentManager.Remove(thread.ContentItem)));
}
示例10: PlacementService
public PlacementService(
IContentManager contentManager,
ISiteThemeService siteThemeService,
IExtensionManager extensionManager,
IShapeFactory shapeFactory,
IShapeTableLocator shapeTableLocator,
RequestContext requestContext,
IEnumerable<IContentPartDriver> contentPartDrivers,
IEnumerable<IContentFieldDriver> contentFieldDrivers,
IVirtualPathProvider virtualPathProvider,
IWorkContextAccessor workContextAccessor
)
{
_contentManager = contentManager;
_siteThemeService = siteThemeService;
_extensionManager = extensionManager;
_shapeFactory = shapeFactory;
_shapeTableLocator = shapeTableLocator;
_requestContext = requestContext;
_contentPartDrivers = contentPartDrivers;
_contentFieldDrivers = contentFieldDrivers;
_virtualPathProvider = virtualPathProvider;
_workContextAccessor = workContextAccessor;
Logger = NullLogger.Instance;
}
示例11: ContentController
public ContentController(IAuthorizer authorizer, IContentManager contentManager, INotifier notifier, IContentDefinitionManager contentDefinitionManager) {
_authorizer = authorizer;
_contentManager = contentManager;
_notifier = notifier;
_contentDefinitionManager = contentDefinitionManager;
T = NullLocalizer.Instance;
}
示例12: ApiController
public ApiController(
IContentManager contentManager,
IAuthorizationService authorizationService)
{
_authorizationService = authorizationService;
_contentManager = contentManager;
}
示例13: AdminController
public AdminController(IContentManager contentManager,
IOrchardServices services,
IShapeFactory shapeFactory,
IContentDefinitionManager contentDefinitionManager,
IRemoteContentFetchService remoteContentFetchService,
ISynchronisationMapFactory synchronisationMapFactory,
IRepository<ContentSyncSettings> contentSyncSettingsRepository,
ISignals signals,
ILoggerFactory loggerFactory,
ICacheManager cacheManager,
IImportExportService importExportService,
IRecipeParser recipeParser,
IRemoteImportService remoteImportService,
IEnumerable<IHardComparer> hardComparers,
IEnumerable<ISoftComparer> softComparers) {
_contentManager = contentManager;
_services = services;
_shapeFactory = shapeFactory;
_contentDefinitionManager = contentDefinitionManager;
_remoteContentFetchService = remoteContentFetchService;
_synchronisationMapFactory = synchronisationMapFactory;
_contentSyncSettingsRepository = contentSyncSettingsRepository;
_signals = signals;
_loggerFactory = loggerFactory;
_cacheManager = cacheManager;
_importExportService = importExportService;
_recipeParser = recipeParser;
_remoteImportService = remoteImportService;
_hardComparers = hardComparers;
_softComparers = softComparers;
Logger = loggerFactory.CreateLogger(typeof (AdminController));
}
示例14: AdvancedSitemapService
public AdvancedSitemapService(
IRepository<SitemapRouteRecord> routeRepository,
IRepository<SitemapSettingsRecord> settingsRepository,
IRepository<SitemapCustomRouteRecord> customRouteRepository,
IContentManager contentManager,
ICacheManager cacheManager,
ISignals signals,
IClock clock,
IContentDefinitionManager contentDefinitionManager,
IEnumerable<ISitemapRouteFilter> routeFilters,
IEnumerable<ISitemapRouteProvider> routeProviders,
ISiteService siteService,
IEnumerable<ISpecializedSitemapProvider> specializedSitemapProviders)
{
_routeRepository = routeRepository;
_settingsRepository = settingsRepository;
_customRouteRepository = customRouteRepository;
_contentManager = contentManager;
_cacheManager = cacheManager;
_signals = signals;
_clock = clock;
_contentDefinitionManager = contentDefinitionManager;
_routeFilters = routeFilters;
_routeProviders = routeProviders;
_siteService = siteService;
_specializedSitemapProviders = specializedSitemapProviders;
}
示例15: CommentsPartHandler
public CommentsPartHandler(
IContentManager contentManager,
IRepository<CommentsPartRecord> commentsRepository,
ICommentService commentService) {
Filters.Add(StorageFilter.For(commentsRepository));
OnInitializing<CommentsPart>((ctx, part) => {
part.CommentsActive = true;
part.CommentsShown = true;
part.Comments = new List<CommentPart>();
});
OnLoading<CommentsPart>((context, comments) => {
comments.CommentsField.Loader(list => contentManager
.Query<CommentPart, CommentPartRecord>()
.Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Approved)
.OrderBy(x => x.Position)
.List().ToList());
comments.PendingCommentsField.Loader(list => contentManager
.Query<CommentPart, CommentPartRecord>()
.Where(x => x.CommentsPartRecord == context.ContentItem.As<CommentsPart>().Record && x.Status == CommentStatus.Pending)
.List().ToList());
});
OnRemoved<CommentsPart>(
(context, c) => {
var comments = commentService.GetCommentsForCommentedContent(context.ContentItem.Id).List();
foreach (var comment in comments) {
contentManager.Remove(comment.ContentItem);
}
});
}