Example #1
0
 /// <summary>
 /// Raises the FileFound event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnFileFound(object sender, SearchEventArgs e)
 {
     try
     {
         if (this.FileFound != null)
         {
             this.FileFound(sender, e);
         }
     }
     catch (System.Exception systemException)
     {
         Trace.WriteLine(systemException);
     }
 }
		/// <summary>
		/// Occurs when a file is found that matches the search pattern
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnFileFound(object sender, SearchEventArgs e)
		{
			try
			{	
				_file = e.File;

//				if (_outputWindow != null)							
//					_outputWindow.Write("Searching for SnapIns...\nSearching for SnapIns in '" + _file.Name + "'\n\n");
			
//				System.Diagnostics.Trace.WriteLine("Searching for SnapIns in '" + _file.FullName + "'", this.GetType().Name);
				
				RuntimeClassProvider provider = new RuntimeClassProvider();
				provider.PublicClassDiscovered += new RuntimeClassProviderEventHandler(this.OnPublicClassDiscovered);

				switch(_algorithm)
				{
				case SnapInLocationAlgorithms.LocateUsingEnumeration:
					provider.DiscoverTypesUsingEnumeration(e.File);
					break;
				case SnapInLocationAlgorithms.LocateUsingMetadata:
					provider.DiscoverTypesUsingMetaData(e.File);
					break;
				};							
			}
			catch(System.Exception systemException)
			{
				System.Diagnostics.Trace.WriteLine(systemException);
			}
		}
Example #3
0
		/// <summary>
		/// Raises the FileFound event
		/// </summary>
		/// <param name="sender"></param>
		/// <param name="e"></param>
		private void OnFileFound(object sender, SearchEventArgs e)
		{
			try
			{
				if (this.FileFound != null)
					this.FileFound(sender, e);
			}
			catch (System.Exception systemException) 
			{
				Trace.WriteLine(systemException); 
			}	
		}