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


C# IVsProject.GetMkDocument方法代码示例

本文整理汇总了C#中IVsProject.GetMkDocument方法的典型用法代码示例。如果您正苦于以下问题:C# IVsProject.GetMkDocument方法的具体用法?C# IVsProject.GetMkDocument怎么用?C# IVsProject.GetMkDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVsProject的用法示例。


在下文中一共展示了IVsProject.GetMkDocument方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetProjectFilePath

        public static string GetProjectFilePath(IVsProject project)
        {
            string path = string.Empty;
            int hr = project.GetMkDocument(HierarchyConstants.VSITEMID_ROOT, out path);
            System.Diagnostics.Debug.Assert(hr == VSConstants.S_OK || hr == VSConstants.E_NOTIMPL, "GetMkDocument failed for project.");

            return path;
        }
开发者ID:ldematte,项目名称:BlenXVSP,代码行数:8,代码来源:ProjectUtilities.cs

示例2: GetProjectFilePath

        public static string GetProjectFilePath(IVsProject project)
        {
            string path = string.Empty;
            int hr = project.GetMkDocument((uint)VSConstants.VSITEMID.Root, out path);
            Debug.Assert(hr == VSConstants.S_OK || hr == VSConstants.E_NOTIMPL, "GetMkDocument failed for project.");

            return path;
        }
开发者ID:Konctantin,项目名称:VS_SDK_samples,代码行数:8,代码来源:ProjectUtilities.cs

示例3: ItemSupportsTransforms

        private bool ItemSupportsTransforms(IVsProject project, uint itemid)
        {
            string itemFullPath = null;

            if (ErrorHandler.Failed(project.GetMkDocument(itemid, out itemFullPath))) {
                return false;
            }

            bool itemSupportsTransforms = false;
            // make sure its not a transform file itsle
            bool isTransformFile = IsItemTransformItem(project, itemid);

            if (!isTransformFile && IsExtensionSupportedForFile(itemFullPath) && IsXmlFile(itemFullPath)) {
                itemSupportsTransforms = true;
            }

            return itemSupportsTransforms;
        }
开发者ID:VirtueMe,项目名称:slow-cheetah,代码行数:18,代码来源:SlowCheetahPackage.cs

示例4: ProjectSupportsTransforms

        private bool ProjectSupportsTransforms(IVsProject project)
        {
            string projectFullPath = null;

            if (ErrorHandler.Failed(project.GetMkDocument(VSConstants.VSITEMID_ROOT, out projectFullPath))) {
                return false;
            }

            string projectExtension = Path.GetExtension(projectFullPath);

            foreach (string supportedExtension in SupportedProjectExtensions) {
                if (projectExtension.Equals(supportedExtension, StringComparison.InvariantCultureIgnoreCase)) {
                    return true;
                }
            }

            return false;
        }
开发者ID:VirtueMe,项目名称:slow-cheetah,代码行数:18,代码来源:SlowCheetahPackage.cs

示例5: AllItemsInProject

        public static IEnumerable<string> AllItemsInProject(IVsProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            string sProjectFilename;
            project.GetMkDocument(VSConstants.VSITEMID_ROOT, out sProjectFilename);

            string projectDir = Path.GetDirectoryName(sProjectFilename);
            IVsHierarchy hierarchy = project as IVsHierarchy;

            return
                ChildrenOf(hierarchy, VSConstants.VSITEMID.Root)
                .Select(
                    id =>
                    {
                        string name = null;
                        project.GetMkDocument((uint)id, out name);
                        if (name != null && name.Length > 0 && !Path.IsPathRooted(name))
                        {
                            name = AbsolutePathFromRelative(name, projectDir);
                        }
                        return name;
                    })
                .Where(File.Exists);
        }
开发者ID:thennequin,项目名称:VS-QuickNavigation,代码行数:28,代码来源:FileList.cs

示例6: IsOurProject

 private bool IsOurProject(IVsProject project) {
     string projectDoc;
     project.GetMkDocument((uint)VSConstants.VSITEMID.Root, out projectDoc);
     return projectDoc == Project.Url;
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:5,代码来源:ProjectNode.CopyPaste.cs

示例7: 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);
        }
开发者ID:omnimark,项目名称:PTVS,代码行数:41,代码来源:TestContainerDiscoverer.cs

示例8: GetProjectPath

 public static string GetProjectPath(IVsProject project)
 {
     string projectPath;
     project.GetMkDocument(VSConstants.VSITEMID_ROOT, out projectPath);
     return projectPath;
 }
开发者ID:squadwuschel,项目名称:chutzpah,代码行数:6,代码来源:VsSolutionHelper.cs

示例9: AllItemsInProject

        /// <summary>
        /// Enumerates all items in the project except those in the "Reference" group.
        /// </summary>
        /// <param name="project">The project from which to retrieve the items.</param>
        /// <returns>A list of item "Include" values.  For items that specify files, these will be the file names.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown if <c>project</c> is null.</exception>
        public ICollection<string> AllItemsInProject(IVsProject project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            string projectDir = Path.GetDirectoryName(ProjectUtilities.GetProjectFilePath(project));
            IVsHierarchy hierarchy = project as IVsHierarchy;

            List<string> allNames = ChildrenOf(hierarchy, HierarchyConstants.VSITEMID_ROOT).ConvertAll<string>(
                delegate(uint id)
                {
                    string name = null;
                    project.GetMkDocument(id, out name);
                    if (name != null && name.Length > 0 && !Path.IsPathRooted(name))
                    {
                        name = AbsolutePathFromRelative(name, projectDir);
                    }
                    return name;
                });

            allNames.RemoveAll(
                delegate(string name)
                {
                    return !File.Exists(name);
                });

            return allNames;
        }
开发者ID:ldematte,项目名称:BlenXVSP,代码行数:36,代码来源:BuildManager.cs

示例10: ItemSupportsTransforms

        private bool ItemSupportsTransforms(IVsProject project, uint itemid)
        {
            string itemFullPath = null;

            if (ErrorHandler.Failed(project.GetMkDocument(itemid, out itemFullPath))) {
                return false;
            }

            bool itemSupportsTransforms = false;
            // make sure its not a transform file itsle
            bool isTransformFile = IsItemTransformItem(project, itemid);

            
            FileInfo transformFileInfo = new FileInfo(itemFullPath);
            bool isWebConfig = string.Compare("web.config", transformFileInfo.Name, StringComparison.OrdinalIgnoreCase) == 0;

            if (!isWebConfig && !isTransformFile && IsExtensionSupportedForFile(itemFullPath) && IsXmlFile(itemFullPath)) {
                itemSupportsTransforms = true;
            }

            return itemSupportsTransforms;
        }
开发者ID:kcrawford-InSite,项目名称:slow-cheetah,代码行数:22,代码来源:SlowCheetahPackage.cs

示例11: ItemSupportsTransforms

        private bool ItemSupportsTransforms(IVsProject project, uint itemid)
        {
            string itemFullPath = null;

            if (ErrorHandler.Failed(project.GetMkDocument(itemid, out itemFullPath))) return false;

            // make sure its not a transform file itsle
            //bool isTransformFile = IsItemTransformItem(project, itemid);

            var transformFileInfo = new FileInfo(itemFullPath);
            bool isWebConfig = string.Compare("web.config", transformFileInfo.Name, StringComparison.OrdinalIgnoreCase) == 0;

            return (isWebConfig && IsXmlFile(itemFullPath));
        }
开发者ID:zbrad,项目名称:oncheckin-transformer,代码行数:14,代码来源:OnCheckinTransforms.VisualStudioPackage.cs

示例12: GetItemFileName

        private static string GetItemFileName(IVsProject project, uint itemId)
        {
            string fileName;

            project.GetMkDocument(itemId, out fileName);

            return fileName;
        }
开发者ID:HexWrench,项目名称:VisualHG2015,代码行数:8,代码来源:VisualHgSolution.cs


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