DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

Stories recently tagged with 'Reflection' Subscribe to this feed
3
kicks
submitted by rprouse rprouse 10 days ago

alteridem.net — One thing that I find tiresome when using the various Model/View patterns is the constant copying of data between the model and the view. This is the first post in a series on a possible easier way to do this. In this post I write a method that copies the data from one interface to another based on the names and types of the properties. Over the next few posts, I will extend the code to use generics and extension methods. read more...

Add a comment add a comment | category: | Views: 13
tags: , , , , | tag it

1
kicks
submitted by crpietschmann crpietschmann 1 month, 26 days ago

blogs.msdn.com — Previously, I mentioned some things in Metadata that aren't exposed in Reflection. Here's an opposite case. While metadata represents static bits on disk, Reflection operates in a live process with access to the CLR's loader. So reflection can represent things the CLR loader and type system may do that aren't captured in the metadata. read more...

Add a comment add a comment | category: | Views: 3
tags: , , | tag it

8
kicks
published 3 months, 1 day ago, submitted by yoavsion yoavsion 3 months, 3 days ago

sharpregion.com — Sometimes we need to find all classes or interfaces that derive a certain Type. There are several possible scenarios for this kind of search - For instance, if we are trying to load a plug-in assembly at runtime and wish to initialize all the classes that implement the IPluginBase interface. Using the suggested DerivedHelper makes it a lot easier. read more...

Add a comment add a comment | category: | Views: 3
tags: , , , , | tag it

4
kicks
submitted by w3stfa11 w3stfa11 3 months, 29 days ago

codebetter.com — Patrick wrote a great post comparing Mono's Cecil against the built-in System.Reflection. read more...

Add a comment add a comment | category: | Views: 2
tags: , , | tag it

2
kicks
submitted by crpietschmann crpietschmann 4 months, 20 days ago

pietschsoft.com — I was thinking about how JavaScript JSON serializers go about serializing objects. But how does the serializer know about each of the objects properties? I figured JavaScript must have some method of object reflection (similar to .NET Reflection) and it does. Here's a simple Reflection namespace that allows you to more easily reflect through an objects methods and properties: read more...

Add a comment add a comment | category: | Views: 1
tags: , , | tag it

4
kicks
submitted by animaonline animaonline 5 months, 5 days ago

softscenario.blogspot.com — Some weeks ago I was working on a project where we receive some ten or twenty different message types from a server, and they all need to be handled when they arrive. Of course, we want to use event driven programming to make this happen on the fly, instead of polling all the time. All of the messages have the header in common, so we already made a abstract parent class called Message, and when it came to handling all the different messages, we wanted to write as little code as possible. So we added an abstract method called HandleResponse to the code. So the idea was to identify the incoming message type and invoke the HandleResponse using reflection on the object that we had identified this as. To do this, we made a little xml file that contains the message code (A-Z) along with the name and reference to the class linked to the message type. When the program starts, it reads the xml into a dictionary, so we can look up the key (message code) and get the class reference in return. XDocument descriptorsXml = XDocument.Load( @".\Data\MessageDescriptors.xml"); var descQuery = from desc in descriptorsXml.Descendants("Message") select new MessageDescriptor { Code = desc.Element("Code").Value, Name = desc.Element("Name").Value, ObjectType = desc.Element("ObjectType").Value.ToType() , IsServerMessage = Convert.ToBoolean( desc.Element("IsServerMessage").Value ) }; foreach (MessageDescriptor m in descQuery) { descriptors.Add(m.Code, m); } Then, we have a MessageHandlingFactory that simply gets objects in from a queue, identifies the type, and invokes the HandleResponse. If the object isn't recognized (could be a new message type, or could be that the programmer forgot to insert the description in the XML file), the MessageHandlingFactory can either throw an exception, or better yet, return a string with message that tells the user what went wrong. If everything goes as planned, it returns a string with the identified typename. object theType = Activator.CreateInstance(t, SessionID); EventInfo eInfo = t.GetEvent("OnWriteEvent"); Message.WriteEventHandler theHandler = new Message.WriteEventHandler(OnWriteEventHandler); eInfo.AddEventHandler(theType, theHandler); theType.GetType().GetMethod("HandleResponse").Invoke(theType, new object[] { message }); return "MessageHandler: " + messageType; That's all, folks! Update February 13, 2008: The code has now been tested in a very high throughput environment, and it performs read more...

Add a comment add a comment | category: | Views: 1
tags: , , , , | tag it

2
kicks
submitted by spapaseit 8 months, 25 days ago

sharpedgesoftware.com — How To build a lightweight, flexible logging component in C# read more...

Add a comment add a comment | category: | Views: 11
tags: , , , | tag it

24
kicks
published 10 months, 13 days ago, submitted by jamesewelch jamesewelch 10 months, 18 days ago

jamesewelch.wordpress.com — Explains how to tell if a .NET Assembly is built for debug or release by using .NET Reflector and programmatically using System.Reflection. read more...

Add a comment add a comment | category: | Views: 5
tags: , , , , | tag it

18
kicks
published 11 months, 12 days ago, submitted by activa activa 11 months, 13 days ago

blog.activa.be — The web framework I built over the last few years, ProMesh.NET, relies on reflection for a lot of the features it offers. Often though, I am asked if the heave use of reflection doesn’t have a significant impact on performance. My answer usually is: YES, but it doesn’t matter. Now you probably think that I don’t care about performance or that I’ve had too much too drink. None of the above. I’ll explain: read more...

Add a comment add a comment | category: | Views: 0
tags: , | tag it

22
kicks
published 1 year ago, submitted by andyc 1 year ago

geekzilla.co.uk — Glass like image reflection on the fly with javascript read more...

Add a comment add a comment | category: | Views: 12
tags: , , | tag it

11
kicks
published 1 year, 1 month ago, submitted by spirit1 1 year, 1 month ago

weblogs.sqlteam.com — Arity is the number of arguments that a method takes. If you ever used reflection and CodeDOM, this is a good thing to know of. read more...

Add a comment 1 comment | category: | Views: 0
tags: , , , | tag it

1
kicks
submitted by adventurer 1 year, 1 month ago

dotnetproject.blogspot.com — A FieldInfo class provides detailed information about a single field of a class or an interface. read more...

Add a comment add a comment | category: | Views: 0
tags: , , | tag it

14
kicks
published 1 year, 2 months ago, submitted by jiltedcitizen 1 year, 2 months ago

codeproject.com — This article is about using reflection. For those of you that don't know what reflection is, it is the ability to obtain information about a Type of object without really knowing anything about the object type that is being dealt with. For example one could simply ask the current Type of object if it supports a certain method name, if it does, the method can be called. This may sound strange but it is a very powerful technique. Lets suppose that I simply want to look at what methods a class supports, well that is also easily achieved using reflection. .NET allows developers to leverage reflection in many ways. read more...

Add a comment add a comment | category: | Views: 0
tags: , | tag it

2
kicks
submitted by jlockwood 1 year, 3 months ago

lostechies.com — A description of the reflection-like behavior of JavaScript read more...

Add a comment add a comment | category: | Views: 1
tags: , , , , | tag it

2
kicks
submitted by jlockwood 1 year, 3 months ago

lostechies.com — A description of the reflection-like behavior of JavaScript read more...

Add a comment add a comment | category: | Views: 1
tags: , , , , | tag it

11
kicks
published 1 year, 3 months ago, submitted by Aaronls79 1 year, 3 months ago

thesprage.com — Using the Strategy Pattern and Reflection I easily created a Pluggable application. read more...

Add a comment add a comment | category: | Views: 9
tags: , , , , | tag it

 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge