コード例 #1
0
ファイル: XamlTestApp.cs プロジェクト: Arlorean/Perspex
 public XamlTestApp()
 {
     RegisterServices();
     RegisterPlatform();
     Styles = new DefaultTheme();
     InitializeComponent();
 }
コード例 #2
0
ファイル: DesignerAssist.cs プロジェクト: Arlorean/Perspex
 public DesignerApp()
 {
     RegisterServices();
     //For now we only support windows
     InitializeSubsystems(2);
     Styles = new DefaultTheme();
 }
コード例 #3
0
ファイル: App.paml.cs プロジェクト: Arlorean/Perspex
 public App()
 {
     RegisterServices();
     InitializeSubsystems(GetPlatformId());
     Styles = new DefaultTheme();
     InitializeComponent();
 }
コード例 #4
0
ファイル: App.cs プロジェクト: rdterner/Perspex
 public App()
 {
     RegisterServices();
     InitializeSubsystems((int)Environment.OSVersion.Platform);            
     Styles = new DefaultTheme();
     Styles.Add(new SampleTabStyle());
 }
コード例 #5
0
ファイル: App.paml.cs プロジェクト: vishalishere/PerspexVS
 public App()
 {
     RegisterServices();
     InitializeSubsystems((int)Environment.OSVersion.Platform);
     Styles = new DefaultTheme();
     PerspexXamlLoader.Load(this);
 }
コード例 #6
0
ファイル: App.cs プロジェクト: KvanTTT/Perspex
 public App()
 {
     RegisterServices();
     InitializeSubsystems((int)Environment.OSVersion.Platform);            
     Styles = new DefaultTheme();
     Styles.Add(new SampleTabStyle());
     DataTemplates = new DataTemplates
     {
         new FuncTreeDataTemplate<Node>(
             x => new TextBlock {Text = x.Name},
             x => x.Children),
     };
 }
コード例 #7
0
ファイル: App.cs プロジェクト: Arlorean/Perspex
        public App()
        {
            RegisterServices();
            InitializeSubsystems((int)Environment.OSVersion.Platform);
            Styles = new DefaultTheme();

            Log.Logger = new LoggerConfiguration()
                .Filter.ByIncludingOnly(Matching.WithProperty("Area", "Property"))
                .Filter.ByIncludingOnly(Matching.WithProperty("Property", "Text"))
                .MinimumLevel.Verbose()
                .WriteTo.Trace(outputTemplate: "[{Id:X8}] [{SourceContext}] {Message}")
                .CreateLogger();
        }
コード例 #8
0
ファイル: App.paml.cs プロジェクト: hacklex/Core2D
        /// <summary>
        /// Initializes a new instance of the <see cref="App"/> class.
        /// </summary>
        public App()
        {
            RegisterServices();
#if SKIA_WIN
            Win32Platform.Initialize();
            SkiaPlatform.Initialize();
#elif SKIA_GTK
            GtkPlatform.Initialize();
            SkiaPlatform.Initialize();
#else
            InitializeSubsystems((int)Environment.OSVersion.Platform);
#endif
            Styles = new DefaultTheme();
            InitializeComponent();
        }
コード例 #9
0
ファイル: TestApp.cs プロジェクト: Sergey-Terekhin/Perspex
        private TestApp()
        {
            RegisterServices();

            var fixture = new Fixture().Customize(new AutoMoqCustomization());
            var windowImpl = new Mock<IWindowImpl>();
            var renderInterface = fixture.Create<IPlatformRenderInterface>();

            PerspexLocator.CurrentMutable
                .Bind<IAssetLoader>().ToConstant(new AssetLoader())
                .Bind<IPclPlatformWrapper>().ToConstant(new PclPlatformWrapper())
                .Bind<IPlatformRenderInterface>().ToConstant(renderInterface)
                .Bind<IWindowingPlatform>().ToConstant(new WindowingPlatformMock(() => windowImpl.Object));

            Styles = new DefaultTheme();
        }
