Ejemplo n.º 1
0
 public LoginVM()
 {
     Login    = new ActionCommand(x => login());
     Register = new ActionCommand(x => register());
     _data    = DependencyLoader.Singleton <IDataManager>();
     _nav     = DependencyLoader.Singleton <INavigationService>();
 }
Ejemplo n.º 2
0
        public void ThrowsIfSubDependencyNotInAnyAssemblyLoader()
        {
            var subDependency = CreateAssembly("");
            var name          = "a";
            var version       = new Version(1, 2, 3);

            CreateAssembly(
                "",
                name,
                version,
                subDependency)
            .VerifyDiagnostics()
            .VerifyEmit(testEmittedAssembly: (original, assembly, assemblyBytes) =>
            {
                var assemblyLoadContext = new AssemblyLoadContext(null, true);
                var assemblyLoader      = new MockAssemblyLoader(
                    new AssemblyLoadResult(assembly, assemblyBytes));
                var dependencyLoader = new DependencyLoader(
                    ImmutableArray.Create <IAssemblyLoader>(assemblyLoader),
                    new DependencyAttributeReader(),
                    _assemblyFactory,
                    GetLogger <DependencyLoader>());
                Assert.Throws <FlcException>(() => dependencyLoader.LoadDependenciesAsync(
                                                 new ProjectInfo(
                                                     "p",
                                                     new flc.ProjectSystem.Version(0, 0),
                                                     ImmutableArray.Create(""),
                                                     references: ImmutableArray.Create(new Reference(
                                                                                           Reference.ReferenceType.Assembly,
                                                                                           name,
                                                                                           version.ToString()))),
                                                 assemblyLoadContext,
                                                 Array.Empty <IAssembly>()).Result);
            });
        }
Ejemplo n.º 3
0
        // ----------------- End of Private Helper Methods -----------------------

        // ---------------- Delegate Notification Callbacks --------------------

        void NotifyDelegateDidRestorePurchase(StoreProduct product, bool isSuccessful, string errorMessage)
        {
            if (DependencyLoader.DependencyCheck <IapControllerDelegate>(iapDelegate, this, gameObject, debugger))
            {
                iapDelegate.DidRestoreProduct(product, isSuccessful, errorMessage);
            }
        }
Ejemplo n.º 4
0
 void NotifyDelegateDidValidateProducts(List <StoreProduct> products, bool isSuccessful, string errorMessage)
 {
     if (DependencyLoader.DependencyCheck <IapControllerDelegate>(iapDelegate, this, gameObject, debugger))
     {
         iapDelegate.DidValidateProducts(products, isSuccessful, errorMessage);
     }
 }
Ejemplo n.º 5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();

            DependencyLoader.LoadDependencies(services, @".\bin\Debug\netcoreapp2.0", "Services.dll");
            DependencyLoader.LoadDependencies(services, @".\bin\Debug\netcoreapp2.0", "DataLayer.dll");
        }
Ejemplo n.º 6
0
 protected void Application_Start()
 {
     AreaRegistration.RegisterAllAreas();
     FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
     RouteConfig.RegisterRoutes(RouteTable.Routes);
     BundleConfig.RegisterBundles(BundleTable.Bundles);
     DependencyLoader.LoadModules();
 }
Ejemplo n.º 7
0
 // Start is called before the first frame update
 void Start()
 {
     if (DependencyLoader.DependencyCheck <InputSettings>(inputSettings, this, gameObject, debugger))
     {
         worldInput = gameObject.AddComponent <WorldInputController>() as WorldInputController;
         worldInput.SetDependencies(this, screenCam);
     }
 }
Ejemplo n.º 8
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
            var container = DependencyLoader.LoadDependency();

            container.RegisterWebApiControllers(GlobalConfiguration.Configuration);
            container.Verify();
            GlobalConfiguration.Configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container);
        }
Ejemplo n.º 9
0
 public EditNoteVM()
 {
     _data  = DependencyLoader.Singleton <IDataManager>();
     _nav   = DependencyLoader.Singleton <INavigationService>();
     _note  = new NoteModel();
     Save   = new ActionCommand(x => save());
     Delete = new ActionCommand(x => delete());
     IsEdit = false;
 }
Ejemplo n.º 10
0
    void Awake()
    {
        iapController = gameObject.AddComponent <IapController>() as IapController;
        iapController.SetDependencies(this);

        debugger = DependencyLoader.LoadGameObject <Debugger>("Debugger", this, gameObject) as Debugger;

        if (this.products == null)
        {
            this.products = new List <StoreProduct>();
        }
    }
Ejemplo n.º 11
0
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            var modules = new List <INinjectModule>();

            modules.Add(DependencyLoader.LoadModule());

            kernel.Load(modules);

            kernel.Bind <IAuthenticationManager>().ToMethod(m => HttpContext.Current.GetOwinContext().Authentication);
            kernel.Bind <IUserStore <ApplicationUser> >().To <UserStore <ApplicationUser> >();
            kernel.Bind <System.Data.Entity.DbContext>().To(typeof(ApplicationDbContext));
        }
Ejemplo n.º 12
0
        public MainView()
        {
            InitializeComponent();

            _navigation = new NavigationView();
            Master      = _navigation;
            Detail      = new NavigationPage(new SettingsView());

            DependencyLoader.Singleton <INavigationService>().setMasterDetailPage(this);

            var mainVM = new MainVM();

            BindingContext = mainVM;
        }
Ejemplo n.º 13
0
 public void CanLoadDependeciesWithSubdependencies()
 {
     CreateAssembly(
         "",
         "sub",
         new Version(1, 2, 3))
     .VerifyDiagnostics()
     .VerifyEmit(testEmittedAssembly: (_, subDependency, subDependencyBytes) =>
     {
         var name    = "a";
         var version = new Version(1, 2, 3);
         CreateAssembly(
             "",
             name,
             version)
         .VerifyDiagnostics()
         .VerifyEmit(testEmittedAssembly: (original, assembly, assemblyBytes) =>
         {
             var assemblyLoadContext = new AssemblyLoadContext(null, true);
             var assemblyLoader      = new MockAssemblyLoader(
                 new AssemblyLoadResult(subDependency, subDependencyBytes),
                 new AssemblyLoadResult(assembly, assemblyBytes));
             var dependencyLoader = new DependencyLoader(
                 ImmutableArray.Create <IAssemblyLoader>(assemblyLoader),
                 new DependencyAttributeReader(),
                 _assemblyFactory,
                 GetLogger <DependencyLoader>());
             var dependencies = dependencyLoader.LoadDependenciesAsync(
                 new ProjectInfo(
                     "p",
                     new flc.ProjectSystem.Version(0, 0),
                     ImmutableArray.Create(""),
                     references: ImmutableArray.Create(new Reference(
                                                           Reference.ReferenceType.Assembly,
                                                           name,
                                                           version.ToString()))),
                 assemblyLoadContext,
                 Array.Empty <IAssembly>()).Result;
             var dependency = dependencies.Single();
             Assert.Equal(original.Name, dependency.Name);
             Assert.Equal(original.Version, dependency.Version);
         });
     });
 }
Ejemplo n.º 14
0
        public void GetDependencyPatterns_ShouldAddMissingConfigExtension(string dependencies, int dependencyCount, string file)
        {
            // Arrange
            var attributes      = new[] { new XAttribute("dependencies", dependencies) };
            var attributeLoader = Substitute.For <IAttributeLoader>();

            attributeLoader.GetAttributesOnRootElement(file).Returns(attributes);

            // Act
            var loader   = new DependencyLoader(attributeLoader);
            var patterns = loader.GetDependencyPatterns(file).ToList();

            // Assert
            patterns.Should().HaveCount(dependencyCount);
            foreach (var pattern in patterns)
            {
                pattern.Should().EndWithEquivalent(".config");
            }
        }
        void Awake()
        {
            GameAnalytics.Initialize();

            debugger = DependencyLoader.LoadGameObject <Debugger>("Debugger", this, gameObject) as Debugger;
        }
Ejemplo n.º 16
0
 protected void Application_Start(object sender, EventArgs e)
 {
     DependencyLoader.Register();
     GlobalConfiguration.Configure(WebApiConfig.Configure);
 }
Ejemplo n.º 17
0
        public PluginEntry()
        {
            DependencyLoader.LoadDependencies();

            Plugins.Start();
        }
Ejemplo n.º 18
0
 public SettingsVM()
 {
     _nav   = DependencyLoader.Singleton <INavigationService>();
     _data  = DependencyLoader.Singleton <IDataManager>();
     Logout = new ActionCommand(x => logoutAndLogin());
 }
Ejemplo n.º 19
0
 void Awake()
 {
     debugger = DependencyLoader.LoadGameObject <Debugger>("Debugger", this, gameObject) as Debugger;
 }
Ejemplo n.º 20
0
 public NotesDatabase()
 {
     _con = DependencyLoader.New <ISQLite>().getConnection();
     _con.CreateTable <NoteModel>();
     _con.CreateTable <UserModel>();
 }
Ejemplo n.º 21
0
 public DataManager()
 {
     _local  = DependencyLoader.New <INotesDatabase>();
     _remote = DependencyLoader.New <IRestService>();
 }
Ejemplo n.º 22
0
 public MainVM()
 {
     _data = DependencyLoader.New <IDataManager>();
     _nav  = DependencyLoader.Singleton <INavigationService>();
     isLoggedIn();
 }
Ejemplo n.º 23
0
 public NotesVM()
 {
     _data   = DependencyLoader.Singleton <IDataManager>();
     _nav    = DependencyLoader.Singleton <INavigationService>();
     AddNote = new ActionCommand(x => _nav.navigateEditNote());
 }
Ejemplo n.º 24
0
 void Awake()
 {
     debugger  = DependencyLoader.LoadGameObject <Debugger>("Debugger", this, gameObject) as Debugger;
     analytics = gameObject.AddComponent <AnalyticsController>() as AnalyticsController;
 }