public void Setup(IDependencyContainer container)
 {
     if (container.HasBinding <IF_VR_IInterface>())
     {
         container.Unbind <IF_VR_IInterface>();
     }
     container.Bind <IF_VR_IInterface, IF_VR_Steam_Interface>();
 }
Esempio n. 2
0
 public void Setup(IDependencyContainer container)
 {
     if (container.HasBinding <IF_VR_IGrabStatus>())
     {
         container.Unbind <IF_VR_IGrabStatus>();
     }
     container.Bind <IF_VR_IGrabStatus, IF_VR_Glove_SteamVRManus_GrabStatus>();
 }
Esempio n. 3
0
        /// <summary>
        /// Resolves a data pipeline
        /// </summary>
        /// <param name="container">The container to action on</param>
        /// <param name="name">The name of the pipeline</param>
        /// <returns>The pipeline with the given name</returns>
        public static IPipeline ResolvePipeline(this IDependencyContainer container, string name)
        {
            if (!container.HasBinding <IPipeline>(name))
            {
                throw new Exception($"No pipeline registered with the name \"{name}\"");
            }

            return(container.Resolve <IPipeline>(name));
        }
Esempio n. 4
0
 /// <summary>
 /// Checks to see if a binding exists in the container
 /// </summary>
 /// <param name="container">The container to check against</param>
 /// <param name="name">Optional name of the binding</param>
 /// <typeparam name="T">Type to check against</typeparam>
 /// <returns>True if the type has been bound, false if not</returns>
 public static bool HasBinding <T>(this IDependencyContainer container, string name = null)
 {
     return(container.HasBinding(typeof(T), name));
 }
Esempio n. 5
0
 public static bool HasBinding <TType>(this IDependencyContainer container, string name = null) =>
 container.HasBinding(typeof(TType), name);