Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

Search the Tips
Tip Bank > Java > Classes

Classes - Page 4

61-80 of 410     Previous     Next
Dynamically setting an event handler for a class' event via reflection
by Francesco Balena
Here it is some code that shows how to use reflection to dynamically set an event handler for a class' event. Sub TestSub() ' create a Person Dim pe As New Person() ' get a reference to the EventInfo for this object Dim peEv As EventInfo = pe.GetType.
CloneObject - cloning an object by serializing it to a memory stream
by Francesco Balena
A reusable function that does object cloning by serializing it to a memory stream
LoadSoapData - deserializing an object from a file in SOAP format
by Francesco Balena
Deserialize an object from a file in SOAP format.
SaveSoapData - serializing an object to file in SOAP format
by Francesco Balena
Serialize an object to file in SOAP format.
A command-line Object Browser that uses Reflection
by Francesco Balena
This code is taken from Francesco Balena's "Programming Microsoft Visual Basic .NET" - MS Press 2002, ISBN 0735613753 You can read a free chapter of the book at http://www.vb2themax.com/HtmlDoc.asp?Table=Books&ID=101000
FilterByName - filtering by name the results of Type.FindMembers
by Francesco Balena
This filtering function returns True if the member name begins with the character passed as its second argument. Note: it requires Imports System.Reflection
FilterByType - filtering the results of Type.FindMembers by thier return type
by Francesco Balena
Accept only properties and methods whose return value matches the Type passed as the second argument. Note: it requires Imports System.Reflection
Set up event handlers through reflection
by Francesco Balena
Reflection makes it easy to invoke a method (or assign a field or a property) by its name. For example, suppose you have the following classes: Class Person Event PropertyChanged(ByVal propertyName As String, ByVal newValue As Object) Dim m_Name As String Property ...
by Brian Ray
You can use the technique for an "undo" menu/toolbar option. Use a collection instead of a listbox to reduce overhead. Support for both LIFO and FIFO is also included: ...
Send Mail Using a VC++ Application
by Amit Vij
Import the complete path of the following files in your application using the #import ...
Implementing IClonable - Shallow copies
by Francesco Balena
An object that want to support cloning should implement the ICloneable interface. This interface exposes only one method, Clone, which returns a copy of the object. The ICloneable specifics don't specify whether the object that the Clone method returns is a shallow copy or a deep copy.
Implementing ICloneable - Deep copies
by Francesco Balena
The simplest way to create a generic deep copy routine, that is a procedure that can create a true, distinct copy of an object and all its dependent object, is to rely on the serialization features of the .NET framework. Function CloneObject(ByVal obj As Object) As Object ...
How to Re-open a Nested Namespace
by Danny Kalev
As strange as it may seem, C++ doesn't allow you to re-open a namespace using a qualified name; you can re-open it only by using its nested name. For example, the following program defines a ...
Obtain a Regional Decimal Character without an API
by Gianfranco Callino
Use this function to read a number decimal symbol from regional ...
Iterate Control Arrays Without Error
by Guy Dafny
Control arrays are odd beasts in that they can have missing elements. The simplest way to iterate a control array uses this ...
Setting the Description of an Add-In
by Francesco Balena
When you use the Add-Ins project template to build your own add-ins, the description of the add-in appearing in the Add-Ins Manager window is always "My Addin." It isn't immediately clear how you can ...
<fstream> Open Modes
by Danny Kalev
The library defines the following open modes and file ...
CStack - a class module for implementing Last-In-First-Out (stack) structures
by Francesco Balena
-------------------------------------------------- The CSTACK class Usage: Dim st As New CStack push two values on the stack st.Push 1234 st.Push 4567 display number of elements in the stack Debug.Print "Count = " & st.Count peek at the element on top of stack Debug.Print "Peek = " & st.
HashTable - a class module for storing (key,value) pairs
by Francesco Balena
---------------------------------------------- HASHTABLE class module This class implements a hashtable, a structure that offers many of the features of a collectior or dictionary, and is often even faster than the built-in collection. NOTE: must make Item the default member, using the ...
LinkedList - a class module to store list of values
by Francesco Balena
------------------------------------------------- LINKED LIST class module This class implements a linked list structure, where you can store values (appending them after the last element or inserting them at given indexes), remove them, and visit them using recordset-like methods such as ...
61-80 of 410     Previous     Next
Thanks for your registration, follow us on our social networks to keep up-to-date