コード例 #10
0
ファイル: TestApp.cs プロジェクト: alimbada/Perspex
        private TestApp()
        {
            RegisterServices();

            var fixture = new Fixture().Customize(new AutoMoqCustomization());
            var windowImpl = new Mock<IWindowImpl>();
            var renderInterface = fixture.Create<IPlatformRenderInterface>();
            var threadingInterface = Mock.Of<IPlatformThreadingInterface>(x =>
                x.CurrentThreadIsLoopThread == true);

            PerspexLocator.CurrentMutable
                .Bind<IAssetLoader>().ToConstant(new AssetLoader())
                .Bind<ILayoutManager>().ToConstant(new LayoutManager())
                .Bind<IPclPlatformWrapper>().ToConstant(new PclPlatformWrapper())
                .Bind<IPlatformRenderInterface>().ToConstant(renderInterface)
                .Bind<IPlatformThreadingInterface>().ToConstant(threadingInterface)
                .Bind<IStandardCursorFactory>().ToConstant(new Mock<IStandardCursorFactory>().Object)
                .Bind<IWindowingPlatform>().ToConstant(new WindowingPlatformMock(() => windowImpl.Object));

            Styles = new DefaultTheme();
        }
コード例 #11
0
ファイル: FullLayoutTests.cs プロジェクト: hacklex/Perspex
        private void RegisterServices()
        {
            var fixture = new Fixture().Customize(new AutoMoqCustomization());


            var formattedText = fixture.Create<IFormattedTextImpl>();
            var globalStyles = new Mock<IGlobalStyles>();
            var renderInterface = fixture.Create<IPlatformRenderInterface>();
            var renderManager = fixture.Create<IRenderQueueManager>();
            var theme = new DefaultTheme();
            var windowImpl = new Mock<IWindowImpl>();

            windowImpl.SetupProperty(x => x.ClientSize);
            windowImpl.Setup(x => x.MaxClientSize).Returns(new Size(1024, 1024));
            globalStyles.Setup(x => x.Styles).Returns(theme);

            PerspexLocator.CurrentMutable
                .Bind<IInputManager>().ToConstant(new Mock<IInputManager>().Object)
                .Bind<IGlobalStyles>().ToConstant(globalStyles.Object)
                .Bind<ILayoutManager>().ToConstant(new LayoutManager())
                .Bind<IPlatformRenderInterface>().ToConstant(renderInterface)
                .Bind<IPlatformThreadingInterface>().ToConstant(new Mock<IPlatformThreadingInterface>().Object)
                .Bind<IRenderQueueManager>().ToConstant(renderManager)
                .Bind<IStyler>().ToConstant(new Styler())
                .Bind<IWindowImpl>().ToConstant(windowImpl.Object);
        }
コード例 #12
0
ファイル: FullLayoutTests.cs プロジェクト: MarkWalls/Perspex
        private void RegisterServices()
        {
            var fixture = new Fixture().Customize(new AutoMoqCustomization());
            var l = Locator.CurrentMutable;

            var formattedText = fixture.Create<IFormattedTextImpl>();
            var globalStyles = new Mock<IGlobalStyles>();
            var renderInterface = fixture.Create<IPlatformRenderInterface>();
            var renderManager = fixture.Create<IRenderManager>();
            var theme = new DefaultTheme();
            var windowImpl = new Mock<IWindowImpl>();

            globalStyles.Setup(x => x.Styles).Returns(theme);

            l.RegisterConstant(new Mock<IInputManager>().Object, typeof(IInputManager));
            l.RegisterConstant(globalStyles.Object, typeof(IGlobalStyles));
            l.RegisterConstant(new LayoutManager(), typeof(ILayoutManager));
            l.RegisterConstant(renderInterface, typeof(IPlatformRenderInterface));
            l.RegisterConstant(new Mock<IPlatformThreadingInterface>().Object, typeof(IPlatformThreadingInterface));
            l.RegisterConstant(renderManager, typeof(IRenderManager));
            l.RegisterConstant(new Styler(), typeof(IStyler));
            l.RegisterConstant(windowImpl.Object, typeof(IWindowImpl));
        }
コード例 #13
0
ファイル: XamlTestApp.cs プロジェクト: rdterner/Perspex
 public XamlTestApp()
 {
     RegisterServices();
     RegisterPlatform();
     Styles = new DefaultTheme();
 }