当前位置: 首页>>代码示例>>C#>>正文


C# MSBuildBasedProject.SetProperty方法代码示例

本文整理汇总了C#中ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.SetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# MSBuildBasedProject.SetProperty方法的具体用法?C# MSBuildBasedProject.SetProperty怎么用?C# MSBuildBasedProject.SetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICSharpCode.SharpDevelop.Project.MSBuildBasedProject的用法示例。


在下文中一共展示了MSBuildBasedProject.SetProperty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUpFixture

		public void SetUpFixture()
		{
			PythonMSBuildEngineHelper.InitMSBuildEngine();

			List<ProjectBindingDescriptor> bindings = new List<ProjectBindingDescriptor>();
			using (TextReader reader = PythonBindingAddInFile.ReadAddInFile()) {
				AddIn addin = AddIn.Load(reader, String.Empty);
				bindings.Add(new ProjectBindingDescriptor(AddInHelper.GetCodon(addin, "/SharpDevelop/Workbench/ProjectBindings", "Python")));
			}
			ProjectBindingService.SetBindings(bindings);
			
			// Set up IProjectContent so the ConvertProjectToPythonProjectCommand can
			// locate the startup object and determine it's filename.
			
			mockProjectContent = new ICSharpCode.Scripting.Tests.Utils.MockProjectContent();
			MockClass mainClass = new MockClass(mockProjectContent, startupObject);
			mainClass.CompilationUnit.FileName = @"d:\projects\test\src\Main2.cs";
			mockProjectContent.SetClassToReturnFromGetClass(startupObject, mainClass);
			
			convertProjectCommand = new DerivedConvertProjectToPythonProjectCommand();
			convertProjectCommand.ProjectContent = mockProjectContent;
			convertProjectCommand.FileServiceDefaultEncoding = Encoding.Unicode;
			
			Solution solution = new Solution(new MockProjectChangeWatcher());
			sourceProject = new MSBuildBasedProject(
				new ProjectCreateInformation() {
					Solution = solution,
					OutputProjectFileName = @"d:\projects\test\source.csproj",
					ProjectName = "source"
				});
			sourceProject.Parent = solution;
			sourceProject.SetProperty(null, null, "StartupObject", startupObject, PropertyStorageLocations.Base, true);
			mainFile = new FileProjectItem(sourceProject, ItemType.Compile, @"src\Main.cs");
			targetProject = (PythonProject)convertProjectCommand.CallCreateProject(@"d:\projects\test\converted", sourceProject);
			convertProjectCommand.CallCopyProperties(sourceProject, targetProject);
			targetMainFile = new FileProjectItem(targetProject, mainFile.ItemType, mainFile.Include);
			mainFile.CopyMetadataTo(targetMainFile);
			
			main2File = new FileProjectItem(sourceProject, ItemType.Compile, @"src\Main2.cs");
			targetMain2File = new FileProjectItem(targetProject, main2File.ItemType, main2File.Include);
			main2File.CopyMetadataTo(targetMain2File);
			
			convertProjectCommand.AddParseableFileContent(mainFile.FileName, mainSource);
			convertProjectCommand.AddParseableFileContent(main2File.FileName, main2Source);
			
			convertProjectCommand.CallConvertFile(mainFile, targetMainFile);
			convertProjectCommand.CallConvertFile(main2File, targetMain2File);
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:48,代码来源:ProjectHasStartupObjectTestFixture.cs


注:本文中的ICSharpCode.SharpDevelop.Project.MSBuildBasedProject.SetProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。