Exemplo n.º 1
0
        public void ToVcxprojProperties(XmlWriter writer)
        {
            WriteStringArray(writer, "AdditionalDependencies", AdditionalDependencies);
            WriteStringArray(writer, "AdditionalLibraryDirectories", AdditionalLibraryDirectories);
            WriteStringArray(writer, "AdditionalManifestDependencies", AdditionalManifestDependencies);
            WriteStringArray(writer, "AdditionalOptions", AdditionalOptions);
            WriteStringArray(writer, "AddModuleNamesToAssembly", AddModuleNamesToAssembly);
            if (AllowIsolation)
            {
                writer.WriteElementString("AllowIsolation", XmlConvert.ToString(AllowIsolation));
            }
            writer.WriteElementString("AssemblyDebug", XmlConvert.ToString(AssemblyDebug));
            if (!string.IsNullOrWhiteSpace(BaseAddress))
            {
                writer.WriteElementString("BaseAddress", BaseAddress);
            }
            if (CLRImageType != CLRImageType.Default)
            {
                writer.WriteElementString("CLRImageType", CLRImageType.ToString());
            }
            if (CLRSupportLastError != CLRSupportLastError.Disabled)
            {
                writer.WriteElementString("CLRSupportLastError", CLRSupportLastError.ToString());
            }
            if (CLRThreadAttribute != ApartmentState.Unknown)
            {
                writer.WriteElementString("CLRThreadAttribute", CLRThreadAttribute.ToString());
            }
            writer.WriteElementString("CLRUnmanagedCodeCheck", XmlConvert.ToString(CLRUnmanagedCodeCheck));
            if (CreateHotPatchableImage != LinkerHotPatchingOption.Disabled)
            {
                writer.WriteElementString("CreateHotPatchableImage", CreateHotPatchableImage.ToString());
            }
            writer.WriteElementString("DataExecutionPrevention", XmlConvert.ToString(DataExecutionPrevention));
            WriteStringArray(writer, "DelayLoadDLLs", DelayLoadDLLs);
            writer.WriteElementString("DelaySign", XmlConvert.ToString(DelaySign));
            if (Driver != LinkerDriverOption.NotSet)
            {
                writer.WriteElementString("Driver", Driver.ToString());
            }
            writer.WriteElementString("EnableCOMDATFolding", XmlConvert.ToString(EnableCOMDATFolding));
            writer.WriteElementString("EnableUAC", XmlConvert.ToString(EnableUAC));
            if (!string.IsNullOrWhiteSpace(EntryPointSymbol))
            {
                writer.WriteElementString("EntryPointSymbol", EntryPointSymbol);
            }
            writer.WriteElementString("FixedBaseAddress", XmlConvert.ToString(FixedBaseAddress));
            if (ForceFileOutput != LinkerForceOption.Disabled)
            {
                writer.WriteElementString("ForceFileOutput", ForceFileOutput.ToString());
            }
            WriteStringArray(writer, "ForceSymbolReferences", ForceSymbolReferences);
            if (!string.IsNullOrWhiteSpace(FunctionOrder))
            {
                writer.WriteElementString("FunctionOrder", FunctionOrder);
            }
            writer.WriteElementString("GenerateDebugInformation", XmlConvert.ToString(GenerateDebugInformation));
            writer.WriteElementString("GenerateManifest", XmlConvert.ToString(GenerateManifest));
            writer.WriteElementString("GenerateMapFile", XmlConvert.ToString(GenerateMapFile));
            if (HeapCommitSize.HasValue)
            {
                writer.WriteElementString("HeapCommitSize", XmlConvert.ToString(HeapCommitSize.Value));
            }
            if (HeapReserveSize.HasValue)
            {
                writer.WriteElementString("HeapReserveSize", XmlConvert.ToString(HeapReserveSize.Value));
            }
            writer.WriteElementString("IgnoreAllDefaultLibraries", XmlConvert.ToString(IgnoreAllDefaultLibraries));
            writer.WriteElementString("IgnoreEmbeddedIDL", XmlConvert.ToString(IgnoreEmbeddedIDL));
            writer.WriteElementString("IgnoreImportLibrary", XmlConvert.ToString(IgnoreImportLibrary));
            WriteStringArray(writer, "IgnoreSpecificDefaultLibraries", IgnoreSpecificDefaultLibraries);
            writer.WriteElementString("ImageHasSafeExceptionHandlers", XmlConvert.ToString(ImageHasSafeExceptionHandlers));
            if (!string.IsNullOrWhiteSpace(ImportLibrary))
            {
                writer.WriteElementString("ImportLibrary", ImportLibrary);
            }
            if (!string.IsNullOrWhiteSpace(KeyContainer))
            {
                writer.WriteElementString("KeyContainer", KeyContainer);
            }
            if (!string.IsNullOrWhiteSpace(KeyFile))
            {
                writer.WriteElementString("KeyFile", KeyFile);
            }
            writer.WriteElementString("LargeAddressAware", XmlConvert.ToString(LargeAddressAware));
            writer.WriteElementString("LinkDLL", XmlConvert.ToString(LinkDLL));
            writer.WriteElementString("LinkIncremental", XmlConvert.ToString(LinkIncremental));
            writer.WriteElementString("MapExports", XmlConvert.ToString(MapExports));
            if (!string.IsNullOrWhiteSpace(MapFileName))
            {
                writer.WriteElementString("MapFileName", MapFileName);
            }
            if (!string.IsNullOrWhiteSpace(MergedIDLBaseFileName))
            {
                writer.WriteElementString("MergedIDLBaseFileName", MergedIDLBaseFileName);
            }
            if (MergeSections != null && MergeSections.Count > 0)
            {
                string merges = string.Join(";", MergeSections.Select(pair => pair.Key + "=" + pair.Value));
                writer.WriteElementString("MergeSections", merges);
            }
            if (MinimumRequiredVersion.HasValue)
            {
                writer.WriteElementString("MinimumRequiredVersion", XmlConvert.ToString(MinimumRequiredVersion.Value));
            }
            writer.WriteElementString("NoEntryPoint", XmlConvert.ToString(NoEntryPoint));
            writer.WriteElementString("OptimizeReferences", XmlConvert.ToString(OptimizeReferences));
            writer.WriteElementString("PreventDllBinding", XmlConvert.ToString(PreventDllBinding));
            writer.WriteElementString("RandomizedBaseAddress", XmlConvert.ToString(RandomizedBaseAddress));
            if (SectionAlignment.HasValue)
            {
                writer.WriteElementString("SectionAlignment", XmlConvert.ToString(SectionAlignment.Value));
            }
            writer.WriteElementString("SetChecksum", XmlConvert.ToString(SetChecksum));
            if (StackCommitSize.HasValue)
            {
                writer.WriteElementString("StackCommitSize", XmlConvert.ToString(StackCommitSize.Value));
            }
            if (StackReserveSize.HasValue)
            {
                writer.WriteElementString("StackReserveSize", XmlConvert.ToString(StackReserveSize.Value));
            }
            if (SubSystem != LinkerSubSystemOption.NotSet)
            {
                writer.WriteElementString("SubSystem", SubSystem.ToString());
            }
            writer.WriteElementString("SupportNobindOfDelayLoadedDLL", XmlConvert.ToString(SupportNobindOfDelayLoadedDLL));
            writer.WriteElementString("SupportUnloadOfDelayLoadedDLL", XmlConvert.ToString(SupportUnloadOfDelayLoadedDLL));
            writer.WriteElementString("SwapRunFromCD", XmlConvert.ToString(SwapRunFromCD));
            writer.WriteElementString("SwapRunFromNet", XmlConvert.ToString(SwapRunFromNet));
            if (TargetMachine != LinkerTargetMachine.NotSet)
            {
                writer.WriteElementString("TargetMachine", TargetMachine.ToString());
            }
            writer.WriteElementString("TerminalServerAware", XmlConvert.ToString(TerminalServerAware));
            writer.WriteElementString("TreatLinkerWarningAsErrors", XmlConvert.ToString(TreatLinkerWarningAsErrors));
            writer.WriteElementString("TurnOffAssemblyGeneration", XmlConvert.ToString(TurnOffAssemblyGeneration));
            if (TypeLibraryResourceID.HasValue)
            {
                writer.WriteElementString("TypeLibraryResourceID", XmlConvert.ToString(TypeLibraryResourceID.Value));
            }

            if (!String.IsNullOrWhiteSpace(TypeLibraryFile))
            {
                writer.WriteElementString("TypeLibraryFile", TypeLibraryFile);
            }

            writer.WriteElementString("UACExecutionLevel", UACExecutionLevel.ToString());
            writer.WriteElementString("UACUIAccess", XmlConvert.ToString(UACUIAccess));
        }
