Esempio n. 1
0
 protected override IMethodMember InitializeOnRaiseMethod()
 {
     return(new EventMethodMember(this.MetadataEntry.OnFire, (_ICliAssembly)this.Parent.Assembly, this, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.OnFire, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.OnRaiseMethod), EventMethodType.Fire));
 }
Esempio n. 2
0
            protected override IPropertyMethodMember GetPropertyMethod(PropertyMethodType methodType)
            {
                switch (methodType)
                {
                case PropertyMethodType.GetMethod:
                    return(new MethodMember(this.MetadataEntry.GetMethod, (_ICliAssembly)this.Parent.Assembly, this.Parent, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.GetMethod, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.GetMethod), methodType));

                case PropertyMethodType.SetMethod:
                    return(new MethodMember(this.MetadataEntry.SetMethod, (_ICliAssembly)this.Parent.Assembly, this.Parent, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.SetMethod, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.SetMethod), methodType));
                }
                throw new ArgumentOutOfRangeException("methodType");
            }
Esempio n. 3
0
 protected override IMethodSignatureMember InitializeOnRemoveMethodSignature()
 {
     return new Method((CliInterfaceType)this.Parent, this.MetadataEntry.OnRemove, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.OnRemove, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.OnRemoveMethod));
 }
Esempio n. 4
0
 protected override IPropertySignatureMethodMember GetIndexerMethod(PropertyMethodType propertyMethodType)
 {
     switch (propertyMethodType)
     {
         case PropertyMethodType.GetMethod:
             return new Method((CliInterfaceType)this.Parent, this.MetadataEntry.GetMethod, propertyMethodType, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.GetMethod, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.GetMethod));
         case PropertyMethodType.SetMethod:
             return new Method((CliInterfaceType)this.Parent, this.MetadataEntry.SetMethod, propertyMethodType, CliMemberExtensions.GetMethodIdentifier(this.MetadataEntry.SetMethod, this.Parent, (_ICliManager)this.Parent.IdentityManager, () => this.SetMethod));
         default:
             throw new NotSupportedException();
     }
 }
Esempio n. 5
0
        private void CheckIdentifierAt(int memberIndex)
        {
            if (memberIndex < 0 || memberIndex >= this.Count)
            {
                throw new ArgumentOutOfRangeException("memberIndex");
            }
            if (this.memberIdentifiers[memberIndex] != null)
            {
                return;
            }
            switch (this.memberTypes[memberIndex])
            {
            case CliMemberType.BinaryOperator:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetBinaryOperatorIdentifier((ICliMetadataMethodDefinitionTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager);
                break;

            case CliMemberType.Constructor:
                var ctor = (ICliMetadataMethodDefinitionTableRow)this.memberSources[memberIndex];
                if (ctor.Name == CliCommon.ConstructorStaticName &&
                    ctor.Parameters.Count == 0)
                {
                    this.memberIdentifiers[memberIndex] = TypeSystemIdentifiers.GetCtorSignatureIdentifier();
                }
                else
                {
                    this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetCtorIdentifier(ctor, (IType)this.parent, this.parent.IdentityManager);
                }
                break;

            case CliMemberType.Event:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetEventIdentifier((ICliMetadataEventTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager);
                break;

            case CliMemberType.Field:
                this.memberIdentifiers[memberIndex] = (IGeneralMemberUniqueIdentifier)CliMemberExtensions.GetFieldIdentifier((ICliMetadataFieldTableRow)this.memberSources[memberIndex]);
                break;

            case CliMemberType.Indexer:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetIndexerIdentifier((ICliMetadataPropertyTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager);
                break;

            case CliMemberType.Method:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetMethodIdentifier((ICliMetadataMethodDefinitionTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager, () => (IMethodSignatureMember)this.Values[memberIndex].Entry);
                break;

            case CliMemberType.Property:
                this.memberIdentifiers[memberIndex] = (IGeneralMemberUniqueIdentifier)CliMemberExtensions.GetPropertyIdentifier((ICliMetadataPropertyTableRow)this.memberSources[memberIndex]);
                break;

            case CliMemberType.TypeCoercionOperator:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetTypeCoercionOperatorIdentifier((ICliMetadataMethodDefinitionTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager);
                break;

            case CliMemberType.UnaryOperator:
                this.memberIdentifiers[memberIndex] = CliMemberExtensions.GetUnaryOperatorIdentifier((ICliMetadataMethodDefinitionTableRow)this.memberSources[memberIndex], (IType)this.parent, this.parent.IdentityManager);
                break;

            default:
                throw new InvalidOperationException("Member of invalid kind.");
            }
        }