Einzelnen Beitrag anzeigen

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