Exemplo n.º 2
0
        public void ToVcxprojProperties(XmlWriter writer)
        {
            WriteStringArray(writer, "AdditionalDependencies", AreAdditionalDependenciesSpecified ? AdditionalDependencies : new string[0]);
            WriteStringArray(writer, "AdditionalLibraryDirectories", AreAdditionalLibraryDirectoriesSpecified ? AdditionalLibraryDirectories : new string[0]);
            WriteStringArray(writer, "AdditionalManifestDependencies", AreAdditionalManifestDependenciesSpecified ? AdditionalManifestDependencies : new string[0]);
            WriteStringArray(writer, "AdditionalOptions", AreAdditionalOptionsSpecified ? AdditionalOptions : new string[0]);
            WriteStringArray(writer, "AddModuleNamesToAssembly", IsAddModuleNamesToAssemblySpecified ? AddModuleNamesToAssembly : new string[0]);
            if (IsAllowIsolationSpecified && AllowIsolation)
            {
                writer.WriteElementString("AllowIsolation", XmlConvert.ToString(AllowIsolation));
            }
            writer.WriteElementString("AssemblyDebug", XmlConvert.ToString(IsAssemblyDebugSpecified ? AssemblyDebug : suite.ActiveGoal.Has(Suite.DebugGoal.Name)));
            if (IsBaseAddressSpecified)
            {
                writer.WriteElementString("BaseAddress", BaseAddress);
            }
            if (IsCLRImageTypeSpecified && CLRImageType != CLRImageType.Default)
            {
                writer.WriteElementString("CLRImageType", CLRImageType.ToString());
            }
            if (IsCLRSupportLastErrorSpecified && CLRSupportLastError != CLRSupportLastError.Disabled)
            {
                writer.WriteElementString("CLRSupportLastError", CLRSupportLastError.ToString());
            }
            else
            {
                writer.WriteElementString("CLRSupportLastError", Model.CLRSupportLastError.Enabled.ToString());
            }
            if (IsCLRThreadAttributeSpecified && CLRThreadAttribute != ApartmentState.Unknown)
            {
                writer.WriteElementString("CLRThreadAttribute", CLRThreadAttribute.ToString());
            }
            writer.WriteElementString("CLRUnmanagedCodeCheck", XmlConvert.ToString(!IsCLRUnmanagedCodeCheckSpecified || CLRUnmanagedCodeCheck));
            if (IsCreateHotPatchableImageSpecified && CreateHotPatchableImage != LinkerHotPatchingOption.Disabled)
            {
                writer.WriteElementString("CreateHotPatchableImage", CreateHotPatchableImage.ToString());
            }
            writer.WriteElementString("DataExecutionPrevention", XmlConvert.ToString(!IsDataExecutionPreventionSpecified || DataExecutionPrevention));
            WriteStringArray(writer, "DelayLoadDLLs", AreDelayLoadDLLsSpecified ? DelayLoadDLLs : new string[0]);
            writer.WriteElementString("DelaySign", XmlConvert.ToString(IsDelaySignSpecified && DelaySign));
            if (IsDriverSpecified && Driver != LinkerDriverOption.NotSet)
            {
                writer.WriteElementString("Driver", Driver.ToString());
            }
            writer.WriteElementString("EnableCOMDATFolding", XmlConvert.ToString(IsEnableCOMDATFoldingSpecified && EnableCOMDATFolding));
            writer.WriteElementString("EnableUAC", XmlConvert.ToString(!IsEnableUACSpecified || EnableUAC));
            if (IsEntryPointSymbolSpecified)
            {
                writer.WriteElementString("EntryPointSymbol", EntryPointSymbol);
            }
            writer.WriteElementString("FixedBaseAddress", XmlConvert.ToString(IsFixedBaseAddressSpecified && FixedBaseAddress));
            if (IsForceFileOutputSpecified && ForceFileOutput != LinkerForceOption.Disabled)
            {
                writer.WriteElementString("ForceFileOutput", ForceFileOutput.ToString());
            }
            WriteStringArray(writer, "ForceSymbolReferences", AreForceSymbolReferencesSpecified ? ForceSymbolReferences : new string[0]);
            if (IsFunctionOrderSpecified)
            {
                writer.WriteElementString("FunctionOrder", FunctionOrder);
            }
            writer.WriteElementString("GenerateDebugInformation",
                                      XmlConvert.ToString(IsGenerateDebugInformationSpecified
                    ? GenerateDebugInformation
                    : suite.ActiveGoal.Has(Suite.DebugGoal.Name)));
            writer.WriteElementString("GenerateManifest", XmlConvert.ToString(IsGenerateManifestSpecified && GenerateManifest));
            writer.WriteElementString("GenerateMapFile", XmlConvert.ToString(IsGenerateMapFileSpecified && GenerateMapFile));
            if (HeapCommitSize.HasValue)
            {
                writer.WriteElementString("HeapCommitSize", XmlConvert.ToString(HeapCommitSize.Value));
            }
            if (HeapReserveSize.HasValue)
            {
                writer.WriteElementString("HeapReserveSize", XmlConvert.ToString(HeapReserveSize.Value));
            }
            writer.WriteElementString("IgnoreAllDefaultLibraries", XmlConvert.ToString(IsIgnoreAllDefaultLibrariesSpecified && IgnoreAllDefaultLibraries));
            writer.WriteElementString("IgnoreEmbeddedIDL", XmlConvert.ToString(IsIgnoreEmbeddedIDLSpecified && IgnoreEmbeddedIDL));
            writer.WriteElementString("IgnoreImportLibrary", XmlConvert.ToString(IsIgnoreImportLibrarySpecified && IgnoreImportLibrary));
            WriteStringArray(writer, "IgnoreSpecificDefaultLibraries", IsIgnoreSpecificDefaultLibrariesSpecified ? IgnoreSpecificDefaultLibraries : new string[0]);
            writer.WriteElementString("ImageHasSafeExceptionHandlers", XmlConvert.ToString(IsImageHasSafeExceptionHandlersSpecified ? ImageHasSafeExceptionHandlers : suite.ActiveGoal.Has("x86")));
            if (IsImportLibrarySpecified)
            {
                writer.WriteElementString("ImportLibrary", ImportLibrary);
            }
            if (IsKeyContainerSpecified)
            {
                writer.WriteElementString("KeyContainer", KeyContainer);
            }
            if (IsKeyFileSpecified)
            {
                writer.WriteElementString("KeyFile", KeyFile);
            }
            writer.WriteElementString("LargeAddressAware", XmlConvert.ToString(!IsLargeAddressAwareSpecified || LargeAddressAware));
            writer.WriteElementString("LinkDLL", XmlConvert.ToString(IsLinkDLLSpecified && LinkDLL));
            writer.WriteElementString("MapExports", XmlConvert.ToString(IsMapExportsSpecified && MapExports));
            if (IsMapFileNameSpecified)
            {
                writer.WriteElementString("MapFileName", MapFileName);
            }
            if (IsMergedIDLBaseFileNameSpecified)
            {
                writer.WriteElementString("MergedIDLBaseFileName", MergedIDLBaseFileName);
            }
            if (IsMergeSectionsSpecified && MergeSections.Count > 0)
            {
                string merges = string.Join(";", MergeSections.Select(pair => pair.Key + "=" + pair.Value));
                writer.WriteElementString("MergeSections", merges);
            }
            if (MinimumRequiredVersion.HasValue)
            {
                writer.WriteElementString("MinimumRequiredVersion", XmlConvert.ToString(MinimumRequiredVersion.Value));
            }
            writer.WriteElementString("NoEntryPoint", XmlConvert.ToString(IsNoEntryPointSpecified && NoEntryPoint));
            writer.WriteElementString("OptimizeReferences", XmlConvert.ToString(!IsOptimizeReferencesSpecified || OptimizeReferences));
            writer.WriteElementString("PreventDllBinding", XmlConvert.ToString(IsPreventDllBindingSpecified && PreventDllBinding));
            writer.WriteElementString("RandomizedBaseAddress", XmlConvert.ToString(!IsRandomizedBaseAddressSpecified || RandomizedBaseAddress));
            if (SectionAlignment.HasValue)
            {
                writer.WriteElementString("SectionAlignment", XmlConvert.ToString(SectionAlignment.Value));
            }
            writer.WriteElementString("SetChecksum", XmlConvert.ToString(IsSetChecksumSpecified && SetChecksum));
            if (StackCommitSize.HasValue)
            {
                writer.WriteElementString("StackCommitSize", XmlConvert.ToString(StackCommitSize.Value));
            }
            if (StackReserveSize.HasValue)
            {
                writer.WriteElementString("StackReserveSize", XmlConvert.ToString(StackReserveSize.Value));
            }
            if (IsSubSystemSpecified && SubSystem != LinkerSubSystemOption.NotSet)
            {
                writer.WriteElementString("SubSystem", SubSystem.ToString());
            }
            else
            {
                writer.WriteElementString("SubSystem", LinkerSubSystemOption.Windows.ToString());
            }
            writer.WriteElementString("SupportNobindOfDelayLoadedDLL", XmlConvert.ToString(IsSupportNobindOfDelayLoadedDLLSpecified && SupportNobindOfDelayLoadedDLL));
            writer.WriteElementString("SupportUnloadOfDelayLoadedDLL", XmlConvert.ToString(IsSupportUnloadOfDelayLoadedDLLSpecified && SupportUnloadOfDelayLoadedDLL));
            writer.WriteElementString("SwapRunFromCD", XmlConvert.ToString(IsSwapRunFromCDSpecified && SwapRunFromCD));
            writer.WriteElementString("SwapRunFromNet", XmlConvert.ToString(IsSwapRunFromNetSpecified && SwapRunFromNet));
            if (IsTargetMachineSpecified && TargetMachine != LinkerTargetMachine.NotSet)
            {
                writer.WriteElementString("TargetMachine", TargetMachine.ToString());
            }
            else
            {
                writer.WriteElementString("TargetMachine",
                                          (suite.ActiveGoal.Has("x64") ? LinkerTargetMachine.MachineX64 : LinkerTargetMachine.MachineX86).ToString());
            }
            writer.WriteElementString("TerminalServerAware", XmlConvert.ToString(IsTerminalServerAwareSpecified && TerminalServerAware));
            writer.WriteElementString("TreatLinkerWarningAsErrors", XmlConvert.ToString(IsTreatLinkerWarningAsErrorsSpecified && TreatLinkerWarningAsErrors));
            writer.WriteElementString("TurnOffAssemblyGeneration", XmlConvert.ToString(IsTurnOffAssemblyGenerationSpecified && TurnOffAssemblyGeneration));
            if (TypeLibraryResourceID.HasValue)
            {
                writer.WriteElementString("TypeLibraryResourceID", XmlConvert.ToString(TypeLibraryResourceID.Value));
            }

            if (IsTypeLibraryFileSpecified)
            {
                writer.WriteElementString("TypeLibraryFile", TypeLibraryFile);
            }

            writer.WriteElementString("UACExecutionLevel", (IsUACExecutionLevelSpecified ? UACExecutionLevel : UACExecutionLevel.AsInvoker).ToString());
            writer.WriteElementString("UACUIAccess", XmlConvert.ToString(IsUACUIAccessSpecified && UACUIAccess));
        }