unity

Disable Unity created window in Xcode

I have built out a program in Unity and brought it into Xcode. The AppController.mm seems to create a UIWindow for the game to be viewed in. //Code int OpenEAGL_UnityCallback(UIWindow** window, int* screenWidth, int* screenHeight) { CGRect rect = [[UIScreen mainScreen] bounds]; // Create a full-screen window _window = [[UIWindow...

Unity setting problem when defined in code

I have problem when asking for default ILogger from Unity container. I have this setting defined in code (its VB.net) Dim container As IUnityContainer ... container.RegisterType(Of ILogger, NullLogger)() container.RegisterType(Of ILogger, EntLibLogger)("EL") When I am getting ILogger from container I may have different name, like: ...

Is there anything like Unity for simple things that don't require an interface?

Perhaps I'm misapplying Unity, but here goes. I have a couple of applications, both of which load the same plugin assemblies. All assemblies require a library, and I want them to be able to access this library via Unity. However, in order to use Unity, or any other IoC framework, I'd have to write an interface for this library. I wil...

IoC from start to finish

I'm quite sure that IoC is the way to go for my application. There are a ton of articles and even questions here on SO that discuss the different containers. I've read several blogs today with partial examples. I am personally leaning towards starting with the CommonServiceLocator and Unity as two way to solve the same problem -- I ju...

Did the Unity Team fix that "generics handling" bug back in 2008?

At my level of experience with Unity it might be faster to ask whether the "generics handling" bug acknowledged by ctavares back in 2008 was fixed in a public release. Here was the problem (which might be my problem today): Hi, I get an exception when using .... container.RegisterType(typeof(IDictionary<,>), typeof(Dicti...

checking player prefs from unity in Xcode

I made a simple scene that has some GUI buttons in Unity. When you press a button it will set a player preference to 1. I have a button for facebook, twitter and a store. In Xcode, when the value hits 1, it switches to a new window with facebook, twitter or the store. My problem is that when I try and retrieve the player preferences in X...

Resharper and Custom Live Template Not Working

Working with Unity, I thought it would be a good idea to create some LiveTemplates to help out with creating configuration entries. For example, I want to create some typeAlias elements in a file called "unity.config": <typeAlias alias="QueryService" type="type,QueryAssembly"/> So, I created a live template...

Unity: Replace registered type with another type at runtime

We have a scenario where the user can choose between different hardware at runtime. In the background we have several different hardware classes which all implement an IHardware interface. We would like to use Unity to register the currently selected hardware instance for this interface. However, when the user selects another hardware, t...

Unity: How to remove(unregister) registered instance from Unity mapping.

Hello, I meet one problem that i can't solve now. I have the following: UnityHelper.DefaultContainer.RegisterInstance(typeof(IMyInterface), "test", instance); where UnityHelper.DefaultContainer is my helper for getting unity container with loaded configuration. here I registered instance as an instance of IMyInterface. So anywhere(so...

Applying Unity in dynamic menu

I was going through Unity 2.0 to check if it has an effective use in our new application. My application is a Windows Forms application and uses a traditional bar menu (at the top), currently. My UIs (Windows Forms) more or less support Dependency Injection pattern since they all work with a class (Presentation Model Class) supplied to ...

Unity Framework - passing integer's and strings into resolved objects

Hi, is there a way using the Unity framework to pass an integer as an argument into the constructor or a resolved object? Pseudo code.. IService svc = Container.Resolve<ConcreteService>() in this case Concrete service will be something like this... public class ConcreteService { public ConcreteService(int val) { } } Al...

working with generic lifetime managers in unity config section

I have the following generic lifetime manager public class RequestLifetimeManager<T> : LifetimeManager, IDisposable { public override object GetValue() { return HttpContext.Current.Items[typeof(T).AssemblyQualifiedName]; } public override void RemoveValue() { HttpContext.Current.Items.Remove(t...

Cannot resolve Dictionary in Unity container

Hi, I've just stumbled upon this: within a Unity container, I want to register IDictionary<TK, TV>; assume that it's IDictionary<string, int> _unityContainer = new UnityContainer() .RegisterType<IDictionary<string, int>, Dictionary<string, int>>(); but if I try var d = _unityContainer.Resolve<IDictionary<string, int>>(); it f...

Wpf usercontrol with parameterised constructor

Hi, We are using Microsoft Unity and dependency injection and so we have parametrised constructor for the usercontrol. How to inject this dependency into usercontrol using XAML? I have added the usercontrol in XAML as below. xmlns:usrRefundArrivalProcessor="Ttl.Refunds.Wpf.Dashboad.Application.Usercontrols;assembly=Ttl.Refunds.Wpf.Da...

Passing List of Strings or Array of strings into Unity Injection Constructor (Config-Based)

I cannot seem to get unity working when attempting to pass in an array of strings into a constructor parameter list, while using XML configuration. When I try the following: <typeConfig ...> <constructor ...> <param ... parameterType="System.String[]"> <array> <value.../> <value.../> </array> </param...

Unity 2 and Enterprise library configuration tool

Hi, Can someone show me how to use Enterprise library configuration tool with Unity2 Whatever I did, when I open the Enterprise library configuration tool, I could not have it working with a Unity config file. When I click on the menu to add a new block, there is no Unity configuration block What am I doing wrong? Thank you for your ...

Where UnityContainerElement in Unity 2?

I was in Unity 1.2, use the following code: UnityConfigurationSection UnitySection = (UnityConfigurationSection)ConfigurationManager.GetSection("Unity"); Dictionary<string, IUnityContainer> Containers = new Dictionary<string, IUnityContainer>(); foreach (UnityContainerElement element in UnitySection.Containers) { IUnityContainer co...

how to unit test AOP?

i'm using Unity to do AOP, could someone give me some idea how to unit test them? ...

named type not used for constructor injection

Hi, I have a simple console application where I have the following setup: public interface ILogger { void Log(string message); } class NullLogger : ILogger { private readonly string version; public NullLogger() { version = "1.0"; } public NullLogger(string v) { version = v; } public void Log(str...

WPF + MvvM + Prism

Hi all, I am new in the Wpf & Mvvm world , but I have found a couple of examples and just found that there is some different way to instantiate the model. I would like to know the best/correct way to do it. both ways are using Unity What I've foud: var navigatorView = new MainView(); navigatorView.DataContext = m_Container.Resolve<INav...