本文整理汇总了C#中IParameterizedMember类的典型用法代码示例。如果您正苦于以下问题:C# IParameterizedMember类的具体用法?C# IParameterizedMember怎么用?C# IParameterizedMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IParameterizedMember类属于命名空间,在下文中一共展示了IParameterizedMember类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InvocationResolveResult
public InvocationResolveResult(
ResolveResult targetResult, IParameterizedMember member, IType returnType,
IList<ResolveResult> arguments)
: base(targetResult, member, returnType)
{
this.Arguments = arguments ?? EmptyList<ResolveResult>.Instance;
}
开发者ID:jiguixin,项目名称:ILSpy,代码行数:7,代码来源:InvocationResolveResult.cs
示例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;
}
开发者ID:adisik,项目名称:simple-assembly-explorer,代码行数:8,代码来源:InvocationResolveResult.cs
示例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;
}
开发者ID:erik-kallen,项目名称:NRefactory,代码行数:11,代码来源:InvocationResolveResult.cs
示例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;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:11,代码来源:ParameterListComparer.cs
示例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;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:12,代码来源:NamedArgumentResolveResult.cs
示例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;
}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:16,代码来源:CSharpInvocationResolveResult.cs
示例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;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:18,代码来源:ParameterListComparer.cs
示例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;
}
开发者ID:erik-kallen,项目名称:NRefactory,代码行数:18,代码来源:DefaultParameter.cs
示例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;
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:19,代码来源:InvocationResolveResult.cs
示例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;
}
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:19,代码来源:RedundantWhereWithPredicateIssue.cs
示例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;
}
开发者ID:erik-kallen,项目名称:NRefactory,代码行数:20,代码来源:CSharpInvocationResolveResult.cs
示例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];
}
开发者ID:Netring,项目名称:ILSpy,代码行数:17,代码来源:OverloadResolution.cs
示例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
}
开发者ID:Netring,项目名称:ILSpy,代码行数:11,代码来源:OverloadResolution.cs
示例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;
}
开发者ID:Netring,项目名称:ILSpy,代码行数:28,代码来源:OverloadResolution.cs
示例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);
}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:6,代码来源:MemberCollector.cs
示例16: CreateTooltipInformation
public static TooltipInformation CreateTooltipInformation (ICompilation compilation, CSharpUnresolvedFile file, TextEditorData textEditorData, MonoDevelop.CSharp.Formatting.CSharpFormattingPolicy formattingPolicy, IParameterizedMember entity, int currentParameter, bool smartWrap)
{
var tooltipInfo = new TooltipInformation ();
var resolver = file.GetResolver (compilation, textEditorData.Caret.Location);
var sig = new SignatureMarkupCreator (resolver, formattingPolicy.CreateOptions ());
sig.HighlightParameter = currentParameter;
sig.BreakLineAfterReturnType = smartWrap;
try {
tooltipInfo.SignatureMarkup = sig.GetMarkup (entity);
} catch (Exception e) {
LoggingService.LogError ("Got exception while creating markup for :" + entity, e);
return new TooltipInformation ();
}
tooltipInfo.SummaryMarkup = AmbienceService.GetSummaryMarkup (entity) ?? "";
if (entity is IMethod) {
var method = (IMethod)entity;
if (method.IsExtensionMethod) {
tooltipInfo.AddCategory (GettextCatalog.GetString ("Extension Method from"), method.DeclaringTypeDefinition.FullName);
}
}
int paramIndex = currentParameter;
if (entity is IMethod && ((IMethod)entity).IsExtensionMethod)
paramIndex++;
paramIndex = Math.Min (entity.Parameters.Count - 1, paramIndex);
var curParameter = paramIndex >= 0 && paramIndex < entity.Parameters.Count ? entity.Parameters [paramIndex] : null;
if (curParameter != null) {
string docText = AmbienceService.GetDocumentation (entity);
if (!string.IsNullOrEmpty (docText)) {
string text = docText;
Regex paramRegex = new Regex ("(\\<param\\s+name\\s*=\\s*\"" + curParameter.Name + "\"\\s*\\>.*?\\</param\\>)", RegexOptions.Compiled);
Match match = paramRegex.Match (docText);
if (match.Success) {
text = AmbienceService.GetDocumentationMarkup (entity, match.Groups [1].Value);
if (!string.IsNullOrWhiteSpace (text))
tooltipInfo.AddCategory (GettextCatalog.GetString ("Parameter"), text);
}
}
if (curParameter.Type.Kind == TypeKind.Delegate)
tooltipInfo.AddCategory (GettextCatalog.GetString ("Delegate Info"), sig.GetDelegateInfo (curParameter.Type));
}
return tooltipInfo;
}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:48,代码来源:MethodParameterDataProvider.cs
示例17: SpecializedParameterizedMember
protected SpecializedParameterizedMember(IType declaringType, IParameterizedMember memberDefinition)
: base(declaringType, memberDefinition)
{
}
开发者ID:tapenjoyGame,项目名称:ILSpy,代码行数:4,代码来源:SpecializedMember.cs
示例18: GetParameterString
protected override string GetParameterString (IParameterizedMember member, IParameter parameter, OutputSettings settings)
{
if (parameter == null)
return "";
var result = new StringBuilder ();
if (settings.IncludeParameterName) {
if (settings.IncludeModifiers) {
if (parameter.IsOut) {
result.Append (settings.EmitKeyword ("out"));
}
if (parameter.IsRef) {
result.Append (settings.EmitKeyword ("ref"));
}
if (parameter.IsParams) {
result.Append (settings.EmitKeyword ("params"));
}
}
result.Append (GetTypeReferenceString (parameter.Type, settings));
result.Append (" ");
if (settings.HighlightName) {
result.Append (settings.EmitName (parameter, settings.Highlight (Format (FilterName (parameter.Name)))));
} else {
result.Append (settings.EmitName (parameter, Format (FilterName (parameter.Name))));
}
} else {
result.Append (GetTypeReferenceString (parameter.Type, settings));
}
return result.ToString ();
}
开发者ID:txdv,项目名称:monodevelop,代码行数:31,代码来源:CSharpAmbience.cs
示例19: GetString
public string GetString (IParameterizedMember member, IParameter parameter, OutputFlags flags)
{
return GetParameterString (member, parameter, new OutputSettings (flags));
}
开发者ID:rajeshpillai,项目名称:monodevelop,代码行数:4,代码来源:Ambience.cs
示例20: SelectOverload
public XmlNode SelectOverload(XmlNodeList nodes, IParameterizedMember entity)
{
XmlNode node = null;
if (nodes.Count == 1)
{
node = nodes[0];
}
else
{
var p = entity.Parameters;
foreach (XmlNode curNode in nodes)
{
var paramList = curNode.SelectNodes("Parameters/*");
if (p.Count == 0 && paramList.Count == 0)
return curNode;
if (p.Count != paramList.Count)
continue;
bool matched = true;
for (int i = 0; i < p.Count; i++)
{
var idString = GetTypeString(p[i].Type);
if (idString != paramList[i].Attributes["Type"].Value)
{
matched = false;
break;
}
}
if (matched)
{
return curNode;
}
}
}
if (node != null)
{
System.Xml.XmlNode result = node.SelectSingleNode("Docs");
return result;
}
return null;
}
开发者ID:Reese-D,项目名称:my_emacs,代码行数:40,代码来源:MonoDocDocumentationProvider.cs
注:本文中的IParameterizedMember类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论