本文整理汇总了C#中IProject类的典型用法代码示例。如果您正苦于以下问题:C# IProject类的具体用法?C# IProject怎么用?C# IProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProject类属于命名空间,在下文中一共展示了IProject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddProjectNode
public TreeNode AddProjectNode(TreeNode motherNode, IProject project)
{
ProjectNode projectNode = new ProjectNode(project);
projectNode.AddTo(motherNode);
ReferenceFolder referenceFolderNode = new ReferenceFolder(project);
referenceFolderNode.AddTo(projectNode);
//TagManagerNode tagManagerNode = new TagManagerNode(project);
//tagManagerNode.AddTo(projectNode);
//
// TagListFileNode tagListFileNode = new TagListFileNode(TagManager.FullFileName, FileNodeStatus.InProject);
// tagListFileNode.AddTo(projectNode);
// TagGroupNode tagGroupNode = new TagGroupNode(project);
// tagGroupNode.AddTo(projectNode);
// AimTagGroupFolderNode aimTagGroupFolderNode = new AimTagGroupFolderNode(project);
// aimTagGroupFolderNode.AddTo(projectNode);
//
// SecurityNode securityNode = new SecurityNode(project);
// securityNode.AddTo(projectNode);
//DriverFolderNode driverFolderNode = new DriverFolderNode(project);
//driverFolderNode.AddTo(projectNode);
motherNode.TreeView.MouseDoubleClick += new MouseEventHandler(TreeView_MouseDoubleClick);
return projectNode;
}
示例2: IsFileAValidModification
public bool IsFileAValidModification(IFileInfo file, IProject baseProject, IProject sourceProject, List<string> warnings, List<FileReleaseInfo> releases)
{
if (FileIsDeletedItem(file))
return false;
if (FileIsSharedResx(file))
{
var baseFile = baseProject.Drive.GetFileInfo(file.Url);
var sourceFile = sourceProject.Drive.GetFileInfo(file.Url);
ResxDifferences changes = ResxDiffMerge.CompareResxFiles(sourceFile, baseFile);
if (changes.None)
return false;
}
if (FileIsRelationship(file))
{
Guid sourceId = GetModelItemIdFromFile(file);
if (sourceId == Guid.Empty)
return true;
OrmRelationship baseRelationship = FindRelationshipInBaseById(sourceId, baseProject);
if (baseRelationship != null)
{
var sourceRelationship = sourceProject.Get<OrmRelationship>(file.Url);
var diffMerge = new ObjectDiffMerge();
var changes = diffMerge.CompareObjects(sourceRelationship, baseRelationship);
if (!changes.All(change => RelationshipChangeCanBeIgnored(change)))
warnings.Add(string.Format("{0} is an existing SalesLogix relationship that was renamed and also modified. This file will need to be manually merged.", file.Url));
return false;
}
}
return true;
}
示例3: Reparse
public static void Reparse(IProject project, bool initReferences, bool parseCode)
{
if (jobs == null)
return; // do nothing if service wasn't initialized (e.g. some unit tests)
ParseProjectContent pc = ParserService.GetProjectContent(project) as ParseProjectContent;
if (pc != null) {
if (initReferences) {
lock (reParse1) {
if (!reParse1.Contains(pc)) {
LoggingService.Debug("Enqueue for reinitializing references: " + project);
reParse1.Add(pc);
jobs.AddJob(new JobTask(pm => ReInitializeReferences(pc, pm),
GetLoadReferenceTaskTitle(project.Name),
10
));
}
}
}
if (parseCode) {
lock (reParse2) {
if (!reParse2.Contains(pc)) {
LoggingService.Debug("Enqueue for reparsing code: " + project);
reParse2.Add(pc);
jobs.AddJob(new JobTask(pm => ReparseCode(pc, pm),
GetParseTaskTitle(project.Name),
pc.GetInitializationWorkAmount()
));
}
}
}
jobs.StartRunningIfRequired();
}
}
示例4: GetOrCreateContextSpecification
public static ContextSpecificationElement GetOrCreateContextSpecification(MSpecUnitTestProvider provider,
IUnitTestElementManager manager,
PsiModuleManager psiModuleManager,
CacheManager cacheManager,
IProject project,
ContextElement context,
ProjectModelElementEnvoy projectEnvoy,
IClrTypeName declaringTypeName,
string fieldName,
bool isIgnored)
{
var id = ContextSpecificationElement.CreateId(context, fieldName);
var contextSpecification = manager.GetElementById(project, id) as ContextSpecificationElement;
if (contextSpecification != null)
{
contextSpecification.Parent = context;
contextSpecification.State = UnitTestElementState.Valid;
return contextSpecification;
}
return new ContextSpecificationElement(provider,
psiModuleManager,
cacheManager,
context,
projectEnvoy,
declaringTypeName,
fieldName,
isIgnored);
}
示例5: TextTemplatingAssemblyPathResolver
public TextTemplatingAssemblyPathResolver(IProject project)
: this(
project,
new TextTemplatingAssemblyParserService(),
new TextTemplatingPathResolver())
{
}
示例6: Parse
public ParseInformation Parse(FileName fileName, ITextSource fileContent, bool fullParseInformationRequested,
IProject parentProject, CancellationToken cancellationToken)
{
var csharpProject = parentProject as CSharpProject;
CSharpParser parser = new CSharpParser(csharpProject != null ? csharpProject.CompilerSettings : null);
parser.GenerateTypeSystemMode = !fullParseInformationRequested;
SyntaxTree cu = parser.Parse(fileContent, fileName);
cu.Freeze();
CSharpUnresolvedFile file = cu.ToTypeSystem();
ParseInformation parseInfo;
if (fullParseInformationRequested)
parseInfo = new CSharpFullParseInformation(file, fileContent.Version, cu);
else
parseInfo = new ParseInformation(file, fileContent.Version, fullParseInformationRequested);
IDocument document = fileContent as IDocument;
AddCommentTags(cu, parseInfo.TagComments, fileContent, parseInfo.FileName, ref document);
if (fullParseInformationRequested) {
if (document == null)
document = new ReadOnlyDocument(fileContent, parseInfo.FileName);
((CSharpFullParseInformation)parseInfo).newFoldings = CreateNewFoldings(cu, document);
}
return parseInfo;
}
示例7: AddProject
public IProject AddProject(IProject project)
{
_projects.Add(project);
project.ProjectId = _projects.Count();
return project;
}
示例8: GetOrCreateContext
public ContextElement GetOrCreateContext(string assemblyPath,
IProject project,
IClrTypeName typeName,
string subject,
ICollection<string> tags,
bool isIgnored)
{
var id = ContextElement.CreateId(_elementIdFactory, _provider, project, subject, typeName.FullName, tags);
var contextElement = this._manager.GetElementById(id) as ContextElement;
if (contextElement != null)
{
contextElement.State = UnitTestElementState.Valid;
contextElement.AssemblyLocation = assemblyPath;
return contextElement;
}
return new ContextElement(this._provider,
this._psiModuleManager,
this._cacheManager,
id,
new ProjectModelElementEnvoy(project),
typeName,
assemblyPath,
subject,
tags,
isIgnored,
_categoryFactory);
}
示例9: CreateTypeScriptContextIfProjectHasTypeScriptFiles
void CreateTypeScriptContextIfProjectHasTypeScriptFiles(IProject project)
{
var typeScriptProject = new TypeScriptProject(project);
if (typeScriptProject.HasTypeScriptFiles()) {
contextProvider.CreateProjectContext(typeScriptProject);
}
}
示例10: ProjectContentContainer
public ProjectContentContainer(MSBuildBasedProject project, IProjectContent initialProjectContent)
{
if (project == null)
throw new ArgumentNullException("project");
this.project = project;
this.projectContent = initialProjectContent.SetAssemblyName(project.AssemblyName).SetLocation(project.OutputAssemblyFullPath);
this.assemblyModel = (IUpdateableAssemblyModel)project.AssemblyModel;
this.assemblyModel.AssemblyName = this.projectContent.AssemblyName;
this.assemblyModel.FullAssemblyName = this.projectContent.FullAssemblyName;
this.cacheFileName = GetCacheFileName(project.FileName);
SD.ProjectService.ProjectItemAdded += OnProjectItemAdded;
SD.ProjectService.ProjectItemRemoved += OnProjectItemRemoved;
SD.AssemblyParserService.AssemblyRefreshed += OnAssemblyRefreshed;
List<FileName> filesToParse = new List<FileName>();
foreach (var file in project.Items.OfType<FileProjectItem>()) {
if (IsParseableFile(file)) {
var fileName = file.FileName;
parserService.AddOwnerProject(fileName, project, startAsyncParse: false, isLinkedFile: file.IsLink);
filesToParse.Add(fileName);
}
}
SD.ParserService.LoadSolutionProjectsThread.AddJob(
monitor => Initialize(monitor, filesToParse),
"Loading " + project.Name + "...", filesToParse.Count + LoadingReferencesWorkAmount);
}
示例11: CreateTestProjectWithTestClassAndSingleTestMethod
public static TestProject CreateTestProjectWithTestClassAndSingleTestMethod(IProject project,
string className,
string methodName)
{
string[] methodNames = new string[] { methodName };
return CreateTestProjectWithTestClassTestMethods(project, className, methodNames);
}
示例12: CreatePackageManager
void CreatePackageManager(IProject project, PackageReferenceRepositoryHelper packageRefRepositoryHelper)
{
options = new TestablePackageManagementOptions();
options.PackagesDirectory = "packages";
repositoryPaths = new SolutionPackageRepositoryPath(project, options);
var pathResolver = new DefaultPackagePathResolver(repositoryPaths.PackageRepositoryPath);
fakeFileSystem = new FakeFileSystem();
fakeFeedSourceRepository = new FakePackageRepository();
fakeSolutionSharedRepository = packageRefRepositoryHelper.FakeSharedSourceRepository;
fakePackageOperationResolverFactory = new FakePackageOperationResolverFactory();
var fakeSolutionPackageRepository = new FakeSolutionPackageRepository();
fakeSolutionPackageRepository.FileSystem = fakeFileSystem;
fakeSolutionPackageRepository.PackagePathResolver = pathResolver;
fakeSolutionPackageRepository.FakeSharedRepository = fakeSolutionSharedRepository;
packageManager = new SharpDevelopPackageManager(fakeFeedSourceRepository,
packageRefRepositoryHelper.FakeProjectSystem,
fakeSolutionPackageRepository,
fakePackageOperationResolverFactory);
}
示例13: Folder
public Folder(IProject project, string name)
{
this._project = project;
this._name = name;
this._items = new List<IItem>();
this._folders = new List<IFolder>();
}
示例14: BehaviorSpecificationFactory
public BehaviorSpecificationFactory(MSpecUnitTestProvider provider, IProject project, ProjectModelElementEnvoy projectEnvoy)
{
#endif
_provider = provider;
_project = project;
_projectEnvoy = projectEnvoy;
}
示例15: Accepts
public override bool Accepts(IProject project)
{
if (!project.IsProjectReferencingNancyRazorViewEngine())
return false;
return Language == ProjectLanguage.UNKNOWN || Language == project.ProjectProperties.DefaultLanguage;
}