public static string GetSampleOrDefault(this IPackageAction action) { try { return(action.SampleXml().OuterXml); } catch { return(string.Format("<Action runat=\"install\" alias=\"{0}\"/>", action.Alias())); } }
private static void RegisterPackageActions() { List <Type> types = TypeFinder.FindClassesOfType <IPackageAction>(); foreach (Type t in types) { IPackageAction typeInstance = Activator.CreateInstance(t) as IPackageAction; if (typeInstance != null) { _packageActions.Add(typeInstance); if (HttpContext.Current != null) { HttpContext.Current.Trace.Write("registerPackageActions", " + Adding package action '" + typeInstance.Alias()); } } } }