Example #1
0
        private async Task RegisterServices()
        {
            StorageFolder localFolder = ApplicationData.Current.LocalFolder;
            var           folder      = await localFolder.CreateFolderAsync("WarColorsData", CreationCollisionOption.OpenIfExists);

            container
            .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), folder.Path));

            container
            .PerRequest <IPlatform, MarcelloDB.uwp.Platform>();
        }
Example #2
0
        private void RegisterServices()
        {
            string path = Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
                "WarColorsData");

            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }

            container
            .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), path));

            container
            .PerRequest <IPlatform, MarcelloDB.netfx.Platform>();
        }
Example #3
0
 public T Get()
 {
     return(container.GetInstance <T>());
 }
Example #4
0
 /// <summary>
 /// Gets the instance.
 /// </summary>
 /// <typeparam name="T">Type of the instance</typeparam>
 /// <returns>The instance</returns>
 public static T GetInstance <T>() => container.GetInstance <T>();