public MediaLibraryPickerFieldHandler(
     IContentManager contentManager, 
     IContentDefinitionManager contentDefinitionManager) {
     
     _contentManager = contentManager;
     _contentDefinitionManager = contentDefinitionManager;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StationaryGrhData"/> class.
 /// </summary>
 /// <param name="autoGrhData">The <see cref="AutomaticAnimatedGrhData"/>.</param>
 /// <param name="assetName">Name of the asset.</param>
 internal StationaryGrhData(AutomaticAnimatedGrhData autoGrhData, TextureAssetName assetName)
     : base(autoGrhData.Categorization)
 {
     _cm = autoGrhData.ContentManager;
     _textureName = assetName;
     AutomaticSize = true;
 }
        /// <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);

            ///Uncoment to add your model
            SimpleModel simpleModel = new SimpleModel(factory, "Model/cenario");
            ///Physic info (position, rotation and scale are set here)
            TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
            ///Forward Shader (look at this shader construction for more info)
            ForwardXNABasicShader shader = new ForwardXNABasicShader();
            ///Deferred material
            ForwardMaterial fmaterial = new ForwardMaterial(shader);
            ///The object itself
            IObject obj = new IObject(fmaterial, simpleModel, tmesh);
            ///Add to the world
            this.World.AddObject(obj);

            ///add a camera
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));

            ///task sample
            taskSample taskSample = new taskSample();
            ///when ended, call this (syncronous -- specified in the itask implementation) function
            taskSample.Ended += new Action<ITask, IAsyncResult>(taskSample_Ended);
            ///create and send the task to the processor
            TaskCommand TaskCommand = new TaskCommand(taskSample);
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(TaskCommand);
        }
        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;
                    }
            ));
        }
 public ContentDisplayAlchemyProvider(
     IContentManager contentManager,
     IOrigamiService origamiService
 ) {
     _contentManager = contentManager;
     _origami = origamiService;
 }
Exemplo n.º 6
0
 public RateController(IOrchardServices orchardServices, IContentManager contentManager, IVotingService votingService)
 {
     _orchardServices = orchardServices;
     _contentManager = contentManager;
     _votingService = votingService;
     T = NullLocalizer.Instance;
 }
Exemplo n.º 7
0
 public PublicationService(IOrchardServices orchardServices, IContentManager contentManager, IShapeFactory shapeFactory, ISiteService siteService)
 {
     _orchardServices = orchardServices;
     _contentManager = contentManager;
     _shapeFactory = shapeFactory;
     _siteService = siteService;
 }
Exemplo n.º 8
0
        public void Init() {
            _contentDefinitionManager = new Mock<IContentDefinitionManager>();

            var builder = new ContainerBuilder();
            builder.RegisterType<DefaultContentManager>().As<IContentManager>();
            builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
            builder.RegisterInstance(_contentDefinitionManager.Object);
            builder.RegisterInstance(new Mock<IContentDisplay>().Object);

            builder.RegisterType<AlphaPartHandler>().As<IContentHandler>();
            builder.RegisterType<BetaPartHandler>().As<IContentHandler>();
            builder.RegisterType<GammaPartHandler>().As<IContentHandler>();
            builder.RegisterType<DeltaPartHandler>().As<IContentHandler>();
            builder.RegisterType<EpsilonPartHandler>().As<IContentHandler>();
            builder.RegisterType<FlavoredPartHandler>().As<IContentHandler>();
            builder.RegisterType<StyledHandler>().As<IContentHandler>();
            builder.RegisterType<DefaultShapeTableManager>().As<IShapeTableManager>();
            builder.RegisterType<ShapeTableLocator>().As<IShapeTableLocator>();
            builder.RegisterType<DefaultShapeFactory>().As<IShapeFactory>();
            builder.RegisterType<DefaultContentDisplay>().As<IContentDisplay>();

            builder.RegisterType<StubExtensionManager>().As<IExtensionManager>();

            builder.RegisterGeneric(typeof(Repository<>)).As(typeof(IRepository<>));

            _session = _sessionFactory.OpenSession();
            builder.RegisterInstance(new TestSessionLocator(_session)).As<ISessionLocator>();

            _container = builder.Build();
            _manager = _container.Resolve<IContentManager>();
        }
        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();
                        }
                    }
                });
        }
Exemplo n.º 10
0
 public SiteService(
     IContentManager contentManager,
     ICacheManager cacheManager) {
     _contentManager = contentManager;
     _cacheManager = cacheManager;
     Logger = NullLogger.Instance;
 }
Exemplo n.º 11
0
        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));
        }
Exemplo n.º 12
0
        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);
            }
            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//uzi");
                TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, new Vector3(100,10,10), Matrix.Identity, Vector3.One * 10, MaterialDescription.DefaultBepuMaterial());
                ForwardXNABasicShader shader = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial fmaterial = new ForwardMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                this.World.AddObject(obj); 
            }

            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));

            this.RenderTechnic.AddPostEffect(new BlackWhitePostEffect());
        }
 public CodeSamplesFilterController(ICommonDataService commonDataService, ITaxonomyService taxonomyService, IContentManager contentManager)
 {
     _commonDataService = commonDataService;
     _taxonomyService = taxonomyService;
     _contentManager = contentManager;
     Logger = NullLogger.Instance;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadingScreenTask"/> class.
 /// </summary>
 /// <param name="ToLoadScreen">To load screen.</param>
 /// <param name="contentManager">The content manager.</param>
 /// <param name="engine">The engine.</param>
 /// <param name="LoadingScreen">The loading screen.</param>
 public LoadingScreenTask(IScreen ToLoadScreen, IContentManager contentManager, EngineStuff engine, IScreen LoadingScreen)
 {
     this.ToLoadScreen = ToLoadScreen;
     this.engine = engine;
     this.contentManager = contentManager;
     this.LoadingScreen = LoadingScreen;
 }
Exemplo n.º 15
0
        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>();

        }
Exemplo n.º 16
0
        public TermsPartHandler(
            IContentDefinitionManager contentDefinitionManager,
            IRepository<TermsPartRecord> repository,
            ITaxonomyService taxonomyService,
            IContentManager contentManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));

            OnPublished<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
            OnUnpublished<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
            OnRemoved<TermsPart>((context, part) => RecalculateCount(contentManager, taxonomyService, part));
            
            // tells how to load the field terms on demand
            OnLoaded<TermsPart>((context, part) => {
                foreach(var field in part.ContentItem.Parts.SelectMany(p => p.Fields).OfType<TaxonomyField>()) {
                    var tempField = field.Name;
                    var fieldTermRecordIds = part.Record.Terms.Where(t => t.Field == tempField).Select(tci => tci.TermRecord.Id);
                    field.Terms.Loader(value => fieldTermRecordIds.Select(id => _contentManager.Get<TermPart>(id)));
                }
            });

            OnIndexing<TermsPart>(
                (context, part) => {
                    foreach (var term in part.Terms) {
                        var value = context.ContentManager.Get(term.TermRecord.Id).As<TitlePart>().Title;
                        context.DocumentIndex.Add(term.Field, value).Analyze();
                        context.DocumentIndex.Add(term.Field + "-id", term.Id).Store();
                    }
                });
        }
Exemplo n.º 17
0
        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);
                    }
                });
        }
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            ExtractXmlModelLoader ext = new ExtractXmlModelLoader("Content//ModelInfos//", "Model//", "Textures//");
            this.AttachCleanUpAble(ext);
            ModelLoaderData data = ext.Load(factory, GraphicInfo, "shadow");
            WorldLoader wl = new WorldLoader();
            wl.OnCreateIObject += new CreateIObject(wl_OnCreateIObject);
            wl.OnCreateILight += new CreateILight(wl_OnCreateILight);
            wl.LoadWorld(factory, GraphicInfo, World, data);
        
            lt = new LightThrowBepu(this.World, factory);

            #region NormalLight            
            ld1 = new DirectionalLightPE(new Vector3(0.2f, -1, 0.2f), Color.White);
            ld1.CastShadown = true;
            float li = 0.9f;
            ld1.LightIntensity = li;
            this.World.AddLight(ld1);            
            #endregion

            CameraFirstPerson cam = new CameraFirstPerson(GraphicInfo);
            cam.MoveSpeed *= 5;
            this.World.CameraManager.AddCamera(cam);

            SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//grasscube");
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc);

            ///Interpolator to change lightDirection
            inter.Start(new Vector3(0, -1, 0), new Vector3(1, -1, 1), 3, true);

            this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffect());

        }
