本文整理汇总了C#中IVsProject.GetProjectName方法的典型用法代码示例。如果您正苦于以下问题:C# IVsProject.GetProjectName方法的具体用法?C# IVsProject.GetProjectName怎么用?C# IVsProject.GetProjectName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVsProject
的用法示例。
在下文中一共展示了IVsProject.GetProjectName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestContainer
public TestContainer(TestContainerList containers, IVsProject project, string source)
: base(containers.Discoverer, source)
{
Project = project;
ProjectDirectory = project.GetProjectDir();
BaseDirectory = Discoverer.BaseDirectory;
Name = string.Join("/", new[] {
Project.GetProjectName(),
Path.GetDirectoryName(GetRelativePath(Source)).Replace('\\', '/')
}.Where(s => !string.IsNullOrWhiteSpace(s)));
Logger = new TestLogger(Discoverer.Logger, Name);
ServerLogger = CreateServerLogger();
Logger.Debug("Creating TestContainer for {0}", GetRelativePath(Source));
Containers = containers;
SourceSettings = Discoverer.TestSettings.AddSource(Name, Source);
try
{
Init();
}
catch (Exception ex)
{
Validate(false, "Error: " + ex.Message);
Logger.Error(ex, "Could not load tests");
}
FileWatchers = GetFileWatchers().Where(f => f != null).ToList();
if (IsValid)
{
SourceSettingsPersister.Save(Discoverer.TestAdapterInfo.SettingsFileDirectory, SourceSettings);
StartTestServer();
}
if (!IsValid)
{
Logger.Warn(InvalidReason);
}
else
{
Logger.Debug("TestContainer created");
}
}
示例2: GetTestContainers
public IEnumerable<ITestContainer> GetTestContainers(IVsProject project) {
if (!project.IsTestProject(GuidList.guidPythonProjectGuid)) {
if (EqtTrace.IsVerboseEnabled) {
EqtTrace.Verbose("TestContainerDiscoverer: Ignoring project {0} as it is not a test project.", project.GetProjectName());
}
yield break;
}
string path;
project.GetMkDocument(VSConstants.VSITEMID_ROOT, out path);
if (_detectingChanges) {
SaveModifiedFiles(project);
}
ProjectInfo projectInfo;
if (!_knownProjects.TryGetValue(path, out projectInfo)) {
// Don't return any containers for projects we don't know about.
yield break;
}
projectInfo.HasRequestedContainers = true;
var latestWrite = project.GetProjectItemPaths().Aggregate(
_lastWrite,
(latest, filePath) => {
try {
var ft = File.GetLastWriteTimeUtc(filePath);
return (ft > latest) ? ft : latest;
} catch (UnauthorizedAccessException) {
} catch (ArgumentException) {
} catch (IOException) {
}
return latest;
});
var architecture = Architecture.X86;
// TODO: Read the architecture from the project
yield return new TestContainer(this, path, latestWrite, architecture);
}