/// <summary>
        /// When implemented in a derived class, performs the execution of the activity.
        /// </summary>
        /// <param name="context">The execution context under which the activity executes.</param>
        protected override void Execute(CodeActivityContext context)
        {
            var assemblyFileVersion          = AssemblyFileVersion.Get(context);
            var assemblyInformationalVersion = AssemblyInformationalVersion.Get(context);
            var assemblyVersion            = AssemblyVersion.Get(context);
            var createAttributeIfNotExists = CreateAttributeIfNotExists.Get(context);
            var directoryToSearch          = DirectoryToSearch.Get(context);
            var fileNamesToSearch          = FileNamesToSearch.Get(context);
            var commandLog = new CodeActivityContextCommandLog(context);
            var recursive  = Recursive.Get(context);
            var writeVerboseLogMessages = WriteVerboseLogMessages.Get(context);

            var command =
                new SetVersionAttributesInFilesCommand
            {
                AssemblyFileVersion          = assemblyFileVersion,
                AssemblyInformationalVersion = assemblyInformationalVersion,
                AssemblyVersion            = assemblyVersion,
                CreateAttributeIfNotExists = createAttributeIfNotExists,
                DirectoryToSearch          = directoryToSearch,
                FileNamesToSearch          = fileNamesToSearch,
                CommandLog = commandLog,
                Recursive  = recursive,
                WriteVerboseLogMessages = writeVerboseLogMessages
            };

            var successful = command.Execute();

            if (false == successful)
            {
                commandLog.Error("The SetVersionAttributesInFiles activity failed.");
            }
        }
        public Versions(Version oldFileVersion, BinaryApiCompatibility compatibility)
        {
            Compatibility = compatibility;
            var oldSemanticVersion = new Version(oldFileVersion.Major, oldFileVersion.Minor, oldFileVersion.Build, 0);
            var newSemanticVersion = oldSemanticVersion.GetNewSemanticVersion(compatibility);

            AssemblyFileVersion          = newSemanticVersion;
            AssemblyInformationalVersion = AssemblyFileVersion;
            AssemblyVersion             = new Version(newSemanticVersion.Major, 0, 0, 0);
            ExclusiveMaximumFileVersion = AssemblyFileVersion.WithMinorIncremented();
        }
 public AssemblyInfoPatchResult(string fullPath,
     string fileBackupPath,
     AssemblyVersion oldAssemblyVersion,
     AssemblyVersion assemblyVersion,
     AssemblyFileVersion oldAssemblyFileVersion,
     AssemblyFileVersion assemblyFileVersion,
     bool succeeded = true,
     AssemblyMetaData oldAssemblyMetadata = null,
     AssemblyMetaData newAssemblyMetadata = null)
 {
     _fullPath = fullPath;
     _fileBackupPath = fileBackupPath;
     _oldAssemblyVersion = oldAssemblyVersion;
     _assemblyVersion = assemblyVersion;
     _oldAssemblyFileVersion = oldAssemblyFileVersion;
     _assemblyFileVersion = assemblyFileVersion;
     _succeeded = succeeded;
     _oldAssemblyMetadata = oldAssemblyMetadata;
     _newAssemblyMetadata = newAssemblyMetadata;
 }
 public AssemblyInfoPatchResult(string fullPath,
                                string fileBackupPath,
                                AssemblyVersion oldAssemblyVersion,
                                AssemblyVersion assemblyVersion,
                                AssemblyFileVersion oldAssemblyFileVersion,
                                AssemblyFileVersion assemblyFileVersion,
                                bool succeeded = true,
                                AssemblyMetaData oldAssemblyMetadata = null,
                                AssemblyMetaData newAssemblyMetadata = null)
 {
     _fullPath               = fullPath;
     _fileBackupPath         = fileBackupPath;
     _oldAssemblyVersion     = oldAssemblyVersion;
     _assemblyVersion        = assemblyVersion;
     _oldAssemblyFileVersion = oldAssemblyFileVersion;
     _assemblyFileVersion    = assemblyFileVersion;
     _succeeded              = succeeded;
     _oldAssemblyMetadata    = oldAssemblyMetadata;
     _newAssemblyMetadata    = newAssemblyMetadata;
 }