# Wednesday, July 01, 2009

Ich habe gerade Ralfs Posting gelesen. Ich stimme ihm zu (auch wenn ich den DataSet doch etwas kritischer gegenüber stehe:-)), dass Changetracking nicht zum Binden Fleck werden darf.

Den Ansatz das Tracking als seperated concern zu Implementieren habe ich erst vor kurzen gewählt – und da Ralf gefagt hat wer ‘s implementiert möchte ich hier ein paar Zeilen Code teilen. Ich verlasse mich dabei darauf, dass saubere Objekte das Interface INotifyPropertyChanging implementieren. Und nein PostSharp ist auch nicht drinne.

 

public class ChangeTracker<TEntity>
    where TEntity : INotifyPropertyChanging
{
    private Hashtable _data;
    private TEntity _entity;
    private static readonly Type _entityType = typeof(TEntity);

    public void AddEntity(TEntity entity)
    {
        if (entity.EntityState != EntityState.Detached) return;
        if (_entity != null)
        {
            _entity.PropertyChanging -= EntityPropertyChanging;
        }
        _data = new Hashtable();
        _entity = entity;
        _entity.PropertyChanging += EntityPropertyChanging;
    }

    private void EntityPropertyChanging(
        object sender,
        PropertyChangingEventArgs e)
    {
        if (_data.ContainsKey(e.PropertyName)) return;
        var propertyInfo = _entityType.GetProperty(e.PropertyName);
        if (propertyInfo == null) return;
        if (!propertyInfo.CanWrite) return;
        var value = propertyInfo.GetValue(_entity, null);
        _data.Add(e.PropertyName, value);
    }

    public void ResetEntity()
    {
        _entity.PropertyChanging -= EntityPropertyChanging;

        foreach (DictionaryEntry data in _data)
        {
            var propertyInfo = _entityType.GetProperty((string)data.Key);
            if (!propertyInfo.CanWrite) continue;
            propertyInfo.SetValue(_entity, data.Value, null);
        }
        _entity = null;
    }
    public Hashtable GetChanges()
    {
        return _data;
    }
}

Wednesday, July 01, 2009 4:00:08 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [4]  | 
Wednesday, July 01, 2009 9:52:06 AM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  | 
# Sunday, June 14, 2009

Auch in diesem Jahr veranstaltet der Just Community e.V. wieder das größte Developer und IT-Pro Community Event. Unter dem Motto „Check-In zum Wissensvorsprung“ holen wir am 28.08.2009 zahlreiche nationale und internationale Speaker nach Wuppertal. Neben den Vorträgen haben Sie natürlich auch dieses Jahr wieder viel Zeit für das Networking mit anderen ITlern aus Nah und Fern.

Alle Informationen, wie die Agenda und eine Übersicht über die Speaker gibt es unter http://www.nrwconf.de/.

nrwconf09attendeebutton

Wir freuen uns, Ihnen auch dieses Jahr sowohl bekannte Gesichter, als auch neue Speaker vorstellen zu dürfen. Die Veranstaltung wurde in diesem Jahr möglich durch unsere Sponsoren: Hewlett Packard, devcoach, Microsoft Deutschland, Brockhaus AG, Itemis AG, sepago GmbH, MT AG, sowie weiteren Unternehmen.

Eine weitere Neuerung in diesem Jahr ist der Workshop Day, der am Vortag der eigentlichen Konferenz – sprich am 27.08.2009 – in den Räumlichkeiten unseres Sponsoren Ontaris GmbH stattfindet. Der Developer-Workshop befasst sich mit der Microsoft Web Platform und behandelt die Themen Rich Internet Applications mit Silverlight 3.0 und Web 2.0 Applikationen mit ASP.NET AJAX und JQuery. Die Workshops haben eine begrenzte Teilnehmerzahl (je acht) um den Lernerfolg zu garantieren. Also schnell einchecken…

Sunday, June 14, 2009 11:07:00 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [2]  | 
# Wednesday, June 10, 2009

Der Eventsommer geht weiter… am 5. und 6. Juni fand der erste Architecture.NET Open Space 2009 in Düsseldorf statt.

image

Ein sehr interessantes Format und sehr interessante Themen. Lars, bitte im Winter 2008 gleich nochmal :-)

