Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

AddIn-Meschanismus in C#

Empfohlene Antworten

Hallo,

in der "normalen" Windowsprogrammierung kann ich einem Programm sagen (z.B. in einer Config-Datei) es soll eine dll laden und dann kucken ob diese eine bestimmte Funktion exportiert und wenn sie das tut soll diese Funktion ausgeführt werden.

z.B. soll ein Addin seine Menupunkte ins Menü einfügen (vereinfacht)

AddIn1.dll

LoadLibrary(AddIn1.dll)

MENUADDFUNKTION func = (MENUADDFUNKTION)GetProcAddress(AddToMenu)

func(&myMenu);

Ich denke das ist doch der normale Mechanismus für AddIns

Gibt es in .NET eine Möglichkeit das so zu machen ohne auf native-dlls zuzugreifen ?

Thx for comments

Es gibt drei mögliche Wege, PlugIn’s zu realisieren.

1. Schnittstellen

2. Basisklassen

3. Attribute

Sie besitzen alle unterschiedliche Vor- und Nachteile.

(Ich persönlich bevorzuge die Schnittstellenimplementierung.)

Der Weg ist jedoch bei allen identisch: (Ich gehe davon aus, dass du mit den Grundlagen vertraut bist und lasse daher die Details weg.)

1. Laden des Assemblies in die lokale Anwendungsdomäne

System.Reflection.Assembly assembly = System.Reflection.Assembly.Load([i]PlugIn[/i]);

[i]oder[/i]

System.Reflection.Assembly assembly = System.Reflection.Assembly.LoadFrom([i]PlugIn[/i]);
(LoadWithPartialName ist aus Sicherheitsgründen nicht zu empfehlen.) 2. Holen der exportierten Typen
Type[] types = assembly.GetExportedTypes();
3. Instanziieren
System.Activator.CreateInstance(types[0], args);[/i]

That’s it...

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.