- iPhone topik
- Apple iPhone Air - almacsutka
- One mobilszolgáltatások
- Google Pixel 10 Pro XL – tíz kicsi Pixel
- Két nap múlva itt a Xiaomi 17, van egy pár hivatalos fotó is róla
- Azonnali mobilos kérdések órája
- Hetekig bírják töltő nélkül a Huawei sportórái
- IFA 2025: Meglepetések helyett Galaxy S25 FE
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Xiaomi 15 - kicsi telefon nagy energiával
Új hozzászólás Aktív témák
-
ArchElf
addikt
Egy példa a lentire(kicsit meg lett vágva). Az példa egy dinamikusan betölthető adatszolgáltató interfésze + betöltő osztálya. Természetesen az adatszolgáltatókat külön meg kell(ett) írni hozzá
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace MonitorUser.Connector
{
public static class ConnectorLoader
{
/// <summary>
/// Collection of all loaded IConnector objects
/// </summary>
public static List<IConnector> Connectors = new List<IConnector>();
/// <summary>
/// Initialize a new IConnector instance and start it
/// </summary>
/// <param name="location">IConnector dll location</param>
/// <param name="name">IConnector full class name</param>
/// <param name="connectionString">Connection string for starting the connector</param>
/// <param name="initData">Additional initialization data</param>
/// <returns>Initialized and started IConnector instance</returns>
public static IConnector Load(string location, string name, string connectionString, ConnectorInitData initData)
{
try
{
IConnector ic = null;
Assembly asm = Assembly.LoadFrom(location);
Type tp = asm.GetType(name);
object p = Activator.CreateInstance(tp);
ic = (IConnector)p;
ic.Connect(connectionString, initData);
Connectors.Add(ic);
return ic;
}
catch
{
throw;
}
}
}
public interface IConnector
{
event EventHandler NewItem;
bool Connect(string connectionString, ConnectorInitData initData);
bool Disconnect();
bool Check();
bool Check(params string[] indexer);
ConnectorData GetNextItem();
bool SetItem(ConnectorData item);
bool SetItem(string referrer);
}
public struct ConnectorInitData
{
public long Position;
public DateTime StartTime;
public string QueryString;
public ConnectorInitData(long Position, DateTime StartTime, string QueryString)
{
this.Position = Position;
this.StartTime = StartTime;
this.QueryString = QueryString;
}
}
public struct ConnectorData
{
public long Identifier;
public List<string> Headers;
public List<Type> Types;
public List<object> Values;
public ConnectorData(long id, List<string> headers, List<Type> types, List<object> values)
{
this.Identifier = id;
this.Headers = headers;
this.Types = types;
this.Values = values;
}
}
}
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- A Temu diktál Magyarországon, a hazai e-kereskedők fulladoznak
- Okos Otthon / Smart Home
- iPhone topik
- Külső merevlemezek - USB, eSATA, FireWire HDD
- Apple iPhone Air - almacsutka
- Bambu Lab 3D nyomtatók
- gban: Ingyen kellene, de tegnapra
- Horgász topik
- One mobilszolgáltatások
- Luck Dragon: Asszociációs játék. :)
- További aktív témák...
- Cooler Master MK110 mechanikus RGB gamer billentyűzet
- Ryzen 5 3600 / 16GB DDR4 / 5600XT / NWMe SSD!
- Apple iPhone 15 Pro Max 256GB, Kártyafüggetlen, 1 Év Garanciával
- Samsung galaxy watch 5 LTE 44mm 1év bolti garanciával!
- Mars Gaming MKMINI W RGB CHROMA Mechanikus Gamer Billentyűzet OUTEMU PRO brown switchekkel
- GYÖNYÖRŰ iPhone 13 Pro 256GB Graphite -1 ÉV GARANCIA - Kártyafüggetlen, MS3074, 100% Akkumulátor
- GYÖNYÖRŰ iPhone 12 Pro 128GB Pacific Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS2919
- iKing.Hu - Apple iPhone 15 Pro Max Natural Titanium Titán dizájn, 5 optikai zoom 256 GB- Gari
- HIBÁTLAN iPhone 12 Pro Max 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS3109
- KERESEK: Poly Voyager 4320 M UC USB-C 218478-02M Part number: 77Z30AA
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest