public Status CheckFeature(SPFeature feature)
 {
     Status status = new Status();
     try
     {
         status.FeatureId = feature.DefinitionId;
     }
     catch
     {
         status.Faulty = true;
     }
     try
     {
         status.CompatibilityLevel = FeatureManager.GetFeatureCompatibilityLevel(feature.Definition);
     }
     catch
     {
         status.Faulty = true;
     }
     try
     {
         // a feature activated somewhere with no manifest file available causes
         // an error when asking for the DisplayName
         // If this happens, we found a faulty feature
         status.DisplayName = feature.Definition.DisplayName;
     }
     catch
     {
         status.Faulty = true;
     }
     return status;
 }
Beispiel #2
0
 private void GetFeatureCompatibilityFromDefinition(SPFeatureDefinition fdef, ref Feature feature)
 {
     try
     {
         feature.CompatibilityLevel = FeatureManager.GetFeatureCompatibilityLevel(fdef);
     }
     catch (Exception exc)
     {
         feature.AppendExceptionMsg(exc);
         feature.IsFaulty = true;
     }
 }