/// <summary>
 /// Extracts the Types that the specified as dependencies via attributes on the specified Type.
 /// </summary>
 /// <param name="type">The Type that contains the attributes to read</param>
 /// <returns></returns>
 private Type[] ExtractTypesThatThisTypeDependsOn(Type type)
 {
     try
     {
         if (type != null)
         {
             object[] attributes = type.GetCustomAttributes(typeof(SnapInDependencyAttribute), true);
             if (attributes != null)
             {
                 Type[] dependencies = new Type[attributes.Length];
                 for (int i = 0; i < attributes.Length; i++)
                 {
                     SnapInDependencyAttribute da = (SnapInDependencyAttribute)attributes[i];
                     dependencies[i] = this.GetTypeFromAttribute(da);
                 }
                 return(dependencies);
             }
         }
     }
     catch (System.Exception systemException)
     {
         System.Diagnostics.Trace.WriteLine(systemException);
     }
     return(new Type[] {});
 }
 /// <summary>
 /// Returns the Type from the attribute.
 /// </summary>
 /// <param name="attribute">The attribute to read</param>
 /// <returns></returns>
 private Type GetTypeFromAttribute(SnapInDependencyAttribute attribute)
 {
     try
     {
         return(attribute.Type);
     }
     catch (System.Exception systemException)
     {
         System.Diagnostics.Trace.WriteLine(systemException);
     }
     return((Type)Type.Missing);
 }