protected override void Validate([CallerMemberName] string propertyName = "")
        {
            string currentPropertyName;

            // ModelType
            currentPropertyName = PropertyName(m => m.ModelType);
            if (ShouldValidate(propertyName, currentPropertyName))
            {
                ClearError(currentPropertyName);

                if (ModelTypeCollection.Where(m => m.Selected).Count() == 0)
                {
                    AddError(currentPropertyName, WebFormsScaffolderDialogResources.Error_ModelTypeRequired);
                }
            }

            // DesktopMasterPage
            currentPropertyName = PropertyName(m => m.DesktopMasterPage);
            if (ShouldValidate(propertyName, currentPropertyName))
            {
                ClearError(currentPropertyName);
            }
        }
        /// <summary>
        /// Handles the process of building the core components
        /// </summary>
        private void BuildApplicationCore(bool fullBuild)
        {
            ServiceCollection services = ApplicationContext.Current.Services;

            var cm = services.Get<Sage.Platform.Configuration.ConfigurationManager>(true);
            cm.RegisterConfigurationType(typeof(BuildSettings));

            var settings = cm.GetConfiguration<BuildSettings>();
            settings.SolutionFolder = Manifest.OutputPath;
            settings.AcceptChanges();

            cm.WriteConfiguration(settings);

            var modelTypes = new ModelTypeCollection();
            RegisterRequiredModels(modelTypes);

            string vfsPath = string.Empty;
            if (string.IsNullOrEmpty(Manifest.VFSPath))
                vfsPath = ProjectWorkspace.VFS_MODEL_PATH;
            else
                vfsPath = Manifest.VFSPath;

            var workspace = new ProjectWorkspace(vfsPath)
            {
                Name = "TEMP_VFS"
            };

            using (IProject project = new Project(workspace, modelTypes))
            {

                RegisterNeededServices(services, project);

                var service = (Platforms)ExtensionManager.Default.GetService(typeof(Platforms));

                if (fullBuild)
                {
                    log.Info(Resources.log_building_core);

                    try
                    {

                        VFSQuery.UpgradeToBatchMode();
                        var files = new List<string>();

                        // Build Interfaces
                        string[] interfaceFiles = BuildPlatform(project, service, PlatformGuids.CommonGuid);
                        files.AddRange(interfaceFiles);
                        OnBuildComplete(files.ToArray());
                        files.AddRange(BuildPlatform(project, service, PlatformGuids.WebGuid));

                        GenerateCodeSnippetLibraries(project);
                        GenerateRulesConfiguration(project);

                    }
                    catch (Exception ex)
                    {

                    }
                    finally
                    {
                        VFSQuery.DowngradeFromBatchMode();
                    }

                }
            }
        }
 /// <summary>
 /// Register the required models (VFS)
 /// </summary>
 /// <param name="modelTypes"></param>
 private static void RegisterRequiredModels(ModelTypeCollection modelTypes)
 {
     RegisterModelType(modelTypes, "Sage.Platform.Orm.Entities.OrmModel, Sage.Platform");
     RegisterModelType(modelTypes, "Sage.Platform.QuickForms.QuickFormModel, Sage.Platform.QuickForms");
     RegisterModelType(modelTypes, "Sage.Platform.WebPortal.Design.PortalModel, Sage.Platform.WebPortal.Design");
     RegisterModelType(modelTypes, "Sage.Platform.BundleModel.BundleModel, Sage.Platform.BundleModel");
     RegisterModelType(modelTypes, "Sage.Platform.Mashups.AdminModule.MashupModel, Sage.Platform.Mashups.AdminModule");
 }
 private static void RegisterModelType(ModelTypeCollection modelTypes, string qualifiedName)
 {
     var mt = new ModelType { ModelTypeAssemblyQualifiedName = qualifiedName };
     modelTypes.Add(mt);
 }