상속: PropertyDescriptor
예제 #1
0
 /// <summary>
 /// Copies the initializers to the other <see cref="PropertyDescriptor"/>
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public DictionaryDescriptor CopyInitializers(DictionaryDescriptor other)
 {
     if (initializers != null)
     {
         other.AddInitializers(initializers.Select(init => init.Copy()).OfType <IDictionaryInitializer>());
     }
     return(this);
 }
예제 #2
0
 /// <summary>
 /// Copies the initializers to the other <see cref="PropertyDescriptor"/>
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public DictionaryDescriptor CopyInitializers(DictionaryDescriptor other)
 {
     if (initializers != null)
     {
         other.AddInitializers(initializers);
     }
     return(this);
 }
예제 #3
0
 /// <summary>
 /// Copies the meta-initializers to the other <see cref="PropertyDescriptor"/>
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public DictionaryDescriptor CopyMetaInitializers(DictionaryDescriptor other)
 {
     if (metaInitializers != null)
     {
         other.AddMetaInitializers(metaInitializers.Select(meta => meta.Copy()).OfType <IDictionaryMetaInitializer>());
     }
     return(this);
 }
예제 #4
0
        private static object Create(IDictionaryAdapter adapter, Type type, IDictionary dictionary, XPathAdapter xpathAdapter)
        {
            dictionary = dictionary ?? new Hashtable();
            var descriptor = new DictionaryDescriptor();

            adapter.This.Descriptor.CopyBehaviors(descriptor, b => b is XPathAdapter == false);
            descriptor.AddBehavior(xpathAdapter);
            return(adapter.This.Factory.GetAdapter(type, dictionary, descriptor));
        }
예제 #5
0
		private static DictionaryAdapterMeta GetDictionaryMeta(IDictionaryAdapter dictionaryAdapter, Type otherType)
		{
			var meta = dictionaryAdapter.Meta;
			if (otherType != null && otherType != meta.Type)
			{
				var descriptor = new DictionaryDescriptor();
				dictionaryAdapter.This.Descriptor.CopyBehaviors(descriptor);
				meta = dictionaryAdapter.This.Factory.GetAdapterMeta(otherType, descriptor);
			}
			return meta;
		}
예제 #6
0
        private void InitializeMeta(IDictionaryAdapterFactory factory, DictionaryDescriptor descriptor)
        {
            if (descriptor != null)
            {
                MetaInitializers = MetaInitializers.Prioritize(descriptor.MetaInitializers).ToArray();
            }

            foreach (var metaInitializer in MetaInitializers)
            {
                metaInitializer.Initialize(factory, this);
            }
        }
예제 #7
0
        private static DictionaryAdapterMeta GetDictionaryMeta(IDictionaryAdapter dictionaryAdapter, Type otherType)
        {
            var meta = dictionaryAdapter.Meta;

            if (otherType != null && otherType != meta.Type)
            {
                var descriptor = new DictionaryDescriptor();
                dictionaryAdapter.This.Descriptor.CopyBehaviors(descriptor);
                meta = dictionaryAdapter.This.Factory.GetAdapterMeta(otherType, descriptor);
            }
            return(meta);
        }
		private void InitializeMeta(IDictionaryAdapterFactory factory, DictionaryDescriptor descriptor)
		{
			if (descriptor != null)
			{
				MetaInitializers = MetaInitializers.Prioritize(descriptor.MetaInitializers).ToArray();
			}

			foreach (var metaInitializer in MetaInitializers)
			{
				metaInitializer.Initialize(factory, this);
			}
		}
예제 #9
0
 /// <summary>
 /// Copies the filtered initializers to the other <see cref="PropertyDescriptor"/>
 /// </summary>
 /// <param name="other"></param>
 /// <param name="selector"></param>
 /// <returns></returns>
 public DictionaryDescriptor CopyInitializers(DictionaryDescriptor other, Func <IDictionaryInitializer, bool> selector)
 {
     if (selector == null)
     {
         throw new ArgumentNullException("selector");
     }
     if (initializers != null)
     {
         other.AddInitializers(initializers.Where(selector));
     }
     return(this);
 }
		public DictionaryAdapterMeta(Type type, IDictionaryInitializer[] initializers,
									 IDictionaryMetaInitializer[] metaInitializers,
									 object[] behaviors, IDictionary<String, PropertyDescriptor> properties,
									 DictionaryDescriptor descriptor, IDictionaryAdapterFactory factory)
		{
			Type = type;
			Initializers = initializers;
			MetaInitializers = metaInitializers;
			Behaviors = behaviors;
			Properties = properties;

			InitializeMeta(factory, descriptor);
		}
예제 #11
0
        public DictionaryAdapterMeta(Type type, IDictionaryInitializer[] initializers,
                                     IDictionaryMetaInitializer[] metaInitializers,
                                     object[] behaviors, IDictionary <String, PropertyDescriptor> properties,
                                     DictionaryDescriptor descriptor, IDictionaryAdapterFactory factory)
        {
            Type             = type;
            Initializers     = initializers;
            MetaInitializers = metaInitializers;
            Behaviors        = behaviors;
            Properties       = properties;

            InitializeMeta(factory, descriptor);
        }
예제 #12
0
		/// <summary>
		/// Copies the initializers to the other <see cref="PropertyDescriptor"/>
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public DictionaryDescriptor CopyInitializers(DictionaryDescriptor other)
		{
			if (initializers != null)
			{
				other.AddInitializers(initializers);
			}
			return this;
		}
예제 #13
0
		/// <summary>
		/// Copies the filtered meta-initializers to the other <see cref="PropertyDescriptor"/>
		/// </summary>
		/// <param name="other"></param>
		/// <param name="selector"></param>
		/// <returns></returns>
		public DictionaryDescriptor CopyMetaInitializers(DictionaryDescriptor other,
														 Func<IDictionaryMetaInitializer, bool> selector)
		{
			if (selector == null)
			{
				throw new ArgumentNullException("selector");
			}
			if (metaInitializers != null)
			{
				other.AddMetaInitializers(metaInitializers.Where(selector));
			}
			return this;
		}
예제 #14
0
		private static object Create(IDictionaryAdapter adapter, Type type, IDictionary dictionary, XPathAdapter xpathAdapter)
		{
			dictionary = dictionary ?? new Hashtable();
			var descriptor = new DictionaryDescriptor(adapter.Meta.Behaviors);
			adapter.This.Descriptor.CopyBehaviors(descriptor);
			descriptor.AddBehavior(xpathAdapter);
			return adapter.This.Factory.GetAdapter(type, dictionary, descriptor);
		}
예제 #15
0
		/// <summary>
		/// Copies the initializers to the other <see cref="PropertyDescriptor"/>
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public DictionaryDescriptor CopyInitializers(DictionaryDescriptor other)
		{
			if (initializers != null)
			{
				other.AddInitializers(initializers.Select(init => init.Copy()).OfType<IDictionaryInitializer>());
			}
			return this;
		}
예제 #16
0
		/// <summary>
		/// Copies the meta-initializers to the other <see cref="PropertyDescriptor"/>
		/// </summary>
		/// <param name="other"></param>
		/// <returns></returns>
		public DictionaryDescriptor CopyMetaInitializers(DictionaryDescriptor other)
		{
			if (metaInitializers != null)
			{
				other.AddMetaInitializers(metaInitializers.Select(meta => meta.Copy()).OfType<IDictionaryMetaInitializer>());
			}
			return this;
		}
예제 #17
0
		object IDictionaryCreateStrategy.Create(IDictionaryAdapter adapter, Type type, IDictionary dictionary)
		{
			dictionary = dictionary ?? new Hashtable();
			var descriptor = new DictionaryDescriptor();
			adapter.This.Descriptor.CopyBehaviors(descriptor, b => b is XPathAdapter == false);
			descriptor.AddBehavior(XPathBehavior.Instance).AddBehavior(new XPathAdapter(new XmlDocument()));
			return adapter.This.Factory.GetAdapter(type, dictionary, descriptor);
		}