当前位置: 首页>>代码示例>>C#>>正文


C# SimpleContainer.GetResolver方法代码示例

本文整理汇总了C#中SimpleContainer.GetResolver方法的典型用法代码示例。如果您正苦于以下问题:C# SimpleContainer.GetResolver方法的具体用法?C# SimpleContainer.GetResolver怎么用?C# SimpleContainer.GetResolver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleContainer的用法示例。


在下文中一共展示了SimpleContainer.GetResolver方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init ();
            Xamarin.FormsMaps.Init ();
            // Code for starting up the Xamarin Test Cloud Agent
            #if ENABLE_TEST_CLOUD
            Xamarin.Calabash.Start();
            #endif

            MR.Gestures.iOS.Settings.LicenseKey = "6XZT-V54J-73E4-4VK8-RFAJ-ZBS8-Q8UB-Y3W7-BSGP-FETM-EYQ9-QEPP-WRTA";
            CachedImageRenderer.Init ();

            //ImageService.Initialize(
            //Necessary IOC Code To Get Device Properties
            var container = new SimpleContainer ();
            container.Register<IDevice> (t => AppleDevice.CurrentDevice);
            container.Register<IDisplay> (t => t.Resolve<IDevice> ().Display);
            if( !Resolver.IsSet )
                Resolver.SetResolver (container.GetResolver ());

            // Initialize the parse bluemart client
            try
            {
                ParseClient.Initialize("EUDL8rKwCc1JcL8tw5KsW1QB9ePSGx2dSBTobbE5","PNOG7XhRV8tuB907fQ0S0b5ShaIzYN0wVPZ3AyoN");
            }
            catch(ParseException e) {
                //Log.Warn("BlueMart",e.Message.ToString());
            }

            LoadApplication (new App ());

            return base.FinishedLaunching (app, options);
        }
开发者ID:jiletx,项目名称:Bluemart,代码行数:33,代码来源:AppDelegate.cs

示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var resolverContainer = new SimpleContainer();

            resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice)
                .Register<IDisplay>(t => t.Resolve<IDevice>().Display)
                .Register<IFontManager>(t => new FontManager(t.Resolve<IDisplay>()))
                //.Register<IJsonSerializer, Services.Serialization.JsonNET.JsonSerializer>()
                //.Register<IJsonSerializer, JsonSerializer>()
                //.Register<IEmailService, EmailService>()
                .Register<IMediaPicker, MediaPicker>()
                .Register<ITextToSpeechService, TextToSpeechService>()
                .Register<IDependencyContainer>(resolverContainer)
                .Register<IAdvancedTimer>(t => new AdvancedTimer.Forms.Plugin.Droid.AdvancedTimerImplementation());
                //.Register<IXFormsApp>(app)
                //.Register<ISecureStorage>(t => new KeyVaultStorage(t.Resolve<IDevice>().Id.ToCharArray()))
                //.Register<ISimpleCache>(
                //    t => new SQLiteSimpleCache(new SQLitePlatformAndroid(),
                //        new SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()));

            Resolver.SetResolver(resolverContainer.GetResolver());

            global::Xamarin.Forms.Forms.Init(this, bundle);
            AdvancedTimer.Forms.Plugin.Droid.AdvancedTimerImplementation.Init();
            LoadApplication(new App());
        }
开发者ID:xlent-bi,项目名称:XlentLock,代码行数:28,代码来源:MainActivity.cs

示例3: SetIoc

		/// <summary>
		/// Sets the IoC.
		/// </summary>
		private void SetIoc()
		{
			var resolverContainer = new SimpleContainer();

			var app = new XFormsAppiOS();
			app.Init(this);

			var documents = app.AppDataDirectory;
			var pathToDatabase = Path.Combine(documents, "xforms.db");

			resolverContainer.Register<IDevice>(t => AppleDevice.CurrentDevice)
				.Register<IDisplay>(t => t.Resolve<IDevice>().Display)
				.Register<IFontManager>(t => new FontManager(t.Resolve<IDisplay>()))
				//.Register<IJsonSerializer, XLabs.Serialization.ServiceStack.JsonSerializer>()
				//.Register<IJsonSerializer, Services.Serialization.SystemJsonSerializer>()
				//.Register<ITextToSpeechService, TextToSpeechService>()
				//.Register<IEmailService, EmailService>()
				.Register<IMediaPicker, MediaPicker>()
				.Register<IXFormsApp>(app)
				.Register<ISecureStorage, SecureStorage>()
				.Register<IDependencyContainer>(t => resolverContainer)
				/*.Register<ISimpleCache>(
					t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS(),
						new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()))*/;

			Resolver.SetResolver(resolverContainer.GetResolver());
		}