image

btw. Lars wird unsere Usergroup am 02.07.2009 besuchen

Event | Life | Misc
Wednesday, June 10, 2009 10:38:21 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [2]  | 

Am 5. Juni war ich als Sprecher beim “Project Springboard” zu Gast. Dennis Zielke und das Student Partner Team haben ganze Arbeit geleistet und ein Spitzen Event auf die Beine gestellt – nochmal nochmal nochmal!

image

Mein Vortrag “IIS, PHP & WCF – Web Services InterOp” hat wirklich Laune gemacht und ist laut Feedback bester Vortrag der Konferenz – DANKE, IHR WARD EINE SUPER AUDIENCE!!!

image 

Hier nun wie versprochen das Slide und der Code (PHP gehostet über FastCGI im IIS 7.0 ruft über SSL und Basic Athentication einen WCF Service mit einer Complex-SOAP-Message auf…): springbreak_IIS_PHP_und_WCF.zip

C# | Event | Projects | Security | WCF
Wednesday, June 10, 2009 9:42:19 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [1]  | 
# Tuesday, June 02, 2009

Do you know code with constructors containing each and every property?

I’ve never had a name for CoP before this post. Thanks Richard!

 

Btw.: Extension methods do the job as well without the need to know a second object ;-)

Tuesday, June 02, 2009 8:50:50 AM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [1]  | 
# Wednesday, May 20, 2009

image

On the 15th of Mai the Cologne/Bonn .NET Community invited to the Microsoft Campus in Cologne for a day full of WPF and Silverlight – the dotnet Cologne 2009. My submission to the Call for Papers was the only Talk NOT talking about User Interfaces… but was accepted – Thanks, to Roland, Albert and Stefan!

image

I was happy that my presentation was not held in room 404 ;-)

 

image

I really enjoyed the session as well as the whole event and as promised I provide what I presented for download: Silverlight as DataCache (Slide & Code)

 

Hoper to see you on one (or all) of the next events:

Wednesday, May 20, 2009 10:14:40 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [0]  | 
# Monday, April 06, 2009

image

Wie man Benutzeroberflächen für Desktops und das Web mit der Windows Presentation Foundation (WPF) erstellt, das können Sie jetzt im MSDN-Portal für Softwarehersteller (ISVs) lernen – in einer Viertelstunde. Möglich macht’s WPF Fast Start, eine WPF-Komponente, die Sie in eine Ihrer Anwendungen implementieren und testen können. Einfach herunterladen und nach dem beigefügten Tutorial vorgehen.

http://www.microsoft.com/germany/msdn/my/softwarehersteller/WPF_FastStart.mspx

Monday, April 06, 2009 5:16:35 PM (W. Europe Daylight Time, UTC+02:00)  #    Disclaimer  |  Comments [2]  | 
# Tuesday, March 03, 2009

Today I got confirmed I passed :-)

MCPD_EA(rgb)_1259

Tuesday, March 03, 2009 8:25:36 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  | 

Until then this Visual Studio macro helps to comment and uncomment in CSS files.

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics

Public Module StyleSheets

    Public Sub CommentCss()
        Dim ts As TextSelection = DTE.ActiveDocument.Selection
        Dim text As String = ts.Text.Trim(" ")

        Dim fileName = DTE.ActiveDocument.FullName

        If Not fileName.EndsWith(".css") Then
            DTE.ExecuteCommand("Edit.CommentSelection")
            Return
        End If

        If String.IsNullOrEmpty(text) Then
            Return
        End If

        ts.Text = "/*" + text + "*/"
    End Sub

    Public Sub UncommentCss()
        Dim ts As TextSelection = DTE.ActiveDocument.Selection
        Dim text As String = ts.Text.Trim(" ")

        Dim fileName = DTE.ActiveDocument.FullName

        If Not fileName.EndsWith(".css") Then
            Return
        End If

        If Not text.StartsWith("/*") And text.EndsWith("*/") Then
            Return
        End If

        ts.Text = text.Substring(2, text.Length - 4)
    End Sub

End Module

Tuesday, March 03, 2009 8:14:05 PM (W. Europe Standard Time, UTC+01:00)  #    Disclaimer  |  Comments [0]  |