Exemplo n.º 19
0
 public ShoutboxUiService(
     IContentManager contentManager,
     IShapeFactory shapeFactory)
 {
     _contentManager = contentManager;
     _shapeFactory = shapeFactory;
 }
 public RoutableHomePageProvider(
     IContentManager contentManager,
     IShapeFactory shapeFactory) {
     _contentManager = contentManager;
     Shape = shapeFactory;
     T = NullLocalizer.Instance;
 }
Exemplo n.º 21
0
 public CommentTokens(
     IContentManager contentManager,
     ICommentService commentService) {
     _contentManager = contentManager;
     _commentService = commentService;
     T = NullLocalizer.Instance;
 }
Exemplo n.º 22
0
 public WidgetExPartHandler(IRepository<WidgetExPartRecord> repository, IContentDefinitionManager contentDefinitionManager, IContentManager contentManager)
 {
     Filters.Add(StorageFilter.For(repository));
     _contentDefinitionManager = contentDefinitionManager;
     _contentManager = contentManager;
     OnActivated<WidgetExPart>(SetupFields);
 }
        /// <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));
        }
Exemplo n.º 24
0
        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;
        }
Exemplo n.º 25
0
 public ContentController(IAuthorizer authorizer, IContentManager contentManager, INotifier notifier, IContentDefinitionManager contentDefinitionManager) {
     _authorizer = authorizer;
     _contentManager = contentManager;
     _notifier = notifier;
     _contentDefinitionManager = contentDefinitionManager;
     T = NullLocalizer.Instance;
 }
Exemplo n.º 26
0
 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));
     }
Exemplo n.º 27
0
 public ApiController(
     IContentManager contentManager,
     IAuthorizationService authorizationService)
 {
     _authorizationService = authorizationService;
     _contentManager = contentManager;
 }
Exemplo n.º 28
0
        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)));
        }
 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;
 }
 public ScheduledTaskManager(
     IContentManager contentManager,
     IRepository<ScheduledTaskRecord> repository) {
     _repository = repository;
     _contentManager = contentManager;
     Logger = NullLogger.Instance;
 }
Exemplo n.º 31
0
 public LocalizationPartDriver(ICultureManager cultureManager, ILocalizationService localizationService, IContentManager contentManager)
 {
     _cultureManager      = cultureManager;
     _localizationService = localizationService;
     _contentManager      = contentManager;
 }
