コード例 #1
0
    public void Validate()
    {
        if (!AssemblyPath.HasValue())
        {
            throw new CommandException(Resources.FormatMissingOption(AssemblyPath.LongName));
        }

        if (!ProjectName.HasValue())
        {
            throw new CommandException(Resources.FormatMissingOption(ProjectName.LongName));
        }

        if (!TargetFramework.HasValue())
        {
            throw new CommandException(Resources.FormatMissingOption(TargetFramework.LongName));
        }
    }
コード例 #2
0
        private Project CreateProject()
        {
            if (ProjectName.HasValue())
            {
                var project = new Project
                {
                    Name = ProjectName,
                };

                _context.Projects.Add(project);
                _context.SaveChanges();

                return(project);
            }

            return(null);
        }
コード例 #3
0
        protected override void Validate()
        {
            base.Validate();

            if (!AssemblyPath.HasValue())
            {
                throw new CommandException(Resources.FormatMissingOption(AssemblyPath.LongName));
            }

            if (!ProjectName.HasValue())
            {
                throw new CommandException(Resources.FormatMissingOption(ProjectName.LongName));
            }

            if (!ToolsDirectory.HasValue())
            {
                throw new CommandException(Resources.FormatMissingOption(ToolsDirectory.LongName));
            }
        }