本文整理汇总了C#中IProject.GetProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IProject.GetProperty方法的具体用法?C# IProject.GetProperty怎么用?C# IProject.GetProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProject
的用法示例。
在下文中一共展示了IProject.GetProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
public BuildOutput Build(IBuildManager manager, ISolution solution, IProject project, IBuildProgressMonitor monitor)
{
var watch = new Stopwatch();
var entries = new List<DiskEntry>();
var buildSvc = this._workspace.GetService<ISimpleFileBuildService>();
var msgs = new List<ICompileMessage>();
var projPath = Path.GetDirectoryName(project.AbsolutePath);
var fname = Path.Combine(projPath, project.GetProperty("outputFilename"));
watch.Start();
foreach (var file in project.Files)
{
DiskEntry newEntry;
var fet = file.GetProperty("disk.entryTypeName");
var op = buildSvc.Build(manager, solution, project, file, monitor, false);
ushort[] words = op.Words;
msgs.AddRange(op.Messages);
if (!op.Success || words == null)
{
monitor.StatusUpdate("Build failed for " + file.AbsolutePath);
return new BuildOutput { Success = false, Time = watch.Elapsed, Messages = msgs };
}
switch (fet)
{
case "sector":
newEntry = new SpecificSectorDiskEntry { Name = file.Path, Sector = int.Parse(file.GetProperty("disk.index") ?? "0"), Words = words };
break;
case "offset":
newEntry = new SpecificOffsetDiskEntry { Name = file.Path, Offset = int.Parse(file.GetProperty("disk.index") ?? "0"), Words = words };
break;
case null:
case "":
case "fileSystem":
newEntry = new FileSystemDiskEntry { Name = file.Path, Path = file.Path, Words = words };
break;
default:
continue;
}
entries.Add(newEntry);
}
var disk = new Disk(this._plugin, project.Name, fname);
disk.Compress = bool.Parse(project.GetProperty("compress") ?? "true");
var provider = this._workspace.GetServices<IDiskFormatProvider>().Single(df => df.FormatName == project.GetProperty("filesystem.type"));
provider.BuildDisk(disk, entries);
disk.Save();
watch.Stop();
if (bool.Parse(project.GetProperty("autoLoad.enabled") ?? "false"))
{
int driveIndex = int.Parse(project.GetProperty("autoLoad.drive") ?? "0");
this._plugin.LoadDisk(driveIndex, disk);
}
return new BuildOutput
{
CodeModel = null,
DebugInfo = null,
Messages = msgs,
Success = true,
Time = watch.Elapsed,
Words = disk.GetData()
};
}
示例2: GetOutputAbsolutePaths
public IEnumerable<string> GetOutputAbsolutePaths(IProject proj)
{
var projPath = Path.GetDirectoryName(proj.AbsolutePath);
yield return Path.Combine(projPath, proj.GetProperty("outputFilename"));
}