Пример #1
0
		public void Register( string path )
		{
			try
			{
				AssemblyName assemblyName = new AssemblyName();
				assemblyName.Name = Path.GetFileNameWithoutExtension(path);
				assemblyName.CodeBase = path;
				Assembly assembly = Assembly.Load(assemblyName);
				NTrace.Debug( "Loaded " + Path.GetFileName(path) );

				foreach ( Type type in assembly.GetExportedTypes() )
				{
					if ( type.GetCustomAttributes(typeof(NUnitAddinAttribute), false).Length == 1 )
					{
						Addin addin = new Addin( type );
						addinRegistry.Register( addin );
						NTrace.Debug( "Registered addin: " + addin.Name );
					}
				}
			}
			catch( Exception ex )
			{
				// NOTE: Since the gui isn't loaded at this point, 
				// the trace output will only show up in Visual Studio
				NTrace.Error( "Failed to load" + path, ex  );
			}
		}
Пример #2
0
 public void Register(Assembly assembly)
 {
     foreach (Type type in assembly.GetExportedTypes())
     {
         if (type.GetCustomAttributes(typeof(NUnitAddinAttribute), false).Length == 1)
         {
             Addin addin = new Addin(type);
             Register(addin);
         }
     }
 }
Пример #3
0
        //public void Register(Type type)
        //{
        //    addins.Add( new Addin( type ) );
        //}

		public void Register(Addin addin)
		{
			addins.Add( addin );
		}
Пример #4
0
        //public void Register(Type type)
        //{
        //    addins.Add( new Addin( type ) );
        //}

        public void Register(Addin addin)
        {
            addins.Add(addin);
        }