Example #1
0
        public async void GenerateAllPagesAndFeaturesRandomNames(string projectType, string framework)
        {
            var targetProjectTemplate = GenerationTestsFixture.Templates.FirstOrDefault(t => t.GetTemplateType() == TemplateType.Project && t.GetProjectTypeList().Contains(projectType) && t.GetFrameworkList().Contains(framework) && !t.GetIsHidden());
            var projectName           = $"{projectType}{framework}AllRandom";

            ProjectName = projectName;
            OutputPath  = Path.Combine(_fixture.TestProjectsPath, projectName, projectName);

            var userSelection = new UserSelection
            {
                Framework   = framework,
                ProjectType = projectType,
                HomeName    = "Main"
            };

            AddLayoutItems(userSelection, targetProjectTemplate);
            AddItems(userSelection, GetTemplates(framework, TemplateType.Page), GetRandomName);
            AddItems(userSelection, GetTemplates(framework, TemplateType.Feature), GetRandomName);

            await GenController.UnsafeGenerateAsync(userSelection);

            //Build solution
            var outputPath = Path.Combine(_fixture.TestProjectsPath, projectName);
            var result     = BuildSolution(projectName, outputPath);

            //Assert
            Assert.True(result.exitCode.Equals(0), $"Solution {targetProjectTemplate.Name} was not built successfully. {Environment.NewLine}Errors found: {GetErrorLines(result.outputFile)}.{Environment.NewLine}Please see {Path.GetFullPath(result.outputFile)} for more details.");

            //Clean
            Directory.Delete(outputPath, true);
        }
Example #2
0
        public async void GenerateEmptyProject(string name, string framework, string projId)
        {
            var projectTemplate = GenerationTestsFixture.Templates.Where(t => t.Identity == projId).FirstOrDefault();
            var projectName     = $"{name}{framework}";

            using (var context = GenContext.CreateNew(projectName, Path.Combine(_fixture.TestProjectsPath, projectName, projectName)))
            {
                var userSelection = new UserSelection
                {
                    Framework   = framework,
                    ProjectType = projectTemplate.GetProjectType(),
                };

                AddLayoutItems(userSelection, projectTemplate);

                await GenController.UnsafeGenerateAsync(userSelection);

                //Build solution
                var outputPath = Path.Combine(_fixture.TestProjectsPath, projectName);
                var result     = BuildSolution(projectName, outputPath);

                //Assert
                Assert.True(result.exitCode.Equals(0), $"Solution {projectTemplate.Name} was not built successfully. {Environment.NewLine}Errors found: {GetErrorLines(result.outputFile)}.{Environment.NewLine}Please see {Path.GetFullPath(result.outputFile)} for more details.");

                //Clean
                Directory.Delete(outputPath, true);
            }
        }
Example #3
0
        public async void GenerateEmptyProject(string projectType, string framework, string language)
        {
            SetupFixtureAndContext(language);

            var projectTemplate = _fixture.Templates
                                  .FirstOrDefault(t => t.GetTemplateType() == TemplateType.Project &&
                                                  t.GetProjectTypeList().Contains(projectType) &&
                                                  t.GetFrameworkList().Contains(framework));
            var projectName = $"{projectType}{framework}";

            ProjectName = projectName;
            OutputPath  = Path.Combine(_fixture.TestProjectsPath, projectName, projectName);

            var userSelection = new UserSelection
            {
                Framework   = framework,
                ProjectType = projectType,
                HomeName    = "Main",
                Language    = language
            };

            AddLayoutItems(userSelection, projectTemplate);

            await GenController.UnsafeGenerateAsync(userSelection);

            //Build solution
            var outputPath = Path.Combine(_fixture.TestProjectsPath, projectName);
            var result     = BuildSolution(projectName, outputPath);

            //Assert
            Assert.True(result.exitCode.Equals(0), $"Solution {projectTemplate.Name} was not built successfully. {Environment.NewLine}Errors found: {GetErrorLines(result.outputFile)}.{Environment.NewLine}Please see {Path.GetFullPath(result.outputFile)} for more details.");

            //Clean
            Directory.Delete(outputPath, true);
        }
