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


C# IMember.GetEditorBrowsableState方法代码示例

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


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

示例1: AddMember

		public ICompletionData AddMember (IMember member)
		{
			var newData = Factory.CreateEntityCompletionData (member);
			
			if (member.ParentAssembly != completion.ctx.CurrentAssembly) {
				switch (completion.EditorBrowsableBehavior) {
					case EditorBrowsableBehavior.Ignore:
						break;
					case EditorBrowsableBehavior.Normal:
						var state = member.GetEditorBrowsableState();
						if (state != System.ComponentModel.EditorBrowsableState.Always)
							return null;
						break;
					case EditorBrowsableBehavior.IncludeAdvanced:
						if (!member.IsBrowsable())
							return null;
						break;
					default:
						throw new ArgumentOutOfRangeException();
				}
			}
			string memberKey = newData.DisplayText;
			if (memberKey == null)
				return null;

			newData.CompletionCategory = GetCompletionCategory (member.DeclaringTypeDefinition);

			List<ICompletionData> existingData;
			data.TryGetValue (memberKey, out existingData);
			if (existingData != null) {
				if (member.SymbolKind == SymbolKind.Field || member.SymbolKind == SymbolKind.Property || member.SymbolKind == SymbolKind.Event)
					return null;
				var a = member as IEntity;
				foreach (var d in existingData) {
					if (!(d is IEntityCompletionData))
						continue;
					var b = ((IEntityCompletionData)d).Entity;
					if (a == null || b == null || a.SymbolKind == b.SymbolKind) {
						d.AddOverload (newData);
						return d;
					} 
				}
				if (newData != null) {
					result.Add (newData);
					data [memberKey].Add (newData);
				}
			} else {
				result.Add (newData);
				data [memberKey] = new List<ICompletionData> ();
				data [memberKey].Add (newData);
			}
			return newData;
		}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:53,代码来源:CompletionDataWrapper.cs


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