コード例 #1
0
        public DefaultContext()
        {
            var connectionString = ConfigurationManager.ConnectionStrings[CONNECTION_KEY].ToString();

            this.Factory     = UnitySetup.CreateFactory(this);
            this.DataContext = this.Factory.GetService <IDataContext>(connectionString);
        }
コード例 #2
0
 static void DidReloadScripts()
 {
     UnitySetup.SetupDefaultSingletonsIfNeeded();
     // Logd(" !! UnityEditor.Callbacks.DidReloadScripts");
     try { new SoundPlayer("C:/CompileSuccess.wav").Play(); }
     catch (Exception e) { Logd("Add a C:/CompileSuccess.wav to get better compile feedback, " + e); }
 }
コード例 #3
0
        public ConsumerContext()
        {
            var connectionString = ConfigurationManager.ConnectionStrings[CONNECTION_KEY].ToString();

            Factory     = UnitySetup.CreateFactory(this);
            DataContext = Factory.GetService <IDbContext>(connectionString);
        }
コード例 #4
0
 static void DidReloadScripts()
 {
     Logd(" !! UnityEditor.Callbacks.DidReloadScripts");
     UnitySetup.ResetAllStaticObjects();
     try { new SoundPlayer("C:/CompileSuccess.wav").Play(); }
     catch (Exception e) { Logd("Add a C:/CompileSuccess.wav to get better compile feedback, " + e); }
 }
コード例 #5
0
        public SenderContext()
        {
            var connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;

            Factory = UnitySetup.CreateFactory(this);
            DataContext = Factory.GetService<IDbContext>(connectionString);
        }
コード例 #6
0
 private static void ResetStaticInstances()
 {
     DisposeAllInjectors();
     EventBus.instance = new EventBus();
     IoC.inject        = new injection.Injector();
     UnitySetup.SetupDefaultSingletonsIfNeeded();
 }
コード例 #7
0
ファイル: XunitTestRunner.cs プロジェクト: shoshiiran/cscore
 private static void ResetStaticInstances()
 {
     AssertV2.throwExeptionIfAssertionFails = false;
     DisposeAllInjectors();
     EventBus.instance = new EventBus();
     IoC.inject        = new injection.Injector();
     UnitySetup.ResetAllStaticObjects();
 }
コード例 #8
0
ファイル: DefaultContext.cs プロジェクト: SashaBoss/Notch
        public DefaultContext()
            : base()
        {
            var connectionString = ConfigurationManager.ConnectionStrings[ConnectionKey].ToString();

            this.Factory     = UnitySetup.CreateFactory(this);
            this.DataContext = this.Factory.GetService <IDataContext>(connectionString);
            this.Logger      = LoggerSelector.Instance;
        }
コード例 #9
0
ファイル: DefaultContext.cs プロジェクト: SashaBoss/Notch
        public DefaultContext(GenericPrincipal prinipical, HttpContextBase requestContext)
            : base()
        {
            var connectionString = ConfigurationManager.ConnectionStrings[ConnectionKey].ToString();

            this._prinipical = prinipical;
            this.Factory     = UnitySetup.CreateFactory(this);
            this.DataContext = this.Factory.GetService <IDataContext>(connectionString);
            this.Logger      = LoggerSelector.Instance;
        }
コード例 #10
0
        public AutoMapperTest()
        {
            Setup();
            _mockedService = new Mock <MarsRoverService>(UnitySetup.Resolve <IApplicationSettings>())
            {
                CallBase = true
            };

            _roverInput = new RoverImageInputDto()
            {
                ImageDate = new DateTime(2016, 1, 1)
            };
        }
コード例 #11
0
 static void SetupAllMyInjections()
 {
     // In here the injection setup can be done AFTER the generic UnitySetup finished its own setup:
     UnitySetup.InvokeAfterUnitySetupDone(() => {
         var injector1 = new object();
         IoC.inject.RegisterInjector <MyExampleClass1ToInject>(injector1, (requester, createIfNull) => {
             return(new MyExampleClass1ToInject()
             {
                 myString = "Handled by MyExampleInjectionSetup"
             });
         });
         // .. here more injectors would be registered for other classes .. //
     });
 }
コード例 #12
0
        public override int Run(string[] remainingArguments)
        {
            try
            {
                var stopWatch = new Stopwatch();
                stopWatch.Start();

                var roverImageArchiver = UnitySetup.Resolve <IRoverImageArchiver>();
                var task = Task.Run(() =>
                                    roverImageArchiver.ArchiveImages(FileLocation));
                task.Wait();
                stopWatch.Stop();
                Log.Information($"Total Elasped Time in sec {stopWatch.Elapsed.TotalSeconds}");
                return((int)task.Result);
            }
            catch (Exception e)
            {
                Log.Error(e, "DownloadRoverImagesCommand.Run");
                return((int)ExitCode.UnknownError);
            }
        }
コード例 #13
0
 public RootContext(string connectionString, IMapper mapper)
 {
     this.connectionString = connectionString;
     this.factory          = UnitySetup.CreateServiceProviderFactory();
     this.mapper           = new MapperService(mapper);
 }
コード例 #14
0
ファイル: TestBase.cs プロジェクト: rojanulak/MarsRoverPhoto
 public void Setup()
 {
     AutoMapperConfig.Initialize();
     UnitySetup.RegisterComponents();
 }
コード例 #15
0
 public MarsRoverServiceTest()
 {
     Setup();
     _marsRoverService = new MarsRoverService(UnitySetup.Resolve <IApplicationSettings>());
 }
コード例 #16
0
 static void DidReloadScripts()
 {
     UnitySetup.SetupDefaultSingletonsIfNeeded();
     Logd(" !! UnityEditor.Callbacks.DidReloadScripts");
     try { new SoundPlayer("C:/CompileSuccess.wav").Play(); } catch (Exception e) { Debug.LogWarning(e); }
 }
コード例 #17
0
ファイル: Program.cs プロジェクト: rojanulak/MarsRoverPhoto
 private static void StartUp()
 {
     UnitySetup.RegisterComponents();
     AutoMapperConfig.Initialize();
 }
コード例 #18
0
ファイル: RootContext.cs プロジェクト: YurkoUA/MakingAnOrder
 public RootContext()
 {
     Factory     = UnitySetup.CreateFactory(this);
     DataContext = Factory.GetService <IDbContext>();
 }
コード例 #19
0
 public static void RegisterComponents()
 {
     UnitySetup.RegisterWebApiComponents();
     GlobalConfiguration.Configuration.DependencyResolver = new UnityDependencyResolver(UnitySetup.GetContainer());
 }