Example #4
0
        public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
        {
            var solutionDirectory = replacementsDictionary["$solutiondirectory$"];

            try
            {
                if (runKind == WizardRunKind.AsNewProject || runKind == WizardRunKind.AsMultiProject)
                {
                    _replacementsDictionary = replacementsDictionary;

                    GenContext.Current = this;

                    _userSelection = GenController.GetUserSelection();
                }
            }
            catch (WizardBackoutException)
            {
                if (Directory.Exists(solutionDirectory))
                {
                    Directory.Delete(solutionDirectory, true);
                }

                throw;
            }
        }
Example #5
0
 public void RunStarted(object automationObject, Dictionary <string, string> replacementsDictionary, WizardRunKind runKind, object[] customParams)
 {
     if (runKind == WizardRunKind.AsNewProject || runKind == WizardRunKind.AsMultiProject)
     {
         _context       = GenContext.CreateNew(replacementsDictionary);
         _userSelection = GenController.GetUserSelection();
     }
 }
        public async void RunFinished()
        {
            AppHealth.Current.Info.TrackAsync("Creating Windows Template Studio project...").FireAndForget();
            await GenController.GenerateAsync(_userSelection);

            AppHealth.Current.Info.TrackAsync("Generation finished").FireAndForget();

            PostGenerationActions();
        }
Example #7
0
        public async void GenerateProjectWithIsolatedItems(string itemName, string projectType, string framework, string itemId, string language)
        {
            SetupFixtureAndContext(language);

            var projectTemplate = _fixture.Templates.FirstOrDefault(t => t.GetTemplateType() == TemplateType.Project && t.GetProjectTypeList().Contains(projectType) && t.GetFrameworkList().Contains(framework));
            var itemTemplate    = _fixture.Templates.FirstOrDefault(t => t.Identity == itemId);
            var finalName       = itemTemplate.GetDefaultName();
            var validators      = new List <Validator>()
            {
                new ReservedNamesValidator(),
            };

            if (itemTemplate.GetItemNameEditable())
            {
                validators.Add(new DefaultNamesValidator());
            }

            finalName = Naming.Infer(finalName, validators);
            var projectName = $"{projectType}{framework}{finalName}";

            ProjectName = projectName;
            OutputPath  = Path.Combine(_fixture.TestProjectsPath, projectName, projectName);

            var userSelection = new UserSelection
            {
                Framework   = framework,
                ProjectType = projectType,
                HomeName    = "Main",
                Language    = language
            };

            AddLayoutItems(userSelection, projectTemplate);
            AddItem(userSelection, finalName, itemTemplate);

            await GenController.UnsafeGenerateAsync(userSelection);

            //Build solution
            var outputPath = Path.Combine(_fixture.TestProjectsPath, projectName);
            var result     = BuildSolution(projectName, outputPath);

            //Assert
            Assert.True(result.exitCode.Equals(0), $"Solution {projectTemplate.Name} was not built successfully. {Environment.NewLine}Errors found: {GetErrorLines(result.outputFile)}.{Environment.NewLine}Please see {Path.GetFullPath(result.outputFile)} for more details.");

            //Clean
            Directory.Delete(outputPath, true);
        }
Example #8
0
        private void Grid_DataBound(object sender, System.EventArgs e)
        {
            genCon = Frame.GetController <GenController>();
            if (typeof(ClassDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type)
                )
            {
                if (!genCon.GetCurrentUserViewPriceStatus())
                {
                    ASPxGridListEditor listEditor = View.Editor as ASPxGridListEditor;

                    if (listEditor != null)
                    {
                        foreach (GridViewColumn column in listEditor.Grid.VisibleColumns)
                        {
                            if (column is GridViewDataColumn)
                            {
                                GridViewDataColumn col = (GridViewDataColumn)column;
                                if (!string.IsNullOrEmpty(col.FieldName))
                                {
                                    try
                                    {
                                        IModelColumn mycol = View.Model.Columns[col.FieldName];
                                        if (mycol != null)
                                        {
                                            string temp = View.Model.Columns[col.FieldName].ModelMember.PropertyEditorType.Name;
                                            //if (temp == "MyDecPropertyEditorVP" || temp == "MyDouPropertyEditorVP")
                                            if (temp.Contains("PropertyEditorVP"))
                                            {
                                                column.Visible = false;
                                            }
                                        }
                                    }
                                    catch
                                    {
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        public async void GenerateProjectWithIsolatedItems(string itemName, string name, string framework, string projId, string itemId)
        {
            var projectTemplate = GenerationTestsFixture.Templates.Where(t => t.Identity == projId).FirstOrDefault();
            var itemTemplate    = GenerationTestsFixture.Templates.FirstOrDefault(t => t.Identity == itemId);
            var finalName       = itemTemplate.GetDefaultName();

            if (itemTemplate.GetItemNameEditable())
            {
                finalName = Naming.Infer(_usedNames, itemTemplate.GetDefaultName());
            }

            var projectName = $"{name}{framework}{finalName}";

            ProjectName = projectName;
            OutputPath  = Path.Combine(_fixture.TestProjectsPath, projectName, projectName);

            var userSelection = new UserSelection
            {
                Framework   = framework,
                ProjectType = projectTemplate.GetProjectType(),
            };

            AddLayoutItems(userSelection, projectTemplate);
            AddItem(userSelection, finalName, itemTemplate);

            await GenController.UnsafeGenerateAsync(userSelection);

            //Build solution
            var outputPath = Path.Combine(_fixture.TestProjectsPath, projectName);
            var result     = BuildSolution(projectName, outputPath);

            //Assert
            Assert.True(result.exitCode.Equals(0), $"Solution {projectTemplate.Name} was not built successfully. {Environment.NewLine}Errors found: {GetErrorLines(result.outputFile)}.{Environment.NewLine}Please see {Path.GetFullPath(result.outputFile)} for more details.");

            //Clean
            Directory.Delete(outputPath, true);
        }
Example #10
0
        static void Main(string[] args)
        {
            stopWatch.Start();

            if (args.Length == 0)
            {
                logger.EscribirLog("Por favor indique los parametros a utilizar", Logger.Tipo.Error, false);
                logger.EscribirLog("", Logger.Tipo.Nada, false);
                logger.EscribirLog("-vf\t(Requerido)\tparametro que indica el archivo que necesitamos usar", Logger.Tipo.Error, false);
                logger.EscribirLog("-v\t(Opcional)\tparametro que indica si se desean mas datos", Logger.Tipo.Error, false);
                System.Environment.Exit(ERROR_INVALID_COMMAND_LINE);
            }

            if (chequeoArgunto("-log", false, args))
            {
                logger.NombreLog = traerArgumento("-log", args);
            }

            logger.EscribirLog("Vamos a utilizrar el archivo " + logger.NombreLog + " como log.", Logger.Tipo.Informativo, false);


            if (chequeoArgunto("-vcf", false, args))
            {
                vcfFile = traerArgumento("-vcf", args);
                logger.EscribirLog("Vamos a empezar a trabajar en el archivo " + vcfFile, Logger.Tipo.Informativo, false);
            }
            else
            {
                Console.WriteLine("Falta ingresar el -vcf");
                logger.EscribirLog("Falta ingresar el parametro de vcf", Logger.Tipo.Error, false);
                System.Environment.Exit(ERROR_INVALID_COMMAND_LINE);
            }
            if (vcfFile != null)
            {
                if (!File.Exists(vcfFile))
                {
                    logger.EscribirLog("No exizte el archivo " + vcfFile, Logger.Tipo.Alerta, false);
                    System.Environment.Exit(ERROR_FILE_NOT_FOUND);
                }
            }
            logger.Verbose = chequeoArgunto("-v", true, args);
            if (verbose)
            {
                logger.EscribirLog("Verbose activado se escribira mas detalle", Logger.Tipo.Informativo, false);
            }

            GenController genController = GenController.Instance;

            if (!genController.cargarArchivos())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }

            VariantController variantController = VariantController.Instance;

            if (!variantController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }
            DrugController drugController = DrugController.Instance;

            if (!drugController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }

            ChemicalsController chemicalsController = ChemicalsController.Instance;

            if (!chemicalsController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }
            PhenotypesController phenotypesController = PhenotypesController.Instance;

            if (!phenotypesController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }
            GenotipoController genotipoController = GenotipoController.Instance;

            if (!genotipoController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }
            CAMetadaDataController cAMetadaDataController = CAMetadaDataController.Instance;

            if (!cAMetadaDataController.cargarArchivo())
            {
                System.Environment.Exit(ERROR_FILE_NOT_FOUND);
            }



            IEnumerable <Gen> Guideline = LGenes.Where(s => s.HasCPICDosingGuideline == true);
            int cantidadHAV             = Guideline.Count();



            aTimer = new System.Timers.Timer(6000);
            // Hook up the Elapsed event for the timer.
            aTimer.Elapsed  += OnTimedEvent;
            aTimer.AutoReset = true;
            aTimer.Enabled   = true;

            logger.EscribirLog("Finalizamos el proceso", Logger.Tipo.Informativo, false);
            logger.EscribirLog("Demoramos " + stopWatch.Elapsed, Logger.Tipo.Informativo, true);
            stopWatch.Stop();
            Console.Read();
        }
Example #11
0
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            genCon = Frame.GetController <GenController>();
            ASPxGridView grid = ((ListView)this.View).Editor.Control as ASPxGridView;

            if (grid != null)
            {
                grid.DataBound += Grid_DataBound;
            }
            if (typeof(ClassDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocument).IsAssignableFrom(View.ObjectTypeInfo.Type) ||
                typeof(ClassStockTransferDocumentDetail).IsAssignableFrom(View.ObjectTypeInfo.Type)
                )
            {
                if (!genCon.GetCurrentUserViewPriceStatus())
                {
                    ColumnsListEditor listEditor = View.Editor as ColumnsListEditor;

                    if (listEditor != null)
                    {
                        foreach (ColumnWrapper column in listEditor.Columns)
                        {
                            if (!string.IsNullOrEmpty(column.Id))
                            {
                                IModelColumn mycol = View.Model.Columns[column.Id];
                                if (mycol != null)
                                {
                                    string temp = View.Model.Columns[column.Id].ModelMember.PropertyEditorType.Name;
                                    //IModelPropertyEditor prop = (IModelPropertyEditor)View.Model.Columns[column.Id].ModelMember.PropertyEditorType.GetType();
                                    IModelMemberShowInCustomizationForm modelMember = (IModelMemberShowInCustomizationForm)View.Model.Columns[column.Id].ModelMember;
                                    //if (temp == "MyDecPropertyEditorVP" || temp == "MyDouPropertyEditorVP")
                                    if (temp.Contains("PropertyEditorVP"))
                                    {
                                        column.ShowInCustomizationForm = false;
                                    }
                                    else
                                    {
                                        column.ShowInCustomizationForm = modelMember.ShowInCustomizationForm;
                                    }

                                    //switch (column.Id)
                                    //{
                                    //    case "UnitPrice":
                                    //    case "LineTotal":
                                    //    case "TotalBeforeDiscount":
                                    //    case "Discount":
                                    //    case "TripCost":
                                    //    case "GST":
                                    //    case "GrandTotal":
                                    //        column.ShowInCustomizationForm = false;
                                    //        break;
                                    //    default:
                                    //        column.ShowInCustomizationForm = modelMember.ShowInCustomizationForm;
                                    //        break;
                                    //}
                                }
                            }
                        }
                    }
                }
            }
        }