コード例 #1
0
        public void GuyWire_Delegates_To_FactoryInstaller()
        {
            var installer = new FactoryRegistration();

            _guyWire.Expect(g => g.ComponentsInfo).Return(new[] { installer });

            Assert.DoesNotThrow(() => _guyWire.Wire());
        }
コード例 #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            // Service Locator
            GuyWire guyWire = new GuyWire();

            guyWire.Wire();

            // Model Binders
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(DateTime?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(decimal?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(float?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(double?), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(DateTime), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(decimal), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(float), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(double), new LocalizedBinder());
            System.Web.Mvc.ModelBinders.Binders.Add(typeof(string), new StringBinder());
        }
コード例 #3
0
 protected void CreateGuyWire()
 {
     guyWire = new GuyWire();
     guyWire.Wire();
 }
コード例 #4
0
        private void OnStartup(object sender, StartupEventArgs e)
        {
            guyWire.Wire();

            RootVisual = guyWire.GetRoot();
        }