开发者ID:codelinguist,项目名称:Pdia,代码行数:30,代码来源:AppDelegate.cs

示例4: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            FontsOverride.setDefaultFont(this, "DEFAULT", "fonts/Arial-Rounded-MT-Bold.ttf");

            global::Xamarin.Forms.Forms.Init (this, bundle);
                Xamarin.FormsMaps.Init(this, bundle);

            MR.Gestures.Android.Settings.LicenseKey = "6XZT-V54J-73E4-4VK8-RFAJ-ZBS8-Q8UB-Y3W7-BSGP-FETM-EYQ9-QEPP-WRTA";
            CachedImageRenderer.Init ();

            //Necessary IOC Code To Get Device Properties
            var container = new SimpleContainer ();
            container.Register<IDevice> (t => AndroidDevice.CurrentDevice);
            container.Register<IDisplay> (t => t.Resolve<IDevice> ().Display);
            if( !Resolver.IsSet )
                Resolver.SetResolver (container.GetResolver ());

            // Initialize the parse bluemart client
            try
            {
                ParseClient.Initialize("EUDL8rKwCc1JcL8tw5KsW1QB9ePSGx2dSBTobbE5","PNOG7XhRV8tuB907fQ0S0b5ShaIzYN0wVPZ3AyoN");
            }
            catch(ParseException e) {
                Log.Warn("BlueMart",e.Message.ToString());
            }

            LoadApplication (new App ());
        }
开发者ID:jiletx,项目名称:Bluemart,代码行数:30,代码来源:MainActivity.cs

示例5: SetIoc

		/// <summary>
		/// Sets the IoC.
		/// </summary>
		private void SetIoc()
		{
			var resolverContainer = new SimpleContainer();

			var app = new XFormsAppDroid();

			app.Init(this);

			var documents = app.AppDataDirectory;
			var pathToDatabase = Path.Combine(documents, "xforms.db");

			resolverContainer.Register<IDevice> (t => AndroidDevice.CurrentDevice)
				.Register<IDisplay> (t => t.Resolve<IDevice> ().Display)
				.Register<IFontManager> (t => new FontManager (t.Resolve<IDisplay> ()))
			//.Register<IJsonSerializer, Services.Serialization.JsonNET.JsonSerializer>()
			//.Register<IJsonSerializer, JsonSerializer>()
			//.Register<IEmailService, EmailService>()
				.Register<IMediaPicker, MediaPicker> ()
			//.Register<ITextToSpeechService, TextToSpeechService>()
				.Register<IDependencyContainer> (resolverContainer)
				.Register<IXFormsApp> (app)
				.Register<ISecureStorage> (t => new KeyVaultStorage (t.Resolve<IDevice> ().Id.ToCharArray ()));
				/*.Register<ISimpleCache>(
					t => new SQLiteSimpleCache(new SQLitePlatformAndroid(),
						new SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()));*/


			Resolver.SetResolver(resolverContainer.GetResolver());
		}
开发者ID:codelinguist,项目名称:Pdia,代码行数:32,代码来源:MainActivity.cs

