示例#1
0
		public ReflectionController (ModuleDefinition module)
		{
			m_reader = new AggressiveReflectionReader (module);
			m_writer = new ReflectionWriter (module);
			m_helper = new ReflectionHelper (module);
			m_importer = new DefaultImporter (module);
		}
示例#2
0
        public SignatureReader(MetadataRoot root, ReflectionReader reflectReader)
        {
            m_root          = root;
            m_reflectReader = reflectReader;

            m_blobData = m_root.Streams.BlobHeap != null ? m_root.Streams.BlobHeap.Data : new byte [0];

            m_signatures = new Hashtable();
        }
示例#3
0
        public bool Resolve()
        {
            if (Resolved)
            {
                return(true);
            }

            ReflectionReader r     = m_ctor.DeclaringType.Module.Controller.Reader;
            CustomAttribute  newCa = r.GetCustomAttribute(m_ctor, Blob, true);

            if (!newCa.Resolved)
            {
                return(false);
            }

            newCa.CopyTo(this);
            return(true);
        }
示例#4
0
        CallSite GetCallSiteAt(int token, GenericContext context)
        {
            StandAloneSigTable sasTable = m_reflectReader.TableReader.GetStandAloneSigTable();
            MethodSig          ms       = m_reflectReader.SigReader.GetStandAloneMethodSig(
                sasTable [(int)GetRid(token) - 1].Signature);
            CallSite cs = new CallSite(ms.HasThis, ms.ExplicitThis,
                                       ms.MethCallConv, m_reflectReader.GetMethodReturnType(ms, context));

            cs.MetadataToken = new MetadataToken(token);

            for (int i = 0; i < ms.ParamCount; i++)
            {
                Param p = ms.Parameters [i];
                cs.Parameters.Add(m_reflectReader.BuildParameterDefinition(i, p, context));
            }

            ReflectionReader.CreateSentinelIfNeeded(cs, ms);

            return(cs);
        }
示例#5
0
        public MainForm()
        {
            InitializeComponent();
            this.descriptionTextBox.ScrollBars = ScrollBars.Vertical;

            foreach (Control control in this.Controls)
            {
                control.MouseEnter += control_MouseEnter;
            }

            nameSpaceFilter    = new string[] { "SoftUniHomework.Curses" };
            methodNameExcluded = new string[] { "ToString", "GetHashCode", "Equals", "GetType" };

            reader = new ReflectionReader(nameSpaceFilter, methodNameExcluded);

            this.classComboBox.Items
            .AddRange(reader.AssemblyClassesMethodsNames.Keys
                      .OrderBy(x => x)
                      .Select(x => x.Name)
                      .ToArray());
        }
 public CodeReader(ReflectionReader reflectReader)
 {
     m_reflectReader = reflectReader;
     m_root          = m_reflectReader.MetadataRoot;
 }
 public ReflectionJsonClassReader(ClassDataContract classDataContract)
 {
     Debug.Assert(classDataContract != null);
     _classContract    = classDataContract;
     _reflectionReader = new ReflectionJsonReader();
 }
示例#8
0
 public CodeReader(ReflectionReader reflectReader)
 {
     m_reflectReader = reflectReader;
     m_root          = m_reflectReader.MetadataRoot;
     m_instructions  = new Hashtable();
 }
示例#9
0
 public ReflectionCommand(ReflectionReader reader, ReflectionWriter writer)
 {
     this.reader = reader;
     this.writer = writer;
 }
示例#10
0
 public ReflectionXmlClassReader(ClassDataContract classDataContract)
 {
     Debug.Assert(classDataContract != null);
     _classContract = classDataContract;
     _reflectionReader = new ReflectionXmlReader();
 }
 public SecurityDeclarationReader(MetadataRoot root, ReflectionReader reader)
 {
     sr = new SignatureReader(root, reader);
 }
示例#12
0
 public DeepReadTests()
 {
     _reader = new ReflectionReader(new Dictionary <Type, string>(), new Dictionary <Type, Func <object, string> >(), new List <MemberInfo>(), new Dictionary <Type, Func <string, bool, object, ObjectPropertyDefinition> >(), (_, __) => false, _ => false);
 }