public static T UnWrapMember <T>(this T member) where T : ITypeMemberReference { IGenericMethodInstanceReference genericMethod = member as IGenericMethodInstanceReference; if (genericMethod != null) { return((T)genericMethod.GenericMethod.UnWrapMember()); } ISpecializedNestedTypeReference type = member as ISpecializedNestedTypeReference; if (type != null) { return((T)type.UnspecializedVersion.UnWrapMember()); } ISpecializedMethodReference method = member as ISpecializedMethodReference; if (method != null) { return((T)method.UnspecializedVersion.UnWrapMember()); } ISpecializedFieldReference field = member as ISpecializedFieldReference; if (field != null) { return((T)field.UnspecializedVersion.UnWrapMember()); } ISpecializedPropertyDefinition property = member as ISpecializedPropertyDefinition; if (property != null) { return((T)property.UnspecializedVersion.UnWrapMember()); } ISpecializedEventDefinition evnt = member as ISpecializedEventDefinition; if (evnt != null) { return((T)evnt.UnspecializedVersion.UnWrapMember()); } return(member); }
public virtual void onMetadataElement(ISpecializedPropertyDefinition specializedPropertyDefinition) { }
/// <summary> /// Performs some computation with the given specialized propperty definition. /// </summary> public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { this.Visit((IPropertyDefinition)specializedPropertyDefinition); }
public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { //we are traversing a generic type instance. this.traverser.Traverse((IPropertyDefinition)specializedPropertyDefinition); }
/// <summary> /// Performs some computation with the given specialized propperty definition. /// </summary> public virtual void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { }
public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { throw new NotImplementedException(); }
public static ITypeMemberReference CanonicalizeMemberReference(ITypeMemberReference member) { if (null == member) { return(null); } if (member == null || member == Dummy.Method) { throw new Exception("Can't resolve member"); } // function pointers don't have declaring types and they don't // really fit our model, so we ignore them. if (null == member.ContainingType) { return(null); } // // first canonicalize the method... // IGenericMethodInstanceReference genMeth = member as IGenericMethodInstanceReference; if ((genMeth != null)) { member = genMeth.GenericMethod; } ISpecializedMethodReference specializedMethodRef = member as ISpecializedMethodReference; ISpecializedFieldReference specializedFieldRef = member as ISpecializedFieldReference; ISpecializedPropertyDefinition specializedPropertyDef = member as ISpecializedPropertyDefinition; ISpecializedEventDefinition specializedEventDef = member as ISpecializedEventDefinition; ISpecializedMethodDefinition specializedMethodDef = member as ISpecializedMethodDefinition; ISpecializedFieldDefinition specializedFieldDef = member as ISpecializedFieldDefinition; if (specializedMethodRef != null) { member = specializedMethodRef.UnspecializedVersion; } else if (specializedFieldRef != null) { member = specializedFieldRef.UnspecializedVersion; } else if (specializedPropertyDef != null) { member = specializedPropertyDef.UnspecializedVersion; } else if (specializedEventDef != null) { member = specializedEventDef.UnspecializedVersion; } else if (specializedMethodDef != null) { member = specializedMethodDef.UnspecializedVersion; } else if (specializedFieldDef != null) { member = specializedFieldDef.UnspecializedVersion; } if (member == null) { throw new Exception("Can't canonicalize some member."); } return(member); }
public override void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { allElements.Add(new InvokInfo(Traverser, "ISpecializedPropertyDefinition", specializedPropertyDefinition)); }
public override void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition) { if(Process(specializedPropertyDefinition)){visitor.Visit(specializedPropertyDefinition);} base.Visit(specializedPropertyDefinition); }