コード例 #1
0
        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);
        }
コード例 #2
0
 public virtual void onMetadataElement(ISpecializedPropertyDefinition specializedPropertyDefinition) { }
コード例 #3
0
ファイル: Validator.cs プロジェクト: rasiths/visual-profiler
 /// <summary>
 /// Performs some computation with the given specialized propperty definition.
 /// </summary>
 public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
     this.Visit((IPropertyDefinition)specializedPropertyDefinition);
 }
コード例 #4
0
ファイル: Visitors.cs プロジェクト: rasiths/visual-profiler
 public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
     //we are traversing a generic type instance.
     this.traverser.Traverse((IPropertyDefinition)specializedPropertyDefinition);
 }
コード例 #5
0
ファイル: Visitors.cs プロジェクト: rasiths/visual-profiler
 /// <summary>
 /// Performs some computation with the given specialized propperty definition.
 /// </summary>
 public virtual void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
 }
コード例 #6
0
ファイル: Visitors.cs プロジェクト: Refresh06/visualmutator
 public void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public virtual void onMetadataElement(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
 }
コード例 #8
0
 /// <summary>
 /// Performs some computation with the given specialized propperty definition.
 /// </summary>
 public virtual void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
 }
コード例 #9
0
        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);
        }
コード例 #10
0
 public override void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
     allElements.Add(new InvokInfo(Traverser, "ISpecializedPropertyDefinition", specializedPropertyDefinition));
 }
コード例 #11
0
 public override void Visit(ISpecializedPropertyDefinition specializedPropertyDefinition)
 {
     if(Process(specializedPropertyDefinition)){visitor.Visit(specializedPropertyDefinition);}
     base.Visit(specializedPropertyDefinition);
 }