本文整理汇总了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));
}
}
}
}
}
}
示例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;
}
示例3: CSharpProject
public CSharpProject(ProjectLoadInformation loadInformation)
: base(loadInformation)
{
Init();
if (loadInformation.InitializeTypeSystem)
InitializeProjectContent(new CSharpProjectContent());
}
示例4: UnknownProject
public UnknownProject(ProjectLoadInformation information, string warningText, bool displayWarningToUser)
: this(information)
{
this.warningText = warningText;
if (displayWarningToUser) {
ShowWarningMessageBox();
}
}
示例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;
}
示例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);
}
示例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) {
}
}
示例8: LoadProject
public IProject LoadProject(ProjectLoadInformation loadInformation)
{
return new RubyProject(loadInformation);
}
示例9: BooProject
public BooProject(ProjectLoadInformation info)
: base(info)
{
Init();
}
示例10: UnknownProject
public UnknownProject(ProjectLoadInformation information, string warningText)
: this(information)
{
this.warningText = warningText;
}
示例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();
}
}
示例12: CSharpProject
public CSharpProject(ProjectLoadInformation loadInformation)
: base(loadInformation)
{
Init();
}
示例13: LoadProject
public IProject LoadProject(ProjectLoadInformation loadInformation)
{
return new SnippetCompilerProject(loadInformation);
}
示例14: LoadProject
public IProject LoadProject(ProjectLoadInformation info)
{
return new CppProject(info);
}
示例15: LoadProject
public IProject LoadProject(ProjectLoadInformation loadInformation)
{
return new PythonProject(loadInformation);
}