Download presentation
Presentation is loading. Please wait.
Published byCecil August Fitzgerald Modified over 9 years ago
1
Random Logic l Forum.NET l 20061.NET reflection Forum.NET 3 rd Meeting ● February 15, 2006 By Damián Laufer
2
Random Logic l Forum.NET l 20062 Agenda What is reflection Getting metadata Object creation / use Embedded resources Performance issues Security (!) Tools
3
Random Logic l Forum.NET l 20063 What is Reflection? -A set of classes that allow you to access and manipulate assemblies and modules, and the types and the metadata that they contain.
4
Random Logic l Forum.NET l 20064 Getting metadata -Get metadata from an assembly -AssemblyName -Modules -Types (classes, interfaces, value types, enumeration types) -Members (constructors, methods, properties, fields, events) -Parameters
5
Random Logic l Forum.NET l 20065 (classes, interfaces, value types, enumeration types)
6
Random Logic l Forum.NET l 20066 Object creation -Load assemblies dynamically -Create classes -Call members -Get events
7
Random Logic l Forum.NET l 20067 Loading assemblies / types Assemblies Asm = Assembly.GetExecutingAssembly Asm = Assembly.LoadFrom(“path”) Asm = Assembly.load(“mscorlib”) Types Ty = asm.GetType(“Name”) Ty = GetType(String) Ty = anInstance.GetType Ty = Type.GetType(“System.Int32”)
8
Random Logic l Forum.NET l 20068 Embedded resources -Bitmaps -Icons -Cursors -Audio files -Video files -String tables
9
Random Logic l Forum.NET l 20069 Performance issues -Slower (muuuuuuch slower) -So, why should you use it? -Task manager -Data bound list view control -data row class loader (CRUD)
10
Random Logic l Forum.NET l 200610 Security – hang on! -Getting private metadata -Calling private methods -Changing private fields -Getting private events (*) -Creating private classes
11
Random Logic l Forum.NET l 200611 Tools -MSIL Disassembler (Ildasm.exe) (.NET Framework) -Lutz Roeder's.NET Reflector
12
Random Logic l Forum.NET l 200612 Questions?
13
Random Logic l Forum.NET l 200613 Thank You
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.