コード例 #1
0
 // Token: 0x060001A6 RID: 422 RVA: 0x0000B8B8 File Offset: 0x00009AB8
 public void LoadMimeContentTypes(Assembly assembly)
 {
     if (assembly == null)
     {
         throw new ArgumentNullException("assembly");
     }
     Type[] types;
     try
     {
         types = assembly.GetTypes();
     }
     catch (ReflectionTypeLoadException ex)
     {
         if (ex.LoaderExceptions != null && ex.LoaderExceptions.Length > 0)
         {
             StringBuilder stringBuilder = new StringBuilder("MimeContentSerializer failed to load one or more types:" + Environment.NewLine);
             foreach (Exception ex2 in ex.LoaderExceptions)
             {
                 stringBuilder.AppendLine(ex2.Message);
             }
             throw new MimeContentSerializerLoadException(stringBuilder.ToString(), ex);
         }
         throw new MimeContentSerializerLoadException(ex);
     }
     foreach (Type type in types)
     {
         string contentDescriptionInternal = MimeContentDescriptions.GetContentDescriptionInternal(type);
         if (contentDescriptionInternal != null)
         {
             this.AddMimeContentType(contentDescriptionInternal, type);
         }
     }
 }
コード例 #2
0
 // Token: 0x06000193 RID: 403 RVA: 0x0000B320 File Offset: 0x00009520
 public void SetContentDescriptionsProvider(MimeContentDescriptions descriptions)
 {
     if (descriptions == null)
     {
         throw new ArgumentNullException("descriptions");
     }
     this.contentDescriptions = descriptions;
 }