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


C# Project.ProjectLoadInformation类代码示例

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


ProjectLoadInformation类属于ICSharpCode.SharpDevelop.Project命名空间,在下文中一共展示了ProjectLoadInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CppProject

		/// <summary>
		/// Create a new C++ project that loads the specified .vcproj file.
		/// </summary>
		public CppProject(ProjectLoadInformation info)
		{
			this.Name = info.ProjectName;
			this.FileName = info.FileName;
			this.TypeGuid = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";
			
			using (StreamReader r = new StreamReader(info.FileName, Encoding.Default)) {
				try {
					document.Load(r);
				} catch (Exception ex) {
					throw new ProjectLoadException(ex.Message, ex);
				}
			}
			if (document.DocumentElement.Name != "VisualStudioProject")
				throw new ProjectLoadException("The project is not a visual studio project.");
			XmlElement filesElement = document.DocumentElement["Files"];
			if (filesElement != null) {
				foreach (XmlElement filterElement in filesElement.ChildNodes.OfType<XmlElement>()) {
					if (filterElement.Name == "Filter") {
						FileGroup group = new FileGroup(this, filterElement);
						groups.Add(group);
						foreach (XmlElement fileElement in filterElement.ChildNodes.OfType<XmlElement>()) {
							if (fileElement.Name == "File" && fileElement.HasAttribute("RelativePath")) {
								items.Add(new FileItem(group, fileElement));
							}
						}
					}
				}
			}
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:33,代码来源:CppProject.cs

示例2: ErrorProject

 //string warningText = "${res:ICSharpCode.SharpDevelop.Commands.ProjectBrowser.NoBackendForProjectType}";
 //        public void ShowWarningMessageBox()
 //        {
 //            warningDisplayedToUser = true;
 //            MessageService.ShowError("Error loading " + this.FileName + ":\n" + warningText);
 //        }
 public ErrorProject(ProjectLoadInformation information, Exception exception)
     : base(information)
 {
     if (exception == null)
         throw new ArgumentNullException("exception");
     this.exception = exception;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:13,代码来源:ErrorProject.cs

示例3: CSharpProject

		public CSharpProject(ProjectLoadInformation loadInformation)
			: base(loadInformation)
		{
			Init();
			if (loadInformation.InitializeTypeSystem)
				InitializeProjectContent(new CSharpProjectContent());
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:CSharpProject.cs

示例4: UnknownProject

		public UnknownProject(ProjectLoadInformation information, string warningText, bool displayWarningToUser)
			: this(information)
		{
			this.warningText = warningText;
			if (displayWarningToUser) {
				ShowWarningMessageBox();
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:8,代码来源:UnknownProject.cs

示例5: LoadProject

		Guid projectGuid; // GUID of next project to be loaded
		
		IProject LoadProject(ProjectLoadInformation info)
		{
			var project = MockRepository.GenerateStrictMock<IProject>();
			project.Stub(p => p.IdGuid).PropertyBehavior();
			project.IdGuid = projectGuid;
			project.Stub(p => p.FileName).Return(info.FileName);
			project.Stub(p => p.ParentSolution).Return(info.Solution);
			project.Stub(p => p.ParentFolder).PropertyBehavior();
			project.Stub(p => p.ProjectSections).Return(new SimpleModelCollection<SolutionSection>());
			project.Stub(p => p.ConfigurationMapping).Return(new ConfigurationMapping());
			project.Stub(p => p.IsStartable).Return(false);
			project.Stub(p => p.ProjectLoaded()).Do(new Action(delegate { }));
			return project;
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:16,代码来源:AddExistingProjectTests.cs

示例6: VbpProject

        public VbpProject(ProjectLoadInformation info)
            : base(info)
        {
            _projectReader = new Vb6ProjectReader();
            _projectWriter = new Vb6ProjectWriter();

            FileInfo file = new FileInfo(info.FileName);
            using (Stream stream = file.OpenRead())
            {
                _vbProject = _projectReader.Read(file, stream);
            }

            AddGenericItems();
            AddReferences();

            _symbolCache = VbpProjectSymbolCache.FromProject(this);
        }
开发者ID:mks786,项目名称:vb6leap,代码行数:17,代码来源:VbpProject.cs

示例7: MSBuildFileProject

		public MSBuildFileProject(ProjectLoadInformation information) : base(information)
		{
			try {
				using (XmlReader r = XmlReader.Create(information.FileName, new XmlReaderSettings { IgnoreComments = true, XmlResolver = null })) {
					if (r.Read() && r.MoveToContent() == XmlNodeType.Element) {
						string toolsVersion = r.GetAttribute("ToolsVersion");
						Version v;
						if (Version.TryParse(toolsVersion, out v)) {
							if (v >= new Version(4, 0)) {
								minimumSolutionVersion = SolutionFormatVersion.VS2010; // use 4.0 Build Worker
							}
						}
					}
				}
			} catch (XmlException) {
			} catch (IOException) {
			}
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:18,代码来源:MSBuildFileProject.cs

示例8: LoadProject

		public IProject LoadProject(ProjectLoadInformation loadInformation)
		{
			return new RubyProject(loadInformation);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:4,代码来源:RubyProjectBinding.cs

示例9: BooProject

		public BooProject(ProjectLoadInformation info)
			: base(info)
		{
			Init();
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:5,代码来源:BooProject.cs

示例10: UnknownProject

		public UnknownProject(ProjectLoadInformation information, string warningText)
			: this(information)
		{
			this.warningText = warningText;
		}
开发者ID:ratoy,项目名称:SharpDevelop,代码行数:5,代码来源:UnknownProject.cs

示例11: CreateProject


//.........这里部分代码省略.........
							string metadataValue = projectItem.GetMetadata(metadataName);
							// if the input contains any special MSBuild sequences, don't escape the value
							// we want to escape only when the special characters are introduced by the StringParser.Parse replacement
							if (metadataValue.Contains("$(") || metadataValue.Contains("%"))
								newProjectItem.SetMetadata(StringParser.Parse(metadataName), StringParser.Parse(metadataValue));
							else
								newProjectItem.SetEvaluatedMetadata(StringParser.Parse(metadataName), StringParser.Parse(metadataValue));
						}
						project.Items.Add(newProjectItem);
					}
				}
				
				// Add properties from <PropertyGroup>
				// This must be done before adding <Imports>, because the import path can refer to properties.
				if (projectProperties.Count > 0) {
					if (!(project is MSBuildBasedProject))
						throw new Exception("<PropertyGroup> may be only used in project templates for MSBuildBasedProjects");
					
					foreach (ProjectProperty p in projectProperties) {
						((MSBuildBasedProject)project).SetProperty(
							StringParser.Parse(p.Configuration),
							StringParser.Parse(p.Platform),
							StringParser.Parse(p.Name),
							StringParser.Parse(p.Value),
							p.Location,
							p.ValueIsLiteral
						);
					}
				}
				
				// Add Imports
				if (clearExistingImports || projectImports.Count > 0) {
					MSBuildBasedProject msbuildProject = project as MSBuildBasedProject;
					if (msbuildProject == null)
						throw new Exception("<Imports> may be only used in project templates for MSBuildBasedProjects");
					try {
						msbuildProject.PerformUpdateOnProjectFile(
							delegate {
								var projectFile = msbuildProject.MSBuildProjectFile;
								if (clearExistingImports) {
									foreach (var import in projectFile.Imports.ToArray())
										projectFile.RemoveChild(import);
								}
								foreach (Import projectImport in projectImports) {
									projectFile.AddImport(projectImport.Key).Condition = projectImport.Value;
								}
								
							});
					} catch (InvalidProjectFileException ex) {
						string message;
						if (string.IsNullOrEmpty(importsFailureMessage)) {
							message = "Error creating project:\n" + ex.Message;
						} else {
							message = importsFailureMessage + "\n\n" + ex.Message;
						}
						throw new ProjectLoadException(message, ex);
					}
				}
				
				// Add Files
				if (!project.Items.IsReadOnly) {
					
					foreach (FileDescriptionTemplate file in files) {
						string fileName = Path.Combine(projectBasePath, StringParser.Parse(file.Name, new StringTagPair("ProjectName", projectCreateOptions.ProjectName)));
						FileProjectItem projectFile = new FileProjectItem(project, project.GetDefaultItemType(fileName));
						
						projectFile.Include = FileUtility.GetRelativePath(project.Directory, fileName);
						
						file.SetProjectItemProperties(projectFile);
						
						project.Items.Add(projectFile);
					}
				}
				
				#endregion
				
				RunCreateActions(project);
				
				project.ProjectCreationComplete();
				
				// Save project
				project.Save();
				
				// HACK : close and reload
				var fn = project.FileName;
				project.Dispose();
				ProjectLoadInformation loadInfo = new ProjectLoadInformation(parentSolution, fn, fn.GetFileNameWithoutExtension());
				project = SD.ProjectService.LoadProject(loadInfo);
				target.Items.Add(project);
				project.ProjectLoaded();
				
				SD.GetRequiredService<IProjectServiceRaiseEvents>().RaiseProjectCreated(new ProjectEventArgs(project));
				templateResults.NewProjects.Add(project);
				success = true;
				return true;
			} finally {
				if (project != null && !success)
					project.Dispose();
			}
		}
开发者ID:nataviva,项目名称:SharpDevelop-1,代码行数:101,代码来源:ProjectDescriptor.cs

示例12: CSharpProject

		public CSharpProject(ProjectLoadInformation loadInformation)
			: base(loadInformation)
		{
			Init();
		}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:5,代码来源:CSharpProject.cs

示例13: LoadProject

		public IProject LoadProject(ProjectLoadInformation loadInformation)
		{
			return new SnippetCompilerProject(loadInformation);
		}
开发者ID:Netring,项目名称:SharpDevelop,代码行数:4,代码来源:SharpSnippetProjectBinding.cs

示例14: LoadProject

		public IProject LoadProject(ProjectLoadInformation info)
		{
			return new CppProject(info);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:4,代码来源:CppProjectBinding.cs

示例15: LoadProject

		public IProject LoadProject(ProjectLoadInformation loadInformation)
		{
			return new PythonProject(loadInformation);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:4,代码来源:PythonProjectBinding.cs


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