示例#1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            NinjectModule Module        = new ViewModule();
            NinjectModule serviceModule = new ServiceModule("DefaultConnection");
            var           kernel        = new StandardKernel(serviceModule, Module);

            DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
        }
示例#2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            //===Once a week
            timer.Interval = 650000000;
            timer.Elapsed += tm_Tick;
            path           = Server.MapPath("/");
        }
示例#3
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Storage is the only thing required for basic configuration.
            // Just discover what configuration options do you have.
            GlobalConfiguration.Configuration.UseSqlServerStorage("DefaultConnection");

            var container = new Container();

            GlobalConfiguration.Configuration.UseActivator(new ContainerJobActivator(container));
        }
示例#4
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);



            System.Timers.Timer aTimer = new System.Timers.Timer();
            aTimer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            aTimer.Interval = 300000;
            //aTimer.Interval = 60000;
            aTimer.Enabled = true;
        }
示例#5
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            var builder             = new ContainerBuilder();
            var controllersAssembly = Assembly.GetAssembly(typeof(HomeController));

            builder.RegisterInstance(new DataStoreHelper()).AsSelf();
            builder.RegisterControllers(controllersAssembly);
            // builder.Build();
            //   builder.RegisterModule(new PerRequestModule());

            var containerBuilder = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(containerBuilder));
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            At16HostController myController = new At16HostController();

            myController.CreateBlobContainer("blobcontainer");
            myController.CreateBlobContainer("at16messagecontainer");

            List <string> KvikneCamblobs = myController.GetListBlobNames("blobcontainer");
            List <string> at16TempHum    = myController.GetListBlobMessage("at16messagecontainer");
            Dictionary <string, string> tempDictionary = myController.GetMQTTTopicValue("temperature", at16TempHum);
            Dictionary <string, string> humDictionary  = myController.GetMQTTTopicValue("humidity", at16TempHum);

            At16tempLabel.Text = tempDictionary.Last().Value;
            At16humLabel.Text  = humDictionary.Last().Value;
            At16timeLabel.Text = tempDictionary.Last().Key;

            foreach (string blobname in KvikneCamblobs)
            {
                if (blobname.Substring(0, 6) == "webcam")
                {
                    ListItem newitem = new ListItem(blobname, "https://at16hoststorage.blob.core.windows.net/blobcontainer/" + blobname);

                    if (!GreetList.Items.Contains(newitem))
                    {
                        GreetList.Items.Add(new ListItem(blobname, "https://at16hoststorage.blob.core.windows.net/blobcontainer/" + blobname));
                    }
                }
            }

            if (IsFirstLoad)
            {
                AreaRegistration.RegisterAllAreas();
                RouteConfig2.RegisterRoutes(RouteTable.Routes);
                FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
                BundleConfig2.RegisterBundles(BundleTable.Bundles);
                IsFirstLoad = true;
            }
        }
示例#7
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);



            //IoC Register !!!!
            Bootstrapper.Instance.Bootstrap(new DependencyBootstrapper());

            //IoC Resolver !!!!
            var dependencyContainer = DependencyContainer.Current;

            var controllersAssembly = typeof(BaseController).Assembly;

            foreach (var controllerType in controllersAssembly.GetTypes().Where(t => typeof(BaseController).IsAssignableFrom(t) || typeof(Controller).IsAssignableFrom(t)))
            {
                dependencyContainer.Register(controllerType, controllerType);
            }

            DependencyResolver.SetResolver(new UIDependecyResolver());
        }