Ex nihilo nihil fit

Victor’s Blog

  • Home
  • Projects
  • Photos
  • Books
  • Brasov Hotspots
  • About

6

Jul

Binding in WinForms like in WPF Part 1

Posted by Victor  Published in .NET Framework, Tutorial.Intermediate

If you have ever used Windows Presentation Foundation (WPF) then you might have been impressed by the binding features of it.

Part one of this tutorial will show how to bind properties of the same type while the second one will also anlyse type conversion.

Using data binding you can synchronize object properties. The source of the binding is the object or property that is changing the value and the destination is the one who receives it (the new value).

There are two types of binding:

  • one way binding - there is only one source that updates the information and as many destinations who receive the update.
  • two way binding - every binding element can update and can receive updates so there is no distinction between source and destination.


continue reading "Binding in WinForms like in WPF Part 1"

Technorati Tags: C#, Data Binding, Visual Studio

Tags: C#, Data Binding, Visual Studio

no comment

28

Apr

How expensive are cross-domain operations?

Posted by Victor  Published in .NET Framework, Microsoft, Tutorial.Intermediate

I was curios how expensive is a cross domain operation so I have made a test.

The test procedure is simple. Perform a number of cross-domain and non cross-domain operations (get the value of NextNumber() from same domain and from another domain) and measure the time elapsed. For each value I have runned the application 3 times, recorded the time (in milliseconds) and created the mean of this three.

For this I’ve created a Console Application containing two classes, the main class and “NumberClass” which has a method that returns the next long. The code for this two is below:

NumberClass:

//MarshalByRefObject is used because this object will cross domain boundary
class NumberClass:MarshalByRefObject
{
    public ulong number = 0;

    public ulong NextNumber()
    {
        return number++;
    }
}

The Main method from the main class:


continue reading "How expensive are cross-domain operations?"

Technorati Tags: .NET Framework, AppDomain, Cross domain, Microsoft, Programming, Visual Studio

Tags: .NET Framework, AppDomain, Cross domain, Microsoft, Programming, Visual Studio

no comment

16

Apr

EventInfo.AddEventHandler - bug or not?

Posted by Victor  Published in .NET Framework, Microsoft, Tutorial.Intermediate

Reflection is the process by which a computer program can observe and modify its own structure and behavior. The programming paradigm driven by reflection is called reflective programming. [Wikipedia]

Working a few days ago on a plugin architecture on .NET Framework I’ve found something very interesting. The method System.Reflection.EventInfo.AddEventHandler does late-binding. You’ll probably say “so what?”. Let’s see the problem with an example:

Using Visual Studio 2005/2008, create two C# projects (a windows forms application project and a class library one). Rename the class from the class library project to “TestClass.cs”.


continue reading "EventInfo.AddEventHandler - bug or not?"

Technorati Tags: .NET Framework, Bug, EventInfo.AddEventHandler, Microsoft, Programming, Visual Studio

Tags: .NET Framework, Bug, EventInfo.AddEventHandler, Microsoft, Programming, Visual Studio

1 comment

Recent Posts

  • Vista Experience Index Fail
  • No more Y! Messenger for Vista
  • Machine Learning (Stanford) 2
  • Machine Learning (Stanford) 1
  • C++ := Delphi
  • SkypeGadget 2 A1 is available
  • IPhone Evolution
  • ATM Interface [Bad Practice]
  • Microsoft Live Mesh (Tech Preview) Review
  • Professor or student?

Categories

.NET Framework Best practices Blog news Debugging Funny Imagine Cup Linux Machine Learning Microsoft MSDN News Poll Projects Review Tutorial.Expert Tutorial.Intermediate

Archives

Recent Comments

  • Timotei on Vista Experience Index Fail
  • Barry on SkypeGadget
  • oviradoi on Vista Experience Index Fail
  • Giuseppe on How to install SQL Server 2008 in almost 4 hours
  • jimmy89 on SkypeGadget

Blogroll

  • Ad hinc ad infinitum ad libitum
  • Alex Brie . net
  • Bear with me
  • dEsign.101
  • Easy Windows Tutorials
  • IT Gang
  • naegleria’s blog
  • Silviu’s blog

Links

  • Free Web Arcade
  • Imagine Cup
  • The Architecture Journal
Add to Technorati Favorites
XHTML Valid. Theme designed by Roam2Rome
© 2008 Ex nihilo nihil fit. All rights reserved.