示例6: SetIoc

        private void SetIoc()
        {
            var resolverContainer = new SimpleContainer();

            var app = new XFormsAppiOS();
            app.Init(this);
            resolverContainer.Register<IXFormsApp>(app);

            var documents = app.AppDataDirectory;

            //resolverContainer.Register<IGeolocator, Geolocator>();
            //resolverContainer.Register<IEmailService, EmailService>();
            //resolverContainer.Register<IMediaPicker, MediaPicker>();
            //resolverContainer.Register<IDevice>( t => AppleDevice.CurrentDevice);
            Resolver.SetResolver(resolverContainer.GetResolver());

            DependencyService.Register<Geolocator> ();

            //resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice);
            //Resolver.SetResolver(resolverContainer.GetResolver());

            Console.WriteLine ("Here");
            Util util = new Util ();
            util.EnableLocationServices ();

            //manager.AuthorizationChanged += (sender, args) => {
               // Console.WriteLine ("Authorization changed to: {0}", args.Status);
            //};
            //if (UIDevice.CurrentDevice.CheckSystemVersion(8,0))
            //    manager.RequestWhenInUseAuthorization();
        }
开发者ID:ParagBalapure,项目名称:maptest,代码行数:31,代码来源:AppDelegate.cs

示例7: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            global::Xamarin.Forms.Forms.Init (this, bundle);

            ToastNotificatorImplementation.Init();

            EventProvider.ContentResolver = ContentResolver;
            DependencyService.Register<EventProvider> ();
            DependencyService.Register<EventNotification> ();
            DependencyService.Register<Geolocator> ();

            if (!Resolver.IsSet) {
                var documents = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
                var pathToDatabase = Path.Combine(documents, "xforms.db");

                var resolverContainer = new SimpleContainer();
                var serializer = new SystemJsonSerializer();

                resolverContainer
                    .Register<IJsonSerializer> (t => serializer)
                    .Register<IRestClient>(new JsonRestClient(serializer))
                    .Register<ISimpleCache> (
                    t => new SQLiteSimpleCache (new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid (),
                        new SQLite.Net.SQLiteConnectionString (pathToDatabase, true), t.Resolve<IJsonSerializer> ()));

                Resolver.SetResolver(resolverContainer.GetResolver());
            }

            LoadApplication (new App ());
        }
开发者ID:0rupp,项目名称:XToggl,代码行数:32,代码来源:MainActivity.cs

示例8: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();

            var resolverContainer = new SimpleContainer();

            resolverContainer.Register<IDevice>(t => AppleDevice.CurrentDevice)
                .Register<IDisplay>(t => t.Resolve<IDevice>().Display)
                .Register<IFontManager>(t => new FontManager(t.Resolve<IDisplay>()))
                //.Register<IJsonSerializer, XLabs.Serialization.ServiceStack.JsonSerializer>()
                //.Register<IJsonSerializer, Services.Serialization.SystemJsonSerializer>()
                .Register<ITextToSpeechService, TextToSpeechService>()
                .Register<IEmailService, EmailService>()
                .Register<IMediaPicker, MediaPicker>()
                //.Register<IXFormsApp>(app)
                .Register<ISecureStorage, SecureStorage>()
                .Register<IDependencyContainer>(t => resolverContainer);
            //.Register<ISimpleCache>(
            //    t => new SQLiteSimpleCache(new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS(),
            //        new SQLite.Net.SQLiteConnectionString(pathToDatabase, true), t.Resolve<IJsonSerializer>()));

            Resolver.SetResolver(resolverContainer.GetResolver());
            LoadApplication(new App());
            return base.FinishedLaunching(app, options);
        }
开发者ID:erkj,项目名称:XlentLock,代码行数:32,代码来源:AppDelegate.cs

示例9: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            //initialising shared project variables
            App.screenWidth = (int)(Resources.DisplayMetrics.WidthPixels / Resources.DisplayMetrics.Density);
            App.screenHeight = (int)(Resources.DisplayMetrics.HeightPixels / Resources.DisplayMetrics.Density);
            App.cameraAccessGranted = true;

            base.OnCreate(bundle);

            //initialising the resolver for the devices camera
            //used in the CameraViewModel class for cross-platform
            //camera functionality
            #region Resolver Init
            SimpleContainer container = new SimpleContainer();
            container.Register<IDevice>(t => AndroidDevice.CurrentDevice);
            container.Register<IDisplay>(t => t.Resolve<IDevice>().Display);
            container.Register<INetwork>(t => t.Resolve<IDevice>().Network);

            Resolver.SetResolver(container.GetResolver());
            #endregion

            global::Xamarin.Forms.Forms.Init(this, bundle);
            global::Xamarin.FormsMaps.Init (this, bundle);
            LoadApplication(new App());
        }
开发者ID:EclipseSystems,项目名称:INB302-IT-Capstone-Unit,代码行数:25,代码来源:MainActivity.cs

示例10: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            //initialising shared project variables
            App.screenWidth = (int)UIScreen.MainScreen.Bounds.Width;
            App.screenHeight = (int)UIScreen.MainScreen.Bounds.Height;
            App.cameraAccessGranted = true;

            //initialising the resolver for the devices camera
            //used in the CameraViewModel class for cross-platform
            //camera functionality
            #region Resolver Init
            SimpleContainer container = new SimpleContainer();
            container.Register<IDevice>(t => AppleDevice.CurrentDevice);
            container.Register<IDisplay>(t => t.Resolve<IDevice>().Display);
            container.Register<INetwork>(t => t.Resolve<IDevice>().Network);

            Resolver.SetResolver(container.GetResolver());
            #endregion

            global::Xamarin.Forms.Forms.Init();
            global::Xamarin.FormsMaps.Init();
            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }
开发者ID:EclipseSystems,项目名称:INB302-IT-Capstone-Unit,代码行数:32,代码来源:AppDelegate.cs

示例11: SetIoc

        //  Inversion of control setup
        private void SetIoc()
        {
            var resolverContainer = new SimpleContainer();

            var app = new XFormsAppiOS();
            app.Init(this);
            resolverContainer.Register<IXFormsApp>(app);

            var documents = app.AppDataDirectory;

            // UNEEDED CONTROLS FOR TEST
            //resolverContainer.Register<IGeolocator, Geolocator>();
            //resolverContainer.Register<IEmailService, EmailService>();
            //resolverContainer.Register<IMediaPicker, MediaPicker>();
            //resolverContainer.Register<IDevice>( t => AppleDevice.CurrentDevice);
            Resolver.SetResolver(resolverContainer.GetResolver());

            DependencyService.Register<Geolocator> ();

            //resolverContainer.Register<IDevice>(t => AndroidDevice.CurrentDevice);
            //Resolver.SetResolver(resolverContainer.GetResolver());

            //  Startup location services

            Util util = new Util ();
            util.EnableLocationServices ();
        }
开发者ID:bertbeck,项目名称:maptest,代码行数:28,代码来源:AppDelegate.cs

示例12: IoC

        private void IoC()
        {
            var resolverContainer = new SimpleContainer();

            resolverContainer.Register<IDependencyContainer>(t => resolverContainer);

            Resolver.SetResolver(resolverContainer.GetResolver());
        }
开发者ID:AnnMarieTorres,项目名称:SampleObservableCollectionXFL,代码行数:8,代码来源:AppDelegate.cs

示例13: SetIoc

        private void SetIoc()
        {
            var resolverContainer = new SimpleContainer();

            resolverContainer.Register<IGeolocator, Geolocator>();

            Resolver.SetResolver(resolverContainer.GetResolver());
        }
开发者ID:elschihyi,项目名称:Tap5050Buyer,代码行数:8,代码来源:MainActivity.cs

示例14: SetIoc

        private void SetIoc()
        {
            var resolverContainer = new SimpleContainer();

            resolverContainer.Register<IDevice>(r => AndroidDevice.CurrentDevice);
            resolverContainer.Register<MainViewModel>(r => new MainViewModel(r.Resolve<IDevice>()));

            Resolver.SetResolver(resolverContainer.GetResolver());
        }
开发者ID:ashokkumarreddy1987,项目名称:learnings,代码行数:9,代码来源:MainActivity.cs

示例15: SetIoc

		private void SetIoc()
		{
			var resolverContainer = new SimpleContainer();

			var app = new XFormsAppWP();
			app.Init(this);

			Resolver.SetResolver(resolverContainer.GetResolver());
		}
开发者ID:backendeveloper,项目名称:Codenutz.XamarinFormsLabs.Basics,代码行数:9,代码来源:App.xaml.cs


注:本文中的SimpleContainer.GetResolver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。