本文整理汇总了C#中IProperty.GetGetMethod方法的典型用法代码示例。如果您正苦于以下问题:C# IProperty.GetGetMethod方法的具体用法?C# IProperty.GetGetMethod怎么用?C# IProperty.GetGetMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProperty
的用法示例。
在下文中一共展示了IProperty.GetGetMethod方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePropertyGet
public MethodInvocationExpression CreatePropertyGet(Expression target, IProperty property)
{
return property.IsExtension
? CreateMethodInvocation(property.GetGetMethod(), target)
: CreateMethodInvocation(target, property.GetGetMethod());
}
示例2: CreatePropertyStub
Property CreatePropertyStub(ClassDefinition node, IProperty baseProperty)
{
//try to complete partial implementation if any
Property property = node.Members[baseProperty.Name] as Property;
if (null == property) {
property = new Property(LexicalInfo.Empty);
property.Name = baseProperty.Name;
property.Modifiers = TypeSystemServices.GetAccess(baseProperty) | TypeMemberModifiers.Virtual;
property.IsSynthetic = true;
DeclareParameters(property, baseProperty.GetParameters(), baseProperty.IsStatic ? 0 : 1);
property.Type = CreateTypeReference(baseProperty.Type);
}
if (property.Getter == null && null != baseProperty.GetGetMethod())
property.Getter = CreateMethodStub(baseProperty.GetGetMethod());
if (property.Setter == null && null != baseProperty.GetSetMethod())
property.Setter = CreateMethodStub(baseProperty.GetSetMethod());
EnsureEntityFor(property);
return property;
}
示例3: IsWriteOnlyProperty
private bool IsWriteOnlyProperty(IProperty property)
{
return null == property.GetGetMethod();
}
示例4: ResolveClassAbstractProperty
void ResolveClassAbstractProperty(ClassDefinition node,
TypeReference baseTypeRef,
IProperty entity)
{
bool resolved = false;
foreach (TypeMember member in node.Members)
{
if (entity.Name != member.Name
|| NodeType.Property != member.NodeType
|| !IsCorrectExplicitMemberImplOrNoExplicitMemberAtAll(member, entity)
|| !TypeSystemServices.CheckOverrideSignature(entity.GetParameters(), GetPropertyEntity(member).GetParameters()))
continue;
Property p = (Property) member;
ProcessPropertyAccessor(p, p.Getter, entity.GetGetMethod());
ProcessPropertyAccessor(p, p.Setter, entity.GetSetMethod());
if (null == p.Type)
{
p.Type = CodeBuilder.CreateTypeReference(entity.Type);
}
else
{
if (entity.Type != p.Type.Entity)
Error(CompilerErrorFactory.ConflictWithInheritedMember(p, p.FullName, entity.FullName));
}
resolved = true;
}
if (resolved)
return;
foreach(SimpleTypeReference parent in node.BaseTypes)
{
if(_classDefinitionList.Contains(parent.Name))
{
depth++;
ResolveClassAbstractProperty(_classDefinitionList[parent.Name] as ClassDefinition, baseTypeRef, entity);
depth--;
}
}
if(CheckInheritsInterfaceImplementation(node, entity))
return;
if(depth == 0)
{
node.Members.Add(CreateAbstractProperty(baseTypeRef, entity));
AbstractMemberNotImplemented(node, baseTypeRef, entity);
}
}
示例5: CreateAbstractProperty
Property CreateAbstractProperty(TypeReference reference, IProperty property)
{
Debug.Assert(0 == property.GetParameters().Length);
Property p = CodeBuilder.CreateProperty(property.Name, property.Type);
p.Modifiers |= TypeMemberModifiers.Abstract;
IMethod getter = property.GetGetMethod();
if (getter != null)
{
p.Getter = CodeBuilder.CreateAbstractMethod(reference.LexicalInfo, getter);
}
IMethod setter = property.GetSetMethod();
if (setter != null)
{
p.Setter = CodeBuilder.CreateAbstractMethod(reference.LexicalInfo, setter);
}
return p;
}
示例6: HasGetter
private static bool HasGetter(IProperty property)
{
return property.GetGetMethod() != null;
}
示例7: ToTreeNode
private IBooParseTreeNode ToTreeNode(IProperty property)
{
return new MethodTreeNode(new EntitySourceOrigin(property), property.GetGetMethod().ReturnType.ToString(), property.DeclaringType.FullName);
}