AddMethod() public method

public AddMethod ( MethodInfo method, string cacheManagerId ) : void
method System.Reflection.MethodInfo
cacheManagerId string
return void
Ejemplo n.º 1
0
        private void GatherCacheAttributes(CacheConfig config, ComponentModel model)
        {
            MethodInfo[] methods = model.Implementation.GetMethods(
                BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);

            foreach (MethodInfo method in methods)
            {
                if (method.IsDefined(typeof(CacheAttribute), true))
                {
                    CacheAttribute[] attributs      = method.GetCustomAttributes(typeof(CacheAttribute), true) as CacheAttribute[];
                    string           cacheManagerId = attributs[0].CacheManagerId;

                    config.AddMethod(method, cacheManagerId);
                }
            }
        }
Ejemplo n.º 2
0
		private void GatherCacheAttributes(CacheConfig config, ComponentModel model)
		{
			MethodInfo[] methods = model.Implementation.GetMethods( 
				BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic );

			foreach(MethodInfo method in methods)
			{
				if (method.IsDefined( typeof(CacheAttribute), true ))
				{
					CacheAttribute[] attributs = method.GetCustomAttributes(typeof(CacheAttribute), true) as CacheAttribute[];
					string cacheManagerId = attributs[0].CacheManagerId;

					config.AddMethod( method, cacheManagerId );
				}
			}
		}