Generic Constraints thougths

There are 3 types of constraints.


A derivation constraint indicates to the compiler that the generic type parameter derives from a base type such an interface or a particular base class.

class LinkedList where K : IComparable

A default constructor constraint indicates to the compiler that the generic type parameter exposes a default public constructor (a public constructor with no parameters).

class Node where T : new()

A reference/value type constraint constrains the generic type parameter to be a reference or a value type.

class MyClass where T : struct class MyClass where T : class


 

xml namespaces Seltsamheiten (german post)

Namespaces dienen der Eindeutigkeit von Elementen und Attributen.
Namespaces sind beliebige Strings Namespaces bauen normalerweise auf URLs auf --> Eindeutigkeit

Namespace Präfix dient zur Abkürzung (des Unique Identifiers)


Deklaration von einem Namespace beinhaltet Nennung einer Namespace URI sowie der Vergabe eines Präfixes (=Stellvertreter)

Namespaces werden in Elementen deklariert Namespaces werden auf Element und Unterelement angewandt Unterelemente können jedoch Namespace überschreiben

<prefix:myElement xmlns:prefix="http://www.gfader.com>
Kombination aus Namespace und Name (Attribut oder Element) = Qualified Name

StandardNamespace

<myElement xmlns="http://www.gfader.com">

leerer Namespace = unqualified Elements or Attributes
Wird kein Namespace deklariert so gilt xmlns=""
unqualified da sie nur lokalen Name und keinen Namespace haben


Standard-Namespace sollte nicht verwendet werden da :

  • Element OHNE Präfix im Standard-Namespace
  • Attribut OHNE Präfix im leeren Namespace
Beispiel:

<prefix:myElement xmlns:prefix="gfader.com" myAttribute="value">
myElement in StandardNamespace "gfader.com" myAttribute in leerem Namespace ""
Damit auch myAttribute im selben Namespace ist:

<prefix:myElement xmlns:prefix="gfader.com" prefix:myAttribute="value">

Zusammenfassung aus Uni Vorlesung von Clemens Kerer
und
dotnet Magazin Artikel von Martin Szugat
Ausgabe 1/2.08 dot.net magazin - Aus dem Nähkästchen

Microsoft.mshtml .dll problems... und the solution!!

i developed a winforms application that shows and edits html data.
(for details see older posts)

the control that i use, uses the mshtml library from the Microsoft.mshtml.dll found in the Application Folder of vs2008

"c:\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office11\Microsoft.mshtml.dll"
but this dll is ARRGGGH!
following problems:

gacutil /u
uninstall doesnt work on my local machine

gacutil /i
install doesnt work on terminal server without vs2008

cause its delay signed, only public key!

i think that the assembly is installed by MSI Windows Installer
and this adds some info to the registry

http://support.microsoft.com/kb/873195/en-us


SOLUTION
1. Download: Primary Interop Assemblies for Office 2003 from msdn
2. then installed the PIA 2003 msi from the packed exe
3. used this dll
4. deploy this dll
everything is fine!


details
verification of the dlls

\Program Files\Microsoft Visual Studio 9.0\Visual Studio Tools for Office\PIA\Office12>
sn -v Microsoft.mshtml.dll--> Microsoft.mshtml.dll is a delay-signed or test-signed assembly


dll from vs2008 PIA folder
sn -v Microsoft.mshtml.dll
Microsoft (R) .NET Framework Strong Name Utility Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
--> Assembly 'Microsoft.mshtml.dll' is valid

How to get javasrcipt returnValue from webbrowser control (tinymce htmlcode fron webbrowser)

In my previous post about the htmlcontrol i have not explained how i communicate with the tinymce javascript to get the actual values from the textarea.

Here is it how it works...


string valueFromTinyMce;
IHTMLDocument2 htdoc2 = editor2.HTMLDocument2; IHTMLWindow2 parentWindow = htdoc2.parentWindow; if (parentWindow != null) { IHTMLElement el = htdoc2.createElement("input"); el.id = "myValue"; ((IHTMLDOMNode)htdoc2.body).appendChild((IHTMLDOMNode)el); parentWindow.execScript("document.all['myValue'].value = tinyMCE.getContent('mce_editor_0')", "javascript"); valueFromTinyMce = el.getAttribute("value", 0); }

GREAT Windows Forms Html Control

I finally found a working HTMLControl to show and Edit HTML Content for Windows Forms Applications.
It uses internally a webeditor Control, and works great.
I did not verify memory usage :-)

http://www.codeproject.com/cs/miscctrl/editor_in_windows_forms.asp

Maybe this link will work!
http://www.codeproject.com/KB/edit/editor_in_windows_forms.aspx


I have modified it to work with tinyMce.
Normally it is in NON Enabled Mode.
If it goes into Editmode (DesignModeEnabled=true) then it shows the tinymce

http://tinymce.moxiecode.com/

If someone is interested in my code let me know...


EDIT
i have made some screenshots.

And here i explain how you can communicate with the hosted webeditor, resp. tinymce



SOURCE CODE HERE
http://blog.gfader.com/2010/01/winforms-html-editor-control-source.html

Latest Posts

Popular Posts