Note: this article will mention a free tool “Enar Spy” for Enterprise Architect. Get more information here: https://blog.lieberlieber.com/2011/09/22/enar-spy-update/


  • What are attributes?

In .NET attributes are used to combine code with declarations. e.g. is the class serializable, or is the property readonly.
Get more information here: codeproject

  • My Scenario:

In the internet you can find a couple of blogposts, dealing with setting attributes at runtime . I needed this to build a read-only property Grid, without modifying all the objects, I want to display.

Most information of this article is based on: dotnetfacts

In a short summary: the read-only attributes are set on all public properties except collections.  This is to keep the CollectionEditor button alive, which is disabled when setting readonly= true on collections too.

  • What I did:

You cannot create property-based attributes during runtime, but the readonly attribute exists for each property of your class by default. Even, if you do not add the Line “[ReadOnly(false)]“.
This is, why the following code-snippet works. It sets the readonly-attribute on each public property except collections.
change attributes at runtime

  • My Problem:

When assigning the class to the Property-Grid, all properties are displayed readonly. And next to collections you still have the button to investigate them.
But when opening the CollectionsEditor you might discover the following:

Although class “Connector” contains more properties than just a ToString-Method, it is treated like a string object.
For a tool like “Enar Spy” this is totally worthless, as you cannot investigate any collections.

  • Solution:

By accident, I found an article mentioning my problem in a single sentence:
“Add the readonly-attribute to your class’ properties declaration (= in source code). Because if you don’t, .NET will mix it up and do some crazy stuff.”
(Shame on me, I do not remember, where I found that hint!)

That’s why I ended up adding the line “[ReadOnly(false)]” to each property of each class I use in Enar Spy.

And guess what?
The propertyGrid’s collection editor now works like a charm:

This issue definitely needs some more investigation.

Does anybody have more information about this topic?

I appreciate each comment to this topic!

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Click-once was not designed for registering com-components. These things are part of the work Windows Installer is meant for.
To use ActiveX in click-once applications too, remember these words: “Reg-Free COM“.

Here’s a short summary of what to do in a .NET project:

  • register the ActiveX Control on the developer’s machine.
  • add the control to a form
  • visual studio will add a reference to it.
    in solution explorer navigate there, and set it’s properties to “isolated” and “copy local”.
  • compile the project. VS will create a manifest to allow the usage of the activeX without registering it.
  • copy the activeX control to your output folder
  • Test it by compiling your app, unregister the control, and start your app.
    Lucky you, it will operate as desired.

Requirements: Windows XP and above, Visual Studio 2005 and above.

Note: Not every component is meant for Reg-Free COM, but in most cases it works.
And: it must be registered on the computer, the app is compiled on.

Get more information here (msdn magazin).

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Just found the Silvermoon project on Codeplex after Frank pointed me there in Facebook. AWESOME!!!  I always like fancy Controls that I don’t have to handcraft like in the GDI+ Article.

 Capture3.jpg Explorer1.jpg Explorer3.jpg Explorer4.jpg Explorer5.jpg Explorer6.jpg

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Auf Peter Foots Blog habe ich eine Lösung gefunden wie das Tabcontrol auch den coolen neuen Look von Windows Mobile 6.5 bekommt! Details: Windows Mobile 6.5 Tab Control

Nichtsdestotrotz bin ich der Meinung das TabControl’s und GridControl’s mobile Anwendungen unbenutzbar machen – d.h man sollte Sie nur in besonderen Fällen benutzen.

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

Peter hat mir diese Woche eine gute Idee für ein neues Freewareprogramm geliefert.
Er wollte sein Handy komplett lautlos schalten und nur der Wecker sollte in der Früh läuten.

Gleich hab ich mich darn gesetzt und Komponenten geschrieben, mit Notification Klassen gespielt, SystemState durchgeackert,…. bis 02:00 (weils ja auch spaß macht wenn man mal so richtig drinn hängt). Natürlich war der Schock groß als ich am nächsten Tag folgendes auf meinem HTC Diamond (WM 6.1) gefunden habe.

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg

NEW VERSION HERE!!

Um den G-Sensor richtig benutzen bzw. testen zu können, muss man wissen wie genau die x, y und z Achsen Ausschlagen. Hierfür habe ich folgendes kleines Testprogramm geschrieben.

Viel spass damit.
(Es gibt die Möglichkeit zwischen Linien-, Flusslinien- und Balkendiagramm zu wählen).

To use the G-Sensor the right way or test your application, you need to know how exactly the x, y and z axes are reacting. For this purpose I designed the following test program.

Have fun.
(You can choose between lines, flowlines and bar charts).

ShockTester

Share and Enjoy:
  • Technorati
  • Digg
  • Facebook
  • del.icio.us
  • Live
  • Google Bookmarks
  • DotNetKicks
  • DZone
  • TwitThis
  • Blogosphere News
  • Blogplay
  • LinkedIn
  • MisterWong
  • MisterWong.DE
  • MSN Reporter
  • MyShare
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Tumblr
  • Twitter
  • Webnews.de
  • Yahoo! Bookmarks
  • Yigg