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


C# IEntity.GetIdString方法代码示例

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


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

示例1: GetDocumentation

        public string GetDocumentation(IProject project, IEntity entity)
        {
            string idString = entity.GetIdString();
            string result;
            if (_documentationCache.TryGetValue(idString, out result))
                return result;

            DocumentationComment documentationComment = null;
            if (entity.Documentation != null)
            {
                // Documentation from source code
                documentationComment = entity.Documentation;
            }
            else
            {
                if (entity.ParentAssembly.AssemblyName != null)
                {
                    IDocumentationProvider docProvider = 
                        XmlDocumentationProviderFactory.Get(project, entity.ParentAssembly.AssemblyName);

                    if (docProvider != null)
                    {
                        documentationComment = docProvider.GetDocumentation(entity);
                    }
                }
            }

            result = documentationComment != null 
                ? DocumentationConverter.ConvertDocumentation(documentationComment.Xml.Text) 
                : null;

            _documentationCache.TryAdd(idString, result);
            return result;
        }
开发者ID:dykim07,项目名称:vim-ide,代码行数:34,代码来源:DocumentationFetcher.cs

示例2: GetDocumentation

        public DocumentationComment GetDocumentation(IEntity entity)
        {
            if (entity == null)
                throw new System.ArgumentNullException("entity");

            var idString = entity.GetIdString();
            
            XmlDocument doc = null;
            try
            {
                var helpTree = MonoDevelop.Projects.HelpService.HelpTree;
                if (helpTree == null)
                    return null;
                if (entity.SymbolKind == SymbolKind.TypeDefinition)
                {
                    #pragma warning disable 612,618
                    doc = helpTree.GetHelpXml(idString);
                    #pragma warning restore 612,618
                }
                else
                {
                    var parentId = entity.DeclaringTypeDefinition.GetIdString();

                    #pragma warning disable 612,618
                    try
                    {
                            
                        doc = helpTree.GetHelpXml(parentId);
                    }
                    catch (ArgumentNullException)
                    {
                        //ignore
                    }
                    #pragma warning restore 612,618
                    if (doc == null)
                    {
                        return null;
                    }
                    XmlNode node = SelectNode(doc, entity);

                    if (node != null)
                        return new DocumentationComment(node.OuterXml, new SimpleTypeResolveContext(entity));
                    return null;
                    //                  var node = doc.SelectSingleNode ("/Type/Members/Member")
                    //                  return new DocumentationComment (doc.OuterXml, new SimpleTypeResolveContext (entity));
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Error while reading monodoc file." + e);
            }
            if (doc == null)
            {
                return null;
            }
            return new DocumentationComment(doc.OuterXml, new SimpleTypeResolveContext(entity));
        }
开发者ID:Reese-D,项目名称:my_emacs,代码行数:57,代码来源:MonoDocDocumentationProvider.cs

示例3: GetDocumentation

		public DocumentationComment GetDocumentation (IEntity entity)
		{
			if (entity == null)
				throw new System.ArgumentNullException ("entity");
			
			// If we had an exception while getting the help xml the monodoc help provider
			// shouldn't try it again. A corrupt .zip file could cause long tooltip delays otherwise.
			if (hadError)
				return null;
			var idString = entity.GetIdString ();
			DocumentationComment result;
			if (commentCache.TryGetValue (idString, out result))
				return result;
			XmlDocument doc = null;
			try {
				var helpTree = MonoDevelop.Projects.HelpService.HelpTree;
				if (helpTree == null)
					return null;
				if (entity.EntityType == EntityType.TypeDefinition) {
					doc = helpTree.GetHelpXml (idString);
				} else {
					var parentId = entity.DeclaringTypeDefinition.GetIdString ();

					doc = helpTree.GetHelpXml (parentId);
					if (doc == null)
						return null;
					XmlNode node = SelectNode (doc, entity);
					
					if (node != null)
						return commentCache [idString] = new DocumentationComment (node.OuterXml, new SimpleTypeResolveContext (entity));
					return null;
//					var node = doc.SelectSingleNode ("/Type/Members/Member")
//					return new DocumentationComment (doc.OuterXml, new SimpleTypeResolveContext (entity));
				}
			} catch (Exception e) {
				hadError = true;
				LoggingService.LogError ("Error while reading monodoc file.", e);
			}
			if (doc == null) {
				commentCache [idString] = null;
				return null;
			}
			return commentCache [idString] = new DocumentationComment (doc.OuterXml, new SimpleTypeResolveContext (entity));
		}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:44,代码来源:MonoDocDocumentationProvider.cs


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