Esempio n. 1
0
        public void InstallPages(ApplicationInstallationInfo aii)
        {
            Type type = this.GetType();

            int i = 0;
            foreach (MethodInfo mi in type.GetMethods(BindingFlags.Default | BindingFlags.Instance | BindingFlags.NonPublic))
            {
                foreach (Attribute attr in Attribute.GetCustomAttributes(mi, typeof(ShowAttribute)))
                {
                    i++;
                    if (string.IsNullOrEmpty(((ShowAttribute)attr).Stub))
                    {
                        aii.AddSlug(this.Stub, ((ShowAttribute)attr).Slug, ((ShowAttribute)attr).Primitives, false);
                    }
                    else
                    {
                        aii.AddSlug((ShowAttribute)attr);
                    }
                }

                foreach (Attribute attr in Attribute.GetCustomAttributes(mi, typeof(StaticShowAttribute)))
                {
                    i++;
                    aii.AddSlug((StaticShowAttribute)attr);
                }
            }
        }
Esempio n. 2
0
        public override ApplicationInstallationInfo Install()
        {
            ApplicationInstallationInfo aii = new ApplicationInstallationInfo();

            aii.AddModule("mail");

            return aii;
        }
Esempio n. 3
0
        public ApplicationInstallationInfo GetInstallInfo()
        {
            ApplicationInstallationInfo aii = new ApplicationInstallationInfo();

            Type[] types = this.GetType().Assembly.GetTypes();

            foreach (Type type in types)
            {
                if (type.IsSubclassOf(typeof(AccountModule)))
                {
                    foreach (Attribute attr in type.GetCustomAttributes(typeof(AccountModuleAttribute), false))
                    {
                        aii.AddModule(((AccountModuleAttribute)attr).Name);
                    }
                }
            }

            List<ApplicationSlugInfo> slugs = GetSlugInformation();
            foreach (ApplicationSlugInfo slug in slugs)
            {
                aii.AddSlug(slug.Stub, slug.SlugEx, slug.Primitives, slug.IsStatic);
            }

            return aii;
        }