예제 #1
0
        public MainPage()
        {
            this.InitializeComponent();

            CgmApplication cgmApplication = new CgmApplication();

            //add text-file logging
            cgmApplication.AddFileLog(Windows.Storage.ApplicationData.Current.LocalFolder.Path);
#if DEBUG
            //on debug add logging to output
            cgmApplication.AddOutputLog();
#endif

            cgmApplication.AddStateRepsitory();
            cgmApplication.AddDevice <CGM.Uwp.Device.UwpBayerDevice>();


            cgmApplication.AddNightscoutBehavoir("---- insert your nightscout url here ", " ----- and the api-key here");

            //not implemented yet
            //cgmApplication.AddWebTransferBehavoir("", "");
            //not implemented yet
            //cgmApplication.AddMiniMedDatabase();

            cgmApplication.Start();



            //IUnityContainer container = new UnityContainer();

            //container.RegisterType<IStateRepository, CGM.Data.SessionStateRepository>();
            //container.RegisterType<IDevice, CGM.Uwp.Device.UwpBayerDevice>(new ContainerControlledLifetimeManager());
            //container.RegisterType<ISessionFactory, MiniMedContext>(new ContainerControlledLifetimeManager());


            //CgmSessionBehaviors behaviors = new CgmSessionBehaviors();
            ////behaviors.SessionBehaviors.Add(container.Resolve<NightScoutUploader>());

            //container.RegisterInstance(typeof(ISessionBehaviors), behaviors);


            //container.RegisterSingleton<ICgmTask, CgmTask>();

            //UnityServiceLocator locator = new UnityServiceLocator(container);
            //ServiceLocator.SetLocatorProvider(() => locator);

            //container.Resolve<ICgmTask>();
        }
예제 #2
0
        static void Main(string[] args)
        {
            CgmApplication cgmApplication = new CgmApplication();

            //add text-file logging
            cgmApplication.AddFileLog("Logs");
#if DEBUG
            //on debug add logging to output
            cgmApplication.AddOutputLog();
#endif

            cgmApplication.AddStateRepsitory();
            cgmApplication.AddDevice <CGM.Hid.Device.HidBayerDevice>();

            cgmApplication.AddNightscoutBehavoir("---- insert your nightscout url here ", " ----- and the api-key here");

            cgmApplication.Start();

            System.Console.ReadLine();
        }