Ejemplo n.º 1
0
 public static string GetSampleOrDefault(this IPackageAction action)
 {
     try
     {
         return(action.SampleXml().OuterXml);
     }
     catch
     {
         return(string.Format("<Action runat=\"install\" alias=\"{0}\"/>", action.Alias()));
     }
 }
Ejemplo n.º 2
0
        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());
                    }
                }
            }
        }