コード例 #1
0
 public CompositionResult TryOnComposed()
 {
     try
     {
         Part.Activate();
         return(CompositionResult.SucceededResult);
     }
     catch (ComposablePartException ex)
     {   // Type failed to be constructed, imports could not be set, etc
         return(new CompositionResult(
                    ErrorBuilder.CreatePartCannotActivate(Part, ex)));
     }
 }