Castle.MicroKernel.Context.CreationContext.EnsureAdditionalArgumentsWriteable C# (CSharp) Méthode

EnsureAdditionalArgumentsWriteable() private méthode

private EnsureAdditionalArgumentsWriteable ( IDictionary dictionary ) : IDictionary
dictionary IDictionary
Résultat IDictionary
		private IDictionary EnsureAdditionalArgumentsWriteable(IDictionary dictionary)
		{
			// NOTE: this is actually here mostly to workaround the fact that ReflectionBasedDictionaryAdapter is read only
			// we could make it writeable instead, but I'm not sure that would make sense.
			// NOTE: As noted in IOC-ISSUE-190 that may lead to issues with custom IDictionary implementations
			// We better just ignore not known implementations and if someone uses one, it's their problem to take that into
			// account when dealing with DynamicParameters
			if (dictionary == null)
			{
				return null;
			}

			if (!(dictionary is ReflectionBasedDictionaryAdapter))
			{
				return dictionary;
			}
			return new Arguments(dictionary);
		}