System.Xaml.Schema.XamlTypeInvoker.AddToDictionary C# (CSharp) Method

AddToDictionary() public method

public AddToDictionary ( object instance, object key, object item ) : void
instance object
key object
item object
return void
		public virtual void AddToDictionary (object instance, object key, object item)
		{
			if (instance == null)
				throw new ArgumentNullException ("instance");

			var t = instance.GetType ();
			if (t.IsGenericType)
				instance.GetType ().GetMethod ("Add", t.GetGenericArguments ()).Invoke (instance, new object [] {key, item});
			else
				instance.GetType ().GetMethod ("Add", new Type [] {typeof (object), typeof (object)}).Invoke (instance, new object [] {key, item});
		}