public void Bind(IDiContainer di) { di.BindMulti <IAssetLoader>().To <FFmpegMovieLoader>(); di.Bind <IMoviePlayer>().To <FFmpegMoviePlayer>(); di.Bind <IMovieUrlLoader>().To <FFmpegMovieUrlLoader>(); di.Bind <FFmpegInitializer>().AsLastChoice.To <FFmpegInitializer>(); }
private void InternalTo(Type concreteType) { ValidateConcreteType(concreteType); if (rootBinding.AbstractType == concreteType) { rootBinding.AddNewCase(new DiConstructorBinding(concreteType)); } else { di.Bind(concreteType).AsLastChoice.To(concreteType); rootBinding.AddNewCase(new DiRedirectBinding(concreteType)); } }
public OalAudioSystem(IDiContainer di, IRenderLoopDispatcher renderLoopDispatcher) { di.Bind <IOalAudioRuntime>().AsLastChoice.To <OalAudioRuntime>(); var runtime = di.Get <IOalAudioRuntime>(); renderLoopDispatcher.Update += runtime.Update; }
public void Bind(IDiContainer di) { di.Bind <IRenderService>().To <RenderService>(); di.Bind <IRenderingRuntime>().To <RenderingRuntime>(); di.Bind <IShaderProgramFactory>().To <ShaderProgramFactory>(); di.Bind <ISketchDrawer>().To <SketchDrawer>(); di.Bind <ISkyboxDrawer>().To <SkyboxDrawer>(); di.Bind <IVeilDrawer>().To <VeilDrawer>(); di.Bind <IQuadDrawer>().To <QuadDrawer>(); di.Bind <IBlurDrawer>().To <BlurDrawer>(); di.Bind <IBleedDrawer>().To <BleedDrawer>(); di.Bind <IHighlightDrawer>().To <HighlightDrawer>(); di.Bind <IMainThreadDisposer>().AsLastChoice.To <MainThreadDisposer>(); di.Bind <IGraphicsInfra>().AsLastChoice.To <GraphicsInfra>(); di.Bind <ICommonObjects>().To <CommonObjects>(); di.Bind <ISamplerCache>().To <SamplerCache>(); di.Bind <IOffScreenContainer>().To <OffScreenContainer>(); di.Bind <ISceneRendererPool>().To <SceneRendererPool>(); di.Bind <ISceneRendererFactory>().To <SceneRendererFactory>(); di.Bind <IVisualElementHandlerContainer>().To <VisualElementHandlerContainer>(); di.BindMulti <IVisualElementHandler>().To <ModelVisualElementHandler>(); }
public void BindObject() { var implementation = new Concrete(); container.Bind <IAbstract>().To(implementation); var result = container.Get <IAbstract>(); Assert.That(result, Is.SameAs(implementation)); }
public void Bind(IDiContainer di) { di.Bind <IWindowingSystem>().To <GuiEto>(); di.Bind <IGui>().To <GuiEto>(); if (EtoEnvironment.Platform.IsWindows) { di.Bind <Platform>().To <Eto.WinForms.Platform>(); di.Bind <Eto.Forms.Application.IHandler>().To <LoopAppHandlerWinForms>(); di.Bind <RenderControl.IHandler>().To <RenderingAreaHandlerWinFormsOgl>(); } else if (EtoEnvironment.Platform.IsLinux) { di.Bind <Platform>().To <Eto.GtkSharp.Platform>(); di.Bind <Eto.Forms.Application.IHandler>().To <LoopAppHandlerGtk>(); di.Bind <RenderControl.IHandler>().To <RenderingAreaHandlerGtkOgl>(); } else { throw new NotSupportedException("This platform is not supported."); } di.Bind <ICommonGuiObjects>().To <CommonGuiObjects>(); di.Bind <INameGenerator>().To <NameGenerator>(); di.Bind <ISceneTreeGui>().To <SceneTreeGui>(); di.Bind <IResourceExplorerGui>().To <ResourceExplorerGui>(); di.Bind <ISaveLoadGuiCommands>().To <SaveLoadGuiCommands>(); di.Bind <IPropsGui>().To <PropsGui>(); di.Bind <RenderControl>().To <RenderControl>(); di.Bind <IRtImageBuilder>().To <RtImageBuilder>(); di.Bind <IClipboard>().To <EcClipboard>(); di.Bind <IFontFamilyCache>().To <FontFamilyCache>(); di.Bind <IRichTextMeasurer>().To <RichTextMeasurer>(); di.Bind <IAppModesCommands>().To <AppModesCommands>(); di.Bind <IStoryGraphGui>().To <StoryGraphGui>(); di.Bind <IFrameTimeMeasurer>().To <FrameTimeMeasurer>(); di.Bind <IMainForm>().To <DefaultMainForm>(); di.Bind <IMouseInputProvider>().To <MouseInputProvider>(); di.Bind <IKeyboardInputProvider>().To <KeyboardInputProvider>(); di.Bind <IWindowManager>().To <WindowManager>(); di.Bind <IMessageBoxService>().To <MessageBoxService>(); di.Bind <IWindowQueryService>().To <WindowQueryService>(); di.BindMulti <IResourceSaver>().To <ImageResourceSaver>(); di.Bind <IFluentGuiService>().To <FluentGuiService>(); }
//public void StartAndRun(IEnvironment environment) //{ // var di = new DiContainer(); // BindDefaults(di); // BindExtensions(di, environment); // InitializeStatics(di); // StartupExtensions(di, environment); // StartupCore(di); // Run(di); //} protected virtual void BindDefaults(IDiContainer di) { di.Bind <IAmDiBasedObjectFactory>().To(d => new AmDiBasedObjectFactory(d.Get <IReadOnlyList <IAmBindingTypeDescriptor> >(), d.Get)); //di.Bind<IAmDiBasedObjectFactory>().To(d => new AmJitsuGenDiBasedObjectFactory(d.Get)); di.BindMulti <IAmBindingTypeDescriptor>().To <AmSingularBindingTypeDescriptor>(); di.BindMulti <IAmBindingTypeDescriptor>().To <AmListBindingTypeDescriptor>(); di.Bind <IEventRoutingService>().To <EventRoutingService>(); di.Bind <IRenderLoopDispatcher>().To <RenderLoopDispatcher>(); di.Bind <IRayHitIndex>().To <RayHitIndex>(); di.Bind <ITemporaryCacheService>().To <TemporaryCacheService>(); di.Bind <IEmbeddedResources>().To <EmbeddedResources>(); di.Bind <IEmbeddedResourceFiles>().To <EmbeddedResourceFiles>(); di.Bind <IInputService>().To <InputService>(); di.Bind <ITrwFactory>().To <TrwFactory>(); di.BindMulti <ITrwFormat>().To <TrwFormatJson>(); di.BindMulti <ITrwFormat>().To <TrwFormatXml>(); di.BindMulti <ITrwFormat>().To <TrwFormatMem>(); di.Bind <ITrwSerializationHandlerContainer>().To <TrwSerializationHandlerContainer>(); di.Bind <ITrwAttributeObjectCreator>().To <DiBasedTrwAttributeObjectCreator>(); di.Bind <ITrwDiffBuilder>().To <TrwDiffBuilder>(); di.Bind <ISerializationNecessities>().To <SerializationNecessities>(); di.Bind <IResourceSavingService>().To <ResourceSavingService>(); di.Bind <IResourceLoadingService>().To <ResourceLoadingService>(); di.BindMulti <IResourceFactory>().To <LineModelFactory>(); di.BindMulti <IResourceFactory>().To <CircleModelFactory>(); di.BindMulti <IResourceFactory>().To <RectangleModelFactory>(); di.BindMulti <IResourceFactory>().To <CubeModelFactory>(); di.BindMulti <IResourceFactory>().To <PlaneModelFactory>(); di.BindMulti <IResourceFactory>().To <SimpleFrustumModelFactory>(); di.BindMulti <IResourceFactory>().To <SimplePlaneXyModelFactory>(); di.BindMulti <IResourceFactory>().To <SimplePlaneXzModelFactory>(); di.BindMulti <IResourceFactory>().To <SphereModelFactory>(); di.BindMulti <IResourceLoader>().To <ImageResourceLoader>(); di.Bind <ISkyboxLoader>().To <SkyboxLoader>(); di.Bind <ISketchService>().To <SketchService>(); di.Bind <IFactoryResourceCache>().To <FactoryResourceCache>(); di.Bind <IRichTextBoxLayoutBuilder>().To <RichTextBoxLayoutBuilder>(); di.Bind <ITextLineBreaker>().To <TextLineBreaker>(); di.Bind <IClipboard>().To <DummyClipboard>(); }
protected override void BindDefaults(IDiContainer di) { base.BindDefaults(di); di.Bind <IInputHandler>().To <InputHandler>(); di.Bind <IUndoRedoService>().To <UndoRedoService>(); di.Bind <IViewService>().To <ViewService>(); di.Bind <IWorldTreeService>().To <WorldTreeService>(); di.Bind <IToolService>().To <ToolService>(); di.Bind <IToolFactory>().To <ToolFactory>(); di.Bind <IDefaultStateInitializer>().To <DefaultStateInitializer>(); di.Bind <ISaveLoadService>().To <SaveLoadService>(); di.Bind <IAssetService>().To <AssetService>(); di.Bind <IAssetFileCache>().To <AssetFileCache>(); di.Bind <IWorldCopyPasteService>().To <WorldCopyPasteService>(); di.Bind <IAppModeService>().To <AppModeService>(); di.Bind <IPresentationWorldBuilder>().To <PresentationWorldBuilder>(); di.Bind <ICommonNodeFactory>().To <CommonNodeFactory>(); di.BindMulti <IAssetLoader>().To <ImageAssetLoader>(); di.BindMulti <IAssetLoader>().To <SkyboxAssetLoader>(); di.BindMulti <IAssetLoader>().To <ObjGeoModelLoader>(); di.BindMulti <IAssetLoader>().To <CgModelLoader>(); di.BindMulti <IAssetLoader>().To <SpherePackingLoader>(); di.Bind <ILogService>().To <LogService>(); di.BindMulti <ISerializationNecessitiesProvider>().To <CommonSerializationNecessitiesProvider>(); di.BindMulti <ISerializationNecessitiesProvider>().To <AmSerializationNecessitiesProvider>(); di.BindMulti <ISerializationNecessitiesProvider>().To <WorldSerializationNecessitiesProvider>(); di.BindMulti <ILogWriter>().To <FileLogWriter>(); di.Bind <IImageLoader>().To <SysDrawImageLoader>(); di.Bind <ISaveLoadFactory>().To <SaveLoadFactory>(); di.BindMulti <ISaveLoadFormat>().To <ZipSaveLoadFormat>(); di.Bind <ISaveLoadConverterContainer>().To <SaveLoadConverterContainer>(); di.Bind <IStoryService>().To <StoryService>(); di.Bind <IConfigService>().To <ConfigService>(); di.Bind <IConfigFileStorage>().To <StandardConfigFileStorage>(); di.Bind <ICoroutineService>().To <CoroutineService>(); di.BindMulti <IStoryLayout>().To <SphereStoryLayout>(); di.BindMulti <IStoryLayout>().To <OrbitStoryLayout>(); di.BindMulti <IStoryLayout>().To <MuseumStoryLayout>(); di.BindMulti <IStoryLayout>().To <NestedSpheresStoryLayout>(); di.BindMulti <IStoryLayout>().To <NestedCirclesStoryLayout>(); di.Bind <INavigationService>().To <NavigationService>(); di.Bind <IUserQueryService>().To <UserQueryService>(); di.Bind <IPresentationGuiCommands>().To <PresentationGuiCommands>(); di.Bind <ISceneNodeContextMenuBuilder>().To <SceneNodeContextMenuBuilder>(); di.Bind <IReadOnlyWorldBuilder>().To <ReadOnlyWorldBuilder>(); di.Bind <IRtEmbeddingHandlerContainer>().To <RtEmbeddingHandlerContainer>(); di.Bind <IHighlightOnMouseService>().To <HighlightOnMouseService>(); di.Bind <IDirtyHackService>().To <DirtyHackService>(); }
public void Bind(IDiContainer di) { GenOutput.FillDomain(GenDomain.Static); di.Bind <ProgramObject>().To(programObjComponent); di.Bind <IAmDiBasedObjectFactory>().To(d => new AmJitsuGenDiBasedObjectFactory(d.Get)); di.Bind <IWindowingSystem>().To <UcGui>(); di.Bind <IGui>().To <UcGui>(); di.Bind <IRenderService>().To <UcRenderService>(); di.Bind <IDefaultStateInitializer>().To <UcDefaultStateInitializer>(); di.Bind <IMoviePlayer>().To <UcCgMoviePlayer>(); di.Bind <IUcRenderingInfra>().To <UcRenderingInfra>(); di.Bind <IImageLoader>().To <UcImageLoader>(); di.BindMulti <IUcInputProvider>().To <UcMouseInputProvider>(); di.BindMulti <IUcInputProvider>().To <UcKeyboardInputProvider>(); di.Bind <IVrHeadPositionService>().To <VrHeadPositionService>(); di.Bind <IStandardMaterialCache>().To <StandardMaterialCache>(); di.Bind <IRtImageBuilder>().To <UcRtImageBuilder>(); di.Bind <IRichTextMeasurer>().To <UcRichTextMeasurer>(); di.Bind <IMessageBoxService>().To <MessageBoxService>(); di.Bind <IVrInitializerService>().To <VrInitializerService>(); di.Bind <IGlobalObjectService>().To <GlobalObjectService>(); di.Bind <IVrManipulationService>().To <VrManipulationService>(); di.Bind <ILogService>().To <UcLogService>(); di.Bind <IMessagePopupService>().To <UcMessagePopupService>(); di.Bind <IVrInputDispatcher>().To <NoviceVrInputDispatcher>(); di.BindMulti <IVrNavigationMode>().To <MinimapVrNavigationMode>(); //di.BindMulti<IVrNavigationMode>().To<FixedTeleportVrNavigationMode>(); //di.BindMulti<IVrNavigationMode>().To<FixedSmoothVrNavigationMode>(); di.BindMulti <IVrNavigationMode>().To <FreeSmoothVrNavigationMode>(); di.BindMulti <IVrNavigationMode>().To <MoveInPlaceVrNavigationMode>(); di.BindMulti <IVrNavigationMode>().To <FreeTeleportVrNavigationMode>(); }
public void Bind(IDiContainer di) { di.Bind <IAudioSystem>().To <OalAudioSystem>(); }