AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

VS.NET to Delphi.NET Codesample

Ein Thema von schwa226 · begonnen am 4. Apr 2008 · letzter Beitrag vom 4. Apr 2008
Antwort Antwort
schwa226

Registriert seit: 4. Apr 2008
400 Beiträge
 
#1

VS.NET to Delphi.NET Codesample

  Alt 4. Apr 2008, 09:41
Hi,

ich habe eine Code für VS.NET und möchte ihn für Delphi.NET (CodeGear™ Delphi® 2007 für Microsoft® .NET Version 11.0.2902.10471) verwenden. Kann mir da jemand dabei helfen dies in die richtige Form zu bekommen?
Hab mit Delphi noch nicht viel Erfahrungen und bekomme es einfach nicht hin...

Code:
Zitat:
1) Open up vs.net and click New Project
2) Choose the language of your choise and create a new Class library project and call it MyPlugin
3) Add a reference to CoreInterfaces.dll located in your lcdstudio folder.
4) Paste the following code into class1.cs (C# is used but this code is that basic it shoudn't be hard to convert to VB.Net)

Code:
Code:
using System;
using LcdStudio.CoreInterfaces;

namespace MyPlugin

   public class Plugin : AbstractDataPlugin
   { 
      public override void RegisterData(IDataService ds)
      { 
         ds.RegisterVariable(Group,"MyPlugin.HelloWorld","MyPlugin\\Hello world");
         ds.RegisterVariable(Group,"MyPlugin.TimeMsg","MyPlugin\\Time");
         this.UpdateInterval = 10000; //Update every 10000ms (10 sec)
      } 
       
      public override void UpdateData(IDataService ds)
      { 
         ds.SetValue("MyPlugin.HelloWorld","Hello world");
         ds.SetValue("MyPlugin.TimeMsg",string.Format("The time is {0} ",DateTime.Now.ToShortTimeString()));
      } 

   } 
}


5) Compile your project and copy the resulting MyPlugin.dll to your LcdStudio folder
6) Create a file in your LcdStudio folder called MyPlugin.Plugin with the following lines

Code:
Code:
 
<?xml version="1.0" encoding="utf-8" ?>
<Plugins>
   <Plugin ID="My Plugin" Type="MyPlugin.Plugin, MyPlugin" Visible="Yes" >
      <Depends ID="DataService" />
      <Depends ID="DispatchService" />
   </Plugin>
</Plugins>


7) Run LcdStudio and add your Plugin in the config panel.

Can't make it any easyer to extend LcdStudio.
Hier ist das Programm LCDStudio zu finden: http://www.lcdstudio.com/site20/home.php

Kann mir das jemand für Delphi.NET übresetzen?
  Mit Zitat antworten Zitat
Alter Mann

Registriert seit: 15. Nov 2003
Ort: Berlin
934 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#2

Re: VS.NET to Delphi.NET Codesample

  Alt 4. Apr 2008, 16:01
Erst einmal Willkommen in der DP

Eine Möglichkeit
1. Menü->Datei->Neu->Weitere->C#->Klassenbiblothek
2. Name: MyPlugin, Pfad anpassen
3. public class Class1 löschen
4. Referenz auf LcdStudio.CoreInterfaces hinzufügen (Projektfenster-Referenzen rechte Maustaste)
5. Code kopieren und einfügen
6. F5 drücken
7. Fertig

Gruß
  Mit Zitat antworten Zitat
Benutzerbild von Khabarakh
Khabarakh

Registriert seit: 18. Aug 2004
Ort: Brackenheim VS08 Pro
2.876 Beiträge
 
#3

Re: VS.NET to Delphi.NET Codesample

  Alt 4. Apr 2008, 17:15
[ein wenig OT]
Wenn du das öfter machen willst bzw. das ein größeres Projekt wird und du selbst sagst, dass du in Delphi wenig Erfahrung hast (und in Delphi.Net wahrscheinlich überhaupt keine), wäre es dann nicht klüger, direkt C# zu lernen?
[/ein wenig OT]

@Alter Mann: Ich denke einmal, er will den Code noch selbst anpassen . Man könnte höchstens die entstandene DLL in Lutz Roeders Reflector öffnen und den disassemblierten Delphi.Net-Code herauskopieren.
Sebastian
Moderator in der EE
  Mit Zitat antworten Zitat
schwa226

Registriert seit: 4. Apr 2008
400 Beiträge
 
#4

Re: VS.NET to Delphi.NET Codesample

  Alt 4. Apr 2008, 19:39
Danke für die schnellen Antworten!

Ich möchte den Code nach Delphi.NET umändern, da ich schon einen anderen Code für Delphi habe.
Ansonsten müsste ich diesen anderen Code neu schreiben...

Und zur Info: habe nicht vor vieles in .NET zu machen. Für's erste halt nur so eine Plugin DLL. Das Programm LCDStudio versteht halt nur Plugins die auf .NET basieren.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz