本文整理汇总了C#中IType.SearchMember方法的典型用法代码示例。如果您正苦于以下问题:C# IType.SearchMember方法的具体用法?C# IType.SearchMember怎么用?C# IType.SearchMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IType
的用法示例。
在下文中一共展示了IType.SearchMember方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EventCreationCompletionData
public EventCreationCompletionData(TextEditorData editor, string varName, IType delegateType, IEvent evt, string parameterList, IMember callingMember, IType declaringType)
: base(null)
{
if (string.IsNullOrEmpty (varName))
varName = "handle";
this.DisplayText = "Handle" + Char.ToUpper (varName[0]) + varName.Substring (1) + evt.Name;
if (declaringType.SearchMember (this.DisplayText, true).Count > 0) {
for (int i = 1; i < 10000; i++) {
if (declaringType.SearchMember (this.DisplayText + i.ToString (), true).Count == 0) {
this.DisplayText = this.DisplayText + i.ToString ();
break;
}
}
}
this.editor = editor;
this.parameterList = parameterList;
this.callingMember = callingMember;
this.Icon = "md-newmethod";
this.initialOffset = editor.Caret.Offset;
}
示例2: HasCompatibleMethod
public bool HasCompatibleMethod (IType type, string methodName, InvocationExpression invocation)
{
// TODO: add argument type check for overloads.
if (invocation == null || type == null)
return false;
int invocationArguments = invocation.Arguments.Count ();
return type.SearchMember (methodName, true).Any (m => m is IMethod && m.Parameters.Count == invocationArguments);
}
示例3: HasCompatibleMethod
public bool HasCompatibleMethod (IType type, string methodName, InvocationExpression invocation)
{
// TODO: add argument type check for overloads.
return type.SearchMember (methodName, true).Any (m => m is IMethod && ((IMethod)m).Parameters.Count == invocation.Arguments.Count ());
}