Exemplo n.º 32
0
 public EntityFieldTokensProvider(IContentManager contentManager, ITokenEncoder tokenEncoder)
     : base(contentManager, tokenEncoder)
 {
 }
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld;

            base.LoadContent(GraphicInfo, factory, contentManager);
            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");

                ///Create A basic material
                StillDesign.PhysX.Material material1 = PhysxPhysicWorld.CreatePhysicMaterial(
                    new StillDesign.PhysX.MaterialDescription()
                {
                    Restitution     = 0.3f,
                    DynamicFriction = 0.5f,
                    StaticFriction  = 1,
                }
                    );
                ///Triangle mesh
                PhysxTriangleMesh tmesh = new PhysxTriangleMesh(PhysxPhysicWorld, simpleModel,
                                                                Matrix.Identity, Vector3.One, 1, material1);

                ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                this.World.AddObject(obj);
            }

            BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory);

            this.AttachCleanUpAble(BallThrowBullet);

            ///Create some ball with random materials properties
            for (int i = 0; i < 10; i++)
            {
                StillDesign.PhysX.Material material2 = PhysxPhysicWorld.CreatePhysicMaterial(
                    new StillDesign.PhysX.MaterialDescription()
                {
                    Restitution            = PloobsEngine.Utils.StaticRandom.RandomBetween(0, 1),
                    DynamicFriction        = PloobsEngine.Utils.StaticRandom.RandomBetween(0, 1),
                    StaticFriction         = PloobsEngine.Utils.StaticRandom.RandomBetween(0, 1),
                    RestitutionCombineMode = CombineMode.Max,
                }
                    );

                ///Load a Model with a custom texture
                SimpleModel sm2 = new SimpleModel(factory, "Model\\ball");
                sm2.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Green, false), TextureType.DIFFUSE);

                ForwardXNABasicShader nd = new ForwardXNABasicShader();
                IMaterial             m  = new ForwardMaterial(nd);

                ///Shape description
                ///REMEMBER
                ///YOU NEED TO APPLY THE SCALE MANUALLY TO THE SHAPE
                ///IN THIS CASE the physic object has a scale of 5 and the SphereShapeDescription has a ray of 5.
                ///The user MUST MATCH the size of the SHAPE with the Scale applied to the IModelo
                SphereShapeDescription SphereGeometry = new SphereShapeDescription(5f);
                SphereGeometry.Material = material2;

                PhysxPhysicObject PhysxPhysicObject = new PhysxPhysicObject(SphereGeometry,
                                                                            0.5f, Matrix.CreateTranslation(new Vector3(100, 100, 50 * i)), Vector3.One * 5f);

                IObject o = new IObject(m, sm2, PhysxPhysicObject);
                this.World.AddObject(o);
            }
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }
Exemplo n.º 34
0
 public CondensedListView(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
        protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            #region Models
            ///Cenario
            {
                SimpleModel          sm     = new SimpleModel(factory, "..\\Content\\Model\\cenario");
                IPhysicObject        pi     = new TriangleMeshObject(sm, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
                DeferredNormalShader shader = new DeferredNormalShader(0.05f, 50);
                IMaterial            mat    = new DeferredMaterial(shader);
                IObject obj3 = new IObject(mat, sm, pi);
                this.World.AddObject(obj3);
            }


            #endregion

            CameraFirstPerson cam = new CameraFirstPerson(GraphicInfo);
            cam.FarPlane = 2000;

            ///Atirador de bolas classico
            lt = new LightThrowBepu(this.World, factory);

            ///Interpolador que ira variar a cor das luzes
            UnitLightInterpolator li = new UnitLightInterpolator(this, true);
            ///Inicia o funcionamento do componente IScreenUpdateable (classe pai do UnitLightInterpolator)
            li.Start();

            ///Adiciona DIVERSAS luzes pelo cenario
            for (int i = -10; i < 10; i++)
            {
                for (int j = -10; j < 10; j++)
                {
                    ///Luz Pontual
                    PointLightPE pl = new PointLightPE(new Vector3(i * 20, 10, j * 20), Color.White, 35, 2);
                    //Atenuacao quadratica (inverso do quadrado ao inves do padrao que eh inverso da linear)
                    ///custa mais, mas eh mais bonita
                    pl.UsePointLightQuadraticAttenuation = true;
                    ///adiciona ao mundo
                    this.World.AddLight(pl);
                    ///adiciona ao interpolador
                    li.AddLight(pl, StaticRandom.RandomColor(), StaticRandom.RandomColor(), StaticRandom.RandomBetween(0, 5));
                }
            }

            ///mais luzes, mais alto
            for (int i = -5; i < 5; i++)
            {
                for (int j = -5; j < 5; j++)
                {
                    PointLightPE pl = new PointLightPE(new Vector3(i * 50, 140, j * 50), Color.White, 70, 1);
                    pl.UsePointLightQuadraticAttenuation = true;
                    this.World.AddLight(pl);
                    li.AddLight(pl, StaticRandom.RandomColor(), StaticRandom.RandomColor(), StaticRandom.RandomBetween(0, 10));
                }
            }

            this.World.CameraManager.AddCamera(cam);
            this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffect());
        }
Exemplo n.º 36
0
 public BlogManager(IDocumentSession session, IContentManager contentManager)
     : base(session)
 {
     this.contentManager = contentManager;
 }
Exemplo n.º 37
0
 public MessageTemplateService(IEnumerable <IParserEngine> parsers, IOrchardServices services)
 {
     _contentManager = services.ContentManager;
     _parsers        = parsers;
     _services       = services;
 }
Exemplo n.º 38
0
 public ModuleController(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
 public CommonFeedItemBuilder(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
Exemplo n.º 40
0
        /// <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);

            ///Create the model
            SimpleModel simpleModel = new SimpleModel(factory, "Model//cenario");
            ///create the physic object
            TriangleMeshObject tmesh = new TriangleMeshObject(simpleModel, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
            /// BECAUSE OF THE RENDER TECHNICH, the Shader must be forward
            ForwardXNABasicShader shader = new ForwardXNABasicShader();
            /// BECAUSE OF THE RENDER TECHNICH, the Material must be forward
            ForwardMaterial fmaterial = new ForwardMaterial(shader);
            ///create the object
            IObject obj = new IObject(fmaterial, simpleModel, tmesh);

            ///add to the world
            this.World.AddObject(obj);


            ///add a camera
            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }
 public HomeAliasStep(RecipeExecutionLogger logger, IContentManager contentManager, IHomeAliasService homeAliasService) : base(logger)
 {
     _contentManager   = contentManager;
     _homeAliasService = homeAliasService;
 }
Exemplo n.º 42
0
 public NewActivityStreamActivity(IContentManager contentManager)
 {
     this.contentManager = contentManager;
     T      = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
Exemplo n.º 43
0
 public CreateContentTask(IContentManager contentManager, IWorkflowExpressionEvaluator expressionEvaluator, IWorkflowScriptEvaluator scriptEvaluator, IStringLocalizer <CreateContentTask> localizer)
     : base(contentManager, scriptEvaluator, localizer)
 {
     _expressionEvaluator = expressionEvaluator;
 }
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            PhysxPhysicWorld PhysxPhysicWorld = World.PhysicWorld as PhysxPhysicWorld;

            base.LoadContent(GraphicInfo, factory, contentManager);
            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//block");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Blue), TextureType.DIFFUSE);

                BoxShapeDescription SphereGeometry    = new BoxShapeDescription(1000, 5, 1000);
                PhysxPhysicObject   PhysxPhysicObject = new PhysxPhysicObject(SphereGeometry,
                                                                              Matrix.Identity, new Vector3(1000, 5, 1000));

                ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, PhysxPhysicObject);
                this.World.AddObject(obj);

                shader.BasicEffect.EnableDefaultLighting();
            }

            {
                ///very basic vehicle !!!
                ///no wheels also =P
                Vehicle     Vehicle     = new Vehicle(PhysxPhysicWorld.Scene);
                SimpleModel simpleModel = new SimpleModel(factory, "Model//block");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Green));
                PhysxPhysicObject tmesh = new PhysxPhysicObject(Vehicle.VehicleBodyActor, new Vector3(5, 3, 7));

                ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                UserObject <Vehicle>  obj       = new UserObject <Vehicle>(fmaterial, simpleModel, tmesh, Vehicle);
                obj.OnUserUpdate += new Action <UserObject <StillDesign.PhysX.Samples.Vehicle> >(obj_OnUserUpdate);
                this.World.AddObject(obj);
            }

            BallThrowPhysx28 BallThrowBullet = new BallThrowPhysx28(this.World, GraphicFactory);

            this.AttachCleanUpAble(BallThrowBullet);

            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));
        }
Exemplo n.º 45
0
 public FacebookLikeButtonMigrations(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
Exemplo n.º 46
0
        protected override void LoadContent(PloobsEngine.Engine.GraphicInfo GraphicInfo, PloobsEngine.Engine.GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            ///Create a Simple Model
            IModelo sm = new SimpleModel(factory, "..\\Content\\Model\\cenario");
            ///Create a Physic Object
            IPhysicObject pi = new TriangleMeshObject(sm, Vector3.Zero, Matrix.Identity, Vector3.One, MaterialDescription.DefaultBepuMaterial());
            ///Create a shader
            IShader shader = new DeferredNormalShader();
            ///Create a Material
            IMaterial mat = new DeferredMaterial(shader);
            ///Create a an Object that englobs everything and add it to the world
            IObject obj4 = new IObject(mat, sm, pi);

            this.World.AddObject(obj4);

            lt = new LightThrowBepu(this.World, factory);

            ///Create a FirstPerson Camera
            ///This is a special camera, used in the development
            ///You can move around using wasd / qz / and the mouse
            ICamera cam = new CameraFirstPerson(GraphicInfo);

            this.World.CameraManager.AddCamera(cam);

            {
                SpotLightPE sp1 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.YellowGreen, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc1 = new SpotLightCircularUpdater(this, sp1, 0.01f, 1, 0, true);
                this.World.AddLight(sp1);

                SpotLightPE sp2 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Red, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc2 = new SpotLightCircularUpdater(this, sp2, 0.01f, 1, (float)Math.PI / 2, true);
                this.World.AddLight(sp2);

                SpotLightPE sp3 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Red, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc3 = new SpotLightCircularUpdater(this, sp3, 0.01f, 1, (float)Math.PI, true);
                this.World.AddLight(sp3);

                SpotLightPE sp4 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Green, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc4 = new SpotLightCircularUpdater(this, sp4, 0.01f, 1, (float)(Math.PI * 3) / 2, true);
                this.World.AddLight(sp4);
            }

            {
                SpotLightPE sp1 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Purple, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc1 = new SpotLightCircularUpdater(this, sp1, 0.02f, 2, 0, false);
                this.World.AddLight(sp1);

                SpotLightPE sp2 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.PowderBlue, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc2 = new SpotLightCircularUpdater(this, sp2, 0.02f, 2, (float)Math.PI / 2, false);
                this.World.AddLight(sp2);

                SpotLightPE sp3 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.YellowGreen, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc3 = new SpotLightCircularUpdater(this, sp3, 0.02f, 2, (float)Math.PI, false);
                this.World.AddLight(sp3);

                SpotLightPE sp4 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Maroon, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc4 = new SpotLightCircularUpdater(this, sp4, 0.02f, 2, (float)(Math.PI * 3) / 2, false);
                this.World.AddLight(sp4);
            }


            {
                SpotLightPE sp1 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.PapayaWhip, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc1 = new SpotLightCircularUpdater(this, sp1, 0.03f, 3, (float)Math.PI / 4, true);
                this.World.AddLight(sp1);

                SpotLightPE sp2 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.LightSeaGreen, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc2 = new SpotLightCircularUpdater(this, sp2, 0.03f, 3, (float)Math.PI / 4 + (float)Math.PI / 2, true);
                this.World.AddLight(sp2);

                SpotLightPE sp3 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Gold, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc3 = new SpotLightCircularUpdater(this, sp3, 0.03f, 3, (float)Math.PI / 4 + (float)Math.PI, true);
                this.World.AddLight(sp3);

                SpotLightPE sp4 = new SpotLightPE(new Vector3(0, 150, 0), new Vector3(0, -1, 0), Color.Aqua, 1, 600, (float)Math.Cos(Math.PI / 7), 0.5f);
                SpotLightCircularUpdater spc4 = new SpotLightCircularUpdater(this, sp4, 0.03f, 3, (float)Math.PI / 4 + (float)(Math.PI * 3) / 2, true);
                this.World.AddLight(sp4);
            }

            this.RenderTechnic.AddPostEffect(new AntiAliasingPostEffect());
        }
Exemplo n.º 47
0
 public HtmlWidgetController(IContentManager contentManager) : base(contentManager)
 {
 }
 public MediaLibraryPickerFieldDriver(IContentManager contentManager)
 {
     _contentManager = contentManager;
     T = NullLocalizer.Instance;
 }
Exemplo n.º 49
0
 public ContentAppService(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
Exemplo n.º 50
0
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);

            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//block");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Red), TextureType.DIFFUSE);
                BoxObject tmesh = new BoxObject(new Vector3(0), 1, 1, 1, 10, new Vector3(1000, 1, 1000), Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
                tmesh.isMotionLess = true;
                ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                this.World.AddObject(obj);
            }

            Simulator.setTimeStep(0.25f);
            Simulator.setAgentDefaults(5.0f, 25, 10.0f, 25.0f, 2.0f, 4.0f, new Vector2(0));

            for (int i = 0; i < 20; i++)
            {
                for (int j = 0; j < 20; j++)
                {
                    SimpleModel simpleModel = new SimpleModel(factory, "Model//block");
                    simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.White), TextureType.DIFFUSE);
                    BoxObject             tmesh     = new BoxObject(new Vector3(100 + j * 5, 5, i * 5), 1, 1, 1, 10, new Vector3(1, 1, 1), Matrix.Identity, MaterialDescription.DefaultBepuMaterial());
                    ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                    ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                    int       id  = Simulator.addAgent(VectorUtils.ToVector2(tmesh.Position));
                    RVOObject obj = new RVOObject(id, fmaterial, simpleModel, tmesh);
                    obj.OnUpdate += new OnUpdate(obj_OnUpdate); /// dummy position update way =p
                    this.World.AddObject(obj);
                }
            }

            ///counterclockwise vertices
            Simulator.addObstacle(
                new List <Vector2>()
            {
                new Vector2(20, 20),
                new Vector2(40, 20),
                new Vector2(40, 40),
                new Vector2(40, 40),
                new Vector2(20, 40),
                new Vector2(20, 20),
            }
                );

            Simulator.processObstacles();

            ///obstacle
            {
                SimpleModel simpleModel = new SimpleModel(factory, "Model//block");
                simpleModel.SetTexture(factory.CreateTexture2DColor(1, 1, Color.Yellow), TextureType.DIFFUSE);
                GhostObject           tmesh     = new GhostObject(new Vector3(30, 0, 30), Matrix.Identity, new Vector3(10));
                ForwardXNABasicShader shader    = new ForwardXNABasicShader(ForwardXNABasicShaderDescription.Default());
                ForwardMaterial       fmaterial = new ForwardMaterial(shader);
                IObject obj = new IObject(fmaterial, simpleModel, tmesh);
                this.World.AddObject(obj);
            }

            this.World.CameraManager.AddCamera(new CameraFirstPerson(GraphicInfo));

            Picking p = new Picking(this, 1000);

            p.OnPickedLeftButton += new OnPicked(p_OnPickedLeftButton);
        }
 public AuthorizationEventHandler(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
Exemplo n.º 52
0
 public UnpublishContentTask(IContentManager contentManager, IWorkflowScriptEvaluator scriptEvaluator, IStringLocalizer <UnpublishContentTask> localizer) : base(contentManager, scriptEvaluator, localizer)
 {
 }
 public OrchardOpenAuthDataProvider(IContentManager contentManager, IUserProviderServices userProviderServices)
 {
     _contentManager       = contentManager;
     _userProviderServices = userProviderServices;
 }
 public DefaultMenuProvider(IContentManager contentManager)
 {
     _contentManager = contentManager;
 }
Exemplo n.º 55
0
        public RunForWatchersActivity(IContentManager contentManager)
        {
            _contentManager = contentManager;

            _stateKey = Name + ".WatcherIds";
        }
 public ContentTypeDeploymentSource(IContentManager contentManager, ISession session)
 {
     _contentManager = contentManager;
     _session        = session;
 }
        protected override void LoadContent(GraphicInfo GraphicInfo, GraphicFactory factory, IContentManager contentManager)
        {
            base.LoadContent(GraphicInfo, factory, contentManager);


            ///The Animated Bilboard
            {
                ///A lits with all the bilboards positions
                List <Vector3> poss = new List <Vector3>();
                for (int i = 0; i < 10; i++)
                {
                    for (int j = 0; j < 10; j++)
                    {
                        float x, y;
                        x = i * 100;
                        y = j * 100;
                        poss.Add(new Vector3(x, 5, y));
                    }
                }

                ///Create the Bilboard Model
                ///the Textures\\coin Texture is a Horizontal animated texture
                StaticBilboardModel bm = new StaticBilboardModel(factory, "Bilbs", "Textures\\coin", poss);
                ///The shader that will render it, pass the number of frames, the time to wait between frames and the type of the bilboard
                ///Spherical ALWAYS face the camera
                ///Cilindric has a axis that the bilboard can rotate around, to face the camera
                DeferredAnimatedTextureShader cb = new DeferredAnimatedTextureShader(6, 100, BilboardType.Cilindric);
                ///We can animated the two up vertices of the bilboard quad (useful in grass for example)
                cb.Amplitude = 0f;
                ///Quad Scale
                cb.Scale = new Vector2(50, 50);
                ///Color atenuation, this will multiply the Texture colors
                cb.Atenuation = new Vector4(0.4f, 0.4f, 0.4f, 1);
                DeferredMaterial matfor = new DeferredMaterial(cb);
                ///no physical representation (REMEMBER; all bilboards are the SAME OBJECT)
                GhostObject go   = new GhostObject(new Vector3(70, 0, 0), Matrix.Identity, Vector3.One);
                IObject     obj2 = new IObject(matfor, bm, go);
                this.World.AddObject(obj2);
            }


            #region NormalLight
            DirectionalLightPE ld1 = new DirectionalLightPE(Vector3.Left, Color.White);
            DirectionalLightPE ld2 = new DirectionalLightPE(Vector3.Right, Color.White);
            DirectionalLightPE ld3 = new DirectionalLightPE(Vector3.Backward, Color.White);
            DirectionalLightPE ld4 = new DirectionalLightPE(Vector3.Forward, Color.White);
            DirectionalLightPE ld5 = new DirectionalLightPE(Vector3.Down, Color.White);
            float li = 0.5f;
            ld1.LightIntensity = li;
            ld2.LightIntensity = li;
            ld3.LightIntensity = li;
            ld4.LightIntensity = li;
            ld5.LightIntensity = li;
            this.World.AddLight(ld1);
            this.World.AddLight(ld2);
            this.World.AddLight(ld3);
            this.World.AddLight(ld4);
            this.World.AddLight(ld5);
            #endregion


            CameraFirstPerson cam = new CameraFirstPerson(MathHelper.ToRadians(-60), MathHelper.ToRadians(-10), new Vector3(-200, 150, 250), GraphicInfo);
            this.World.CameraManager.AddCamera(cam);

            SkyBoxSetTextureCube stc = new SkyBoxSetTextureCube("Textures//grassCube");
            CommandProcessor.getCommandProcessor().SendCommandAssyncronous(stc);
        }
 public DeviceGroupHandler(IRepository <DeviceGroupRecord> repository, IContentManager contentManager)
 {
     Filters.Add(StorageFilter.For(repository));
 }
 public CurrentContentAccessor(IContentManager contentManager, RequestContext requestContext)
 {
     _contentManager = contentManager;
     _requestContext = requestContext;
     _currentContentItemField.Loader(GetCurrentContentItem);
 }
Exemplo n.º 60
0
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="contentCore">SMAPI's core content logic.</param>
        /// <param name="modFolderPath">The absolute path to the mod folder.</param>
        /// <param name="modID">The unique ID of the relevant mod.</param>
        /// <param name="modName">The friendly mod name for use in errors.</param>
        /// <param name="gameContentManager">The game content manager used for map tilesheets not provided by the mod.</param>
        /// <param name="relativePathCache">A case-insensitive lookup of relative paths within the <paramref name="relativePathCache"/>.</param>
        public ModContentHelper(ContentCoordinator contentCore, string modFolderPath, string modID, string modName, IContentManager gameContentManager, CaseInsensitivePathCache relativePathCache)
            : base(modID)
        {
            string managedAssetPrefix = contentCore.GetManagedAssetPrefix(modID);

            this.ContentCore       = contentCore;
            this.ModContentManager = contentCore.CreateModContentManager(managedAssetPrefix, modName, modFolderPath, gameContentManager);
            this.ModName           = modName;
            this.RelativePathCache = relativePathCache;
        }