本文整理汇总了C#中IMethod.GetIdentifier方法的典型用法代码示例。如果您正苦于以下问题:C# IMethod.GetIdentifier方法的具体用法?C# IMethod.GetIdentifier怎么用?C# IMethod.GetIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMethod
的用法示例。
在下文中一共展示了IMethod.GetIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParsedMethod
private SDMethod GetParsedMethod(IMethod method, bool isCtor)
{
var sdMethod = _repository.GetMethodByIdentifier(method.GetIdentifier());
if (sdMethod != null)
{
return sdMethod;
}
var returnType = _typeParser.GetParsedType(method.ReturnType);
sdMethod = new SDMethod(method.GetIdentifier(), isCtor ? method.DeclaringType.Name : method.Name)
{
Namespace = method.Namespace,
DeclaringType = _typeParser.GetParsedType(method.DeclaringType),
ReturnType = returnType,
IsCtor = isCtor,
Accessibility = method.Accessibility.ToString().ToLower(),
IsAbstract = method.IsAbstract,
IsShadowing = method.IsShadowing,
IsOverride = method.IsOverride,
IsPrivate = method.IsPrivate,
IsProtected = method.IsProtected,
IsPublic = method.IsPublic,
IsSealed = method.IsSealed,
IsVirtual = method.IsVirtual,
IsStatic = method.IsStatic,
Documentations = _documentationParser.ParseDocumentation(method),
Region = new SDRegion
{
BeginColumn = method.Region.BeginColumn,
BeginLine = method.Region.BeginLine,
EndColumn = method.Region.EndColumn,
EndLine = method.Region.EndLine,
Filename = method.Region.FileName
}
};
foreach (ITypeParameter typeParameter in method.TypeParameters)
{
sdMethod.TypeParameters.Add(_typeParser.GetParsedType(typeParameter));
}
foreach (IParameter parameter in method.Parameters)
{
sdMethod.Parameters.Add(new SDParameter
{
Name = parameter.Name,
ParamType = _typeParser.GetParsedType(parameter.Type),
IsOptional = parameter.IsOptional,
IsConst = parameter.IsConst,
ConstantValue = parameter.ConstantValue,
IsRef = parameter.IsRef,
IsOut = parameter.IsOut
});
}
_repository.AddMethod(sdMethod);
return sdMethod;
}
示例2: GetMinimalParsedMethod
private static SDMethod GetMinimalParsedMethod(IMethod method, bool isCtor)
{
return new SDMethod(method.GetIdentifier(), isCtor ? method.DeclaringType.Name : method.Name)
{
IsCtor = isCtor,
Accessibility = method.Accessibility.ToString().ToLower()
};
}