本文整理汇总了C#中IParameterizedMember类的典型用法代码示例。如果您正苦于以下问题:C# IParameterizedMember类的具体用法?C# IParameterizedMember怎么用?C# IParameterizedMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IParameterizedMember类属于命名空间,在下文中一共展示了IParameterizedMember类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InvocationResolveResult
public InvocationResolveResult(
ResolveResult targetResult, IParameterizedMember member, IType returnType,
IList<ResolveResult> arguments)
: base(targetResult, member, returnType)
{
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
}
示例2: InvocationResolveResult
public InvocationResolveResult(ResolveResult targetResult, IParameterizedMember member,
IList<ResolveResult> arguments = null,
IList<ResolveResult> initializerStatements = null)
: base(targetResult, member)
{
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
this.InitializerStatements = initializerStatements ?? EmptyList<ResolveResult>.Instance;
}
示例3: InvocationResolveResult
public InvocationResolveResult(ResolveResult targetResult, IParameterizedMember member,
IList<ResolveResult> arguments = null,
IList<ResolveResult> initializerStatements = null,
IType returnTypeOverride = null,
bool isConditionallyRemoved = false)
: base(targetResult, member, returnTypeOverride)
{
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
this.InitializerStatements = initializerStatements ?? EmptyList<ResolveResult>.Instance;
this.IsConditionallyRemoved = isConditionallyRemoved;
}
示例4: GetHashCode
public static int GetHashCode(ITypeResolveContext context, IParameterizedMember obj)
{
int hashCode = obj.Parameters.Count;
unchecked {
foreach (IParameter p in obj.Parameters) {
hashCode *= 27;
hashCode += p.Type.Resolve(context).GetHashCode();
}
}
return hashCode;
}
示例5: NamedArgumentResolveResult
public NamedArgumentResolveResult(IParameter parameter, ResolveResult argument, IParameterizedMember member = null)
: base(argument.Type)
{
if (parameter == null)
throw new ArgumentNullException("parameter");
if (argument == null)
throw new ArgumentNullException("argument");
this.Member = member;
this.Parameter = parameter;
this.ParameterName = parameter.Name;
this.Argument = argument;
}
示例6: CSharpInvocationResolveResult
public CSharpInvocationResolveResult(
ResolveResult targetResult, IParameterizedMember member,
IList<ResolveResult> arguments,
OverloadResolutionErrors overloadResolutionErrors = OverloadResolutionErrors.None,
bool isExtensionMethodInvocation = false,
bool isExpandedForm = false,
bool isDelegateInvocation = false,
IList<int> argumentToParameterMap = null)
: base(targetResult, member, arguments)
{
this.OverloadResolutionErrors = overloadResolutionErrors;
this.IsExtensionMethodInvocation = isExtensionMethodInvocation;
this.IsExpandedForm = isExpandedForm;
this.IsDelegateInvocation = isDelegateInvocation;
this.argumentToParameterMap = argumentToParameterMap;
}
示例7: Compare
public static bool Compare(ITypeResolveContext context, IParameterizedMember x, IParameterizedMember y)
{
var px = x.Parameters;
var py = y.Parameters;
if (px.Count != py.Count)
return false;
for (int i = 0; i < px.Count; i++) {
var a = px[i];
var b = py[i];
if (a == null && b == null)
continue;
if (a == null || b == null)
return false;
if (!a.Type.Resolve(context).Equals(b.Type.Resolve(context)))
return false;
}
return true;
}
示例8: DefaultParameter
public DefaultParameter(IType type, string name, IParameterizedMember owner = null, DomRegion region = default(DomRegion), IList<IAttribute> attributes = null,
bool isRef = false, bool isOut = false, bool isParams = false, bool isOptional = false, object defaultValue = null)
{
if (type == null)
throw new ArgumentNullException("type");
if (name == null)
throw new ArgumentNullException("name");
this.type = type;
this.name = name;
this.owner = owner;
this.region = region;
this.attributes = attributes;
this.isRef = isRef;
this.isOut = isOut;
this.isParams = isParams;
this.isOptional = isOptional;
this.defaultValue = defaultValue;
}
示例9: InvocationResolveResult
public InvocationResolveResult(
ResolveResult targetResult, IParameterizedMember member, IType returnType,
IList<ResolveResult> arguments,
OverloadResolutionErrors overloadResolutionErrors = OverloadResolutionErrors.None,
bool isExtensionMethodInvocation = false,
bool isExpandedForm = false,
bool isLiftedOperatorInvocation = false,
bool isDelegateInvocation = false,
IList<int> argumentToParameterMap = null)
: base(targetResult, member, returnType)
{
this.OverloadResolutionErrors = overloadResolutionErrors;
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
this.IsExtensionMethodInvocation = isExtensionMethodInvocation;
this.IsExpandedForm = isExpandedForm;
this.IsLiftedOperatorInvocation = isLiftedOperatorInvocation;
this.IsDelegateInvocation = isDelegateInvocation;
this.argumentToParameterMap = argumentToParameterMap;
}
示例10: HasPredicateVersion
bool HasPredicateVersion(IParameterizedMember member)
{
if (!IsQueryExtensionClass(member.DeclaringTypeDefinition))
return false;
switch (member.Name) {
case "Any":
case "Count":
case "First":
case "FirstOrDefault":
case "Last":
case "LastOrDefault":
case "LongCount":
case "Single":
case "SingleOrDefault":
return true;
default:
return false;
}
}
示例11: CSharpInvocationResolveResult
public CSharpInvocationResolveResult(
ResolveResult targetResult, IParameterizedMember member,
IList<ResolveResult> arguments,
OverloadResolutionErrors overloadResolutionErrors = OverloadResolutionErrors.None,
bool isExtensionMethodInvocation = false,
bool isExpandedForm = false,
bool isDelegateInvocation = false,
IList<int> argumentToParameterMap = null,
IList<ResolveResult> initializerStatements = null,
IType returnTypeOverride = null,
bool isConditionallyRemoved = false
)
: base(targetResult, member, arguments, initializerStatements, returnTypeOverride, isConditionallyRemoved)
{
this.OverloadResolutionErrors = overloadResolutionErrors;
this.IsExtensionMethodInvocation = isExtensionMethodInvocation;
this.IsExpandedForm = isExpandedForm;
this.IsDelegateInvocation = isDelegateInvocation;
this.argumentToParameterMap = argumentToParameterMap;
}
示例12: Candidate
public Candidate(IParameterizedMember member, bool isExpanded)
{
this.Member = member;
this.IsExpandedForm = isExpanded;
IMethod method = member as IMethod;
if (method != null && method.TypeParameters.Count > 0) {
// For generic methods, go back to the original parameters
// (without any type parameter substitution, not even class type parameters)
// We'll re-substitute them as part of RunTypeInference().
method = (IMethod)method.MemberDefinition;
this.Parameters = method.Parameters;
this.TypeParameters = method.TypeParameters;
} else {
this.Parameters = member.Parameters;
}
this.ParameterTypes = new IType[this.Parameters.Count];
}
示例13: LogCandidateAddingResult
internal void LogCandidateAddingResult(string text, IParameterizedMember method, OverloadResolutionErrors errors)
{
#if DEBUG
Log.WriteLine(string.Format("{0} {1} = {2}{3}",
text, method,
errors == OverloadResolutionErrors.None ? "Success" : errors.ToString(),
this.BestCandidate == method ? " (best candidate so far)" :
this.BestCandidateAmbiguousWith == method ? " (ambiguous)" : ""
));
#endif
}
示例14: AddCandidate
public OverloadResolutionErrors AddCandidate(IParameterizedMember member, OverloadResolutionErrors additionalErrors)
{
if (member == null)
throw new ArgumentNullException("member");
Candidate c = new Candidate(member, false);
if (additionalErrors != OverloadResolutionErrors.None)
c.AddError(additionalErrors);
if (CalculateCandidate(c)) {
//candidates.Add(c);
}
if (this.AllowExpandingParams && member.Parameters.Count > 0
&& member.Parameters[member.Parameters.Count - 1].IsParams)
{
Candidate expandedCandidate = new Candidate(member, true);
if (additionalErrors != OverloadResolutionErrors.None)
expandedCandidate.AddError(additionalErrors);
// consider expanded form only if it isn't obviously wrong
if (CalculateCandidate(expandedCandidate)) {
//candidates.Add(expandedCandidate);
if (expandedCandidate.ErrorCount < c.ErrorCount)
return expandedCandidate.Errors;
}
}
return c.Errors;
}
示例15: MatchParameters
static bool MatchParameters (IParameterizedMember a, IParameterizedMember b)
{
if (a == null && b == null) return true;
if (a == null || b == null) return false;
return ParameterListComparer.Instance.Equals (a.Parameters, b.Parameters);
}