Exemple #1
0
        protected void AddMappingForISerializable(IDictionary <Type, ITypeContributor> typeImplementerMapping,
                                                  ITypeContributor instance)
        {
#if !SILVERLIGHT
            AddMapping(typeof(ISerializable), instance, typeImplementerMapping);
#endif
        }
Exemple #2
0
 /// <summary>
 ///   It is safe to add mapping (no mapping for the interface exists)
 /// </summary>
 protected void AddMappingNoCheck(
     Type @interface,
     ITypeContributor implementer,
     IDictionary <Type, ITypeContributor> mapping
     )
 {
     mapping.Add(@interface, implementer);
 }
Exemple #3
0
        protected void AddMapping(Type @interface, ITypeContributor implementer, IDictionary <Type, ITypeContributor> mapping)
        {
            Debug.Assert(implementer != null, "implementer != null");
            Debug.Assert(@interface != null, "@interface != null");
            Debug.Assert(@interface.GetTypeInfo().IsInterface, "@interface.IsInterface");

            if (!mapping.ContainsKey(@interface))
            {
                AddMappingNoCheck(@interface, implementer, mapping);
            }
        }
		protected void AddMapping(Type @interface, ITypeContributor implementer, IDictionary<Type, ITypeContributor> mapping)
		{
			Debug.Assert(implementer != null, "implementer != null");
			Debug.Assert(@interface != null, "@interface != null");
			Debug.Assert(@interface.IsInterface, "@interface.IsInterface");

			if (!mapping.ContainsKey(@interface))
			{
				AddMappingNoCheck(@interface, implementer, mapping);
			}
		}
		protected void AddMappingForISerializable(IDictionary<Type, ITypeContributor> typeImplementerMapping, ITypeContributor instance)
		{
#if SILVERLIGHT
#warning What to do?
#else
			AddMapping(typeof(ISerializable), instance, typeImplementerMapping);
#endif
		}
		/// <summary>
		/// It is safe to add mapping (no mapping for the interface exists)
		/// </summary>
		/// <param name="implementer"></param>
		/// <param name="interface"></param>
		/// <param name="mapping"></param>
		protected void AddMappingNoCheck(Type @interface, ITypeContributor implementer, IDictionary<Type, ITypeContributor> mapping)
		{
			mapping.Add(@interface, implementer);
		}
Exemple #7
0
		protected void AddMappingForISerializable(IDictionary<Type, ITypeContributor> typeImplementerMapping,
		                                          ITypeContributor instance)
		{
			AddMapping(typeof(ISerializable), instance, typeImplementerMapping);
		}