本文整理汇总了C#中IReturnType类的典型用法代码示例。如果您正苦于以下问题:C# IReturnType类的具体用法?C# IReturnType怎么用?C# IReturnType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IReturnType类属于命名空间,在下文中一共展示了IReturnType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMethodsFromBaseType
void AddMethodsFromBaseType(List<IMethod> l, IReturnType baseType)
{
if (baseType != null) {
foreach (IMethod m in baseType.GetMethods()) {
if (m.IsConstructor)
continue;
bool ok = true;
if (m.IsOverridable) {
StringComparer comparer = m.DeclaringType.ProjectContent.Language.NameComparer;
foreach (IMethod oldMethod in c.Methods) {
if (comparer.Equals(oldMethod.Name, m.Name)) {
if (m.IsStatic == oldMethod.IsStatic && object.Equals(m.ReturnType, oldMethod.ReturnType)) {
if (DiffUtility.Compare(oldMethod.Parameters, m.Parameters) == 0) {
ok = false;
break;
}
}
}
}
}
if (ok)
l.Add(m);
}
}
}
示例2: ElementReturnType
public ElementReturnType(IProjectContent pc, IReturnType enumerableType)
{
if (pc == null)
throw new ArgumentNullException("pc");
this.enumerableType = enumerableType;
this.pc = pc;
}
示例3: ProvideContextCompletion
protected bool ProvideContextCompletion(ITextEditor editor, IReturnType expected, char charTyped)
{
if (expected == null) return false;
IClass c = expected.GetUnderlyingClass();
if (c == null) return false;
if (c.ClassType == ClassType.Enum) {
CtrlSpaceCompletionItemProvider cdp = new NRefactoryCtrlSpaceCompletionItemProvider(languageProperties);
var ctrlSpaceList = cdp.GenerateCompletionList(editor);
if (ctrlSpaceList == null) return false;
ContextCompletionItemList contextList = new ContextCompletionItemList();
contextList.Items.AddRange(ctrlSpaceList.Items);
contextList.activationKey = charTyped;
foreach (CodeCompletionItem item in contextList.Items.OfType<CodeCompletionItem>()) {
IClass itemClass = item.Entity as IClass;
if (itemClass != null && c.FullyQualifiedName == itemClass.FullyQualifiedName && c.TypeParameters.Count == itemClass.TypeParameters.Count) {
contextList.SuggestedItem = item;
break;
}
}
if (contextList.SuggestedItem != null) {
if (charTyped != ' ') contextList.InsertSpace = true;
editor.ShowCompletionWindow(contextList);
return true;
}
}
return false;
}
示例4: CreateResolveResult
ResolveResult CreateResolveResult(IReturnType resolvedType)
{
if (resolvedType == null)
return null;
else
return new ResolveResult(resolver.CallingClass, resolver.CallingMember, resolvedType);
}
示例5: MakeTypeResult
void MakeTypeResult(IReturnType rt)
{
if (rt != null)
resolveResult = new TypeResolveResult(callingClass, resolver.CallingMember, rt);
else
ClearResult();
}
示例6: FindOverload
public static IMethodOrProperty FindOverload(IEnumerable<IMethodOrProperty> list,
IReturnType[] arguments,
bool allowAdditionalArguments,
bool substituteInferredTypes,
out bool acceptableMatch)
{
OverloadResolution or = new OverloadResolution();
or.candidates = list.Select(m => new Candidate(m)).ToList();
or.arguments = arguments;
or.allowAdditionalArguments = allowAdditionalArguments;
if (or.candidates.Count == 0)
throw new ArgumentException("at least one candidate is required");
MemberLookupHelper.Log("OverloadResolution");
MemberLookupHelper.Log(" arguments = ", arguments);
or.ConstructExpandedForms();
or.InferTypeArguments();
or.CheckApplicability();
Candidate result = or.FindBestCandidate();
MemberLookupHelper.Log("Overload resolution finished. Winning candidate = " + result);
acceptableMatch = result.Status == CandidateStatus.Success;
if (substituteInferredTypes)
return result.Method;
else
return result.OriginalMethod;
}
示例7: DefaultField
public DefaultField(IReturnType type, string name, ModifierEnum m, DomRegion region, IClass declaringType)
: base(declaringType, name)
{
this.ReturnType = type;
this.Region = region;
this.Modifiers = m;
}
示例8: MakeResult
void MakeResult(IReturnType type)
{
if (type == null)
ClearResult();
else
resolveResult = new ResolveResult(callingClass, resolver.CallingMember, type);
}
示例9: SharpAssemblyParameter
public SharpAssemblyParameter(SharpAssembly_ asm, string paramName, IReturnType type)
{
name = paramName;
if (type.Name.EndsWith("&")) {
modifier |= ParameterModifier.Ref;
}
returnType = type;
}
示例10: CreateFromBaseType
/// <summary>
/// Returns null if base type is not an interface.
/// </summary>
public static CodeInterface CreateFromBaseType(IProjectContent projectContent, IReturnType baseType)
{
IClass baseTypeClass = baseType.GetUnderlyingClass();
if (baseTypeClass.ClassType == ClassType.Interface) {
return new CodeInterface(projectContent, baseType, baseTypeClass);
}
return null;
}
示例11: AddWebViewPageBaseClass
void AddWebViewPageBaseClass(DefaultClass webViewPageClass, IReturnType modelType)
{
IClass webViewPageBaseClass = webViewPageClass.ProjectContent.GetClass("System.Web.Mvc.WebViewPage", 1);
if (webViewPageBaseClass != null) {
IReturnType returnType = GetWebViewPageBaseClassReturnType(webViewPageBaseClass, modelType);
webViewPageClass.BaseTypes.Add(returnType);
}
}
示例12: DefaultMethod
public DefaultMethod(string name, IReturnType type, ModifierEnum m, DomRegion region, DomRegion bodyRegion, IClass declaringType)
: base(declaringType, name)
{
this.ReturnType = type;
this.Region = region;
this.BodyRegion = bodyRegion;
Modifiers = m;
}
示例13: ConstructedReturnType
public ConstructedReturnType(IReturnType baseType, IList<IReturnType> typeArguments)
{
if (baseType == null)
throw new ArgumentNullException("baseType");
if (typeArguments == null)
throw new ArgumentNullException("typeArguments");
this.typeArguments = typeArguments;
this.baseType = baseType;
}
示例14: DefaultAttribute
public DefaultAttribute(IReturnType attributeType, AttributeTarget attributeTarget, IList<object> positionalArguments, IDictionary<string, object> namedArguments)
{
if (attributeType == null)
throw new ArgumentNullException("attributeType");
this.AttributeType = attributeType;
this.AttributeTarget = attributeTarget;
this.positionalArguments = positionalArguments ?? new List<object>();
this.namedArguments = namedArguments ?? new SortedList<string, object>();
}
示例15: DefaultEvent
public DefaultEvent(string name, IReturnType type, ModifierEnum m, DomRegion region, DomRegion bodyRegion, IClass declaringType) : base(declaringType, name)
{
this.ReturnType = type;
this.Region = region;
this.BodyRegion = bodyRegion;
Modifiers = (ModifierEnum)m;
if (Modifiers == ModifierEnum.None) {
Modifiers = ModifierEnum.Private;
}
}