当前位置: 首页>>代码示例>>C#>>正文


C# IProperty.GetGetMethod方法代码示例

本文整理汇总了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());
 }
开发者ID:0xb1dd1e,项目名称:boo,代码行数:6,代码来源:BooCodeBuilder.cs

示例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;
        }
开发者ID:0xb1dd1e,项目名称:boo,代码行数:22,代码来源:BooCodeBuilder.cs

示例3: IsWriteOnlyProperty

 private bool IsWriteOnlyProperty(IProperty property)
 {
     return null == property.GetGetMethod();
 }
开发者ID:stuman08,项目名称:boo,代码行数:4,代码来源:ProcessMethodBodies.cs

示例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);
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:51,代码来源:ProcessInheritedAbstractMembers.cs

示例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;
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:19,代码来源:ProcessInheritedAbstractMembers.cs

示例6: HasGetter

 private static bool HasGetter(IProperty property)
 {
     return property.GetGetMethod() != null;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:ProcessInheritedAbstractMembers.cs

示例7: ToTreeNode

 private IBooParseTreeNode ToTreeNode(IProperty property)
 {
     return new MethodTreeNode(new EntitySourceOrigin(property), property.GetGetMethod().ReturnType.ToString(), property.DeclaringType.FullName);
 }
开发者ID:jagregory,项目名称:boolangstudio,代码行数:4,代码来源:EntityToTreeNodeConverter.cs


注:本文中的IProperty.GetGetMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。