コード例 #1
0
        public override bool Process(IBase baseObject, Facet facet, IGeneratorConfiguration generatorConfiguration)
        {
            var         uiAttribute      = (UICustomAttribute)facet.Attribute;
            var         viewRelativePath = uiAttribute.ViewRelativePath;
            var         name             = baseObject.GetNavigationName();
            var         parentObject     = (IParentBase)baseObject;
            var         tabs             = new List <Tab>();
            var         pagesPath        = generatorConfiguration.ApplicationFolderHierarchy[IonicFileSystemType.Pages];
            var         pagesFolder      = (Folder)generatorConfiguration.FileSystem[pagesPath];
            var         projectPath      = Environment.ExpandEnvironmentVariables(uiAttribute.ProjectPath);
            var         viewProjects     = generatorConfiguration.ViewProjects;
            ViewProject viewProject;
            View        view;

            if (!viewProjects.ContainsKey(projectPath))
            {
                viewProject = new ViewProject(projectPath);
                viewProjects.Add(projectPath, new ViewProject(projectPath));
            }
            else
            {
                viewProject = (ViewProject)viewProjects[projectPath];
            }

            if (!viewProject.ContainsView(viewRelativePath))
            {
                view = viewProject.AddView(viewRelativePath);
            }

            if (uiAttribute.UILoadKind == UILoadKind.RootPage)
            {
                this.Raise <ApplicationFacetHandler>();
            }

            generatorConfiguration.HandleViews(viewProject, baseObject, facet);

            return(true);
        }