Fb EventHandler - c#

I have written a windows service in Visual Studio that uses the FirebirdSql.Data.FirebirdClient ADO.NET provider. My code is:
FbRemoteEvent revent = new FbRemoteEvent(fb);
revent.AddEvents(new string[] { "new_g" });
revent.RemoteEventCounts += new FbRemoteEventEventHandler (EventCounts);
revent.QueueEvents();
I'm using FirebirdSql.Data.FirebirdClient, added in reference FirebirdSql.Data.FirebirdClient.dll, but if I write FbRemoteEventEventHandler error appears.
Why? What should be done?

if found also nothing and there was just the declaration in the object catalogue :/
public event System.EventHandler<FirebirdSql.Data.FirebirdClient.FbRemoteEventEventArgs> RemoteEventCounts
so please try this ...
FbRemoteEvent revent = new FbRemoteEvent(fb);
revent.AddEvents(new string[] { "new_g" });
revent.RemoteEventCounts += new EventHandler<FbRemoteEventEventArgs>(EventCounts);
revent.QueueEvents();

Related

End-user embedded programable VB inside C#

How would it be possible to build a complete C# application with the feature of creating new functionalities thru new VB files. Those files shouldn't have to be compiled but interpreted in runtime.
I think of it as an embedded VB interpreter, but don't know how it can be accomplished.
You could build a robust base application and then let your technicians adapt it to the particularities of each client (databases, tables, filters, network services,...)
A client of mine has a software with that open functionality but I ignore the details.
It also be great if python could be integrated!
Using VBCodeProvider you can compile VB.NET code at run-time.
The following example, compiles a piece of VB.NET code at run-time and run it:
private void button1_Click(object sender, EventArgs e)
{
using (var vbc = new VBCodeProvider())
{
var parameters = new CompilerParameters(new[] {
"mscorlib.dll",
"System.Windows.Forms.dll",
"System.dll",
"System.Drawing.dll",
"System.Core.dll",
"Microsoft.VisualBasic.dll"});
var results = vbc.CompileAssemblyFromSource(parameters,
#"
Imports System.Windows.Forms
Imports System.Drawing
Public Class Form1
Inherits Form
public Sub New ()
Dim b as Button = new Button()
b.Text = ""Button1""
AddHandler b.Click,
Sub (s,e)
MessageBox.Show(""Hello from runtime!"")
End Sub
Me.Controls.Add(b)
End Sub
End Class");
//Check if compilation is successful, run the code
if (!results.Errors.HasErrors)
{
var t = results.CompiledAssembly.GetType("Form1");
Form f = (Form)Activator.CreateInstance(t);
f.ShowDialog();
}
else
{
var errors = string.Join(Environment.NewLine,
results.Errors.Cast<CompilerError>()
.Select(x => x.ErrorText));
MessageBox.Show(errors);
}
}
}

Getting current location in a WPF C# app using Geocode.Core

I'm trying to get the lat/lng of my current location of my win7 PC, I'm using Bing maps. I've had some words with the guys at the SO C# chat room and they told me about this github project. Now I've downloaded the NuGet components: Geocoding.Core and Geocoding.Microsoft
In the example provided, an IGeocoder should be instantiated as follows:
IGeocoder geocoder = new GoogleGeocoder() { ApiKey = "this-is-my-optional-google-api-key" };
Now what I'm trying to do is using MicrosoftGeocoder instead. But the IDE doesn't seem to have this kind of constructor, the new keyword won't give me that option. Here's my code:
public MainWindow()
{
InitializeComponent();
MainMap.Mode = new AerialMode(true);
MainMap.Focus();
MainMap.Culture = "ar-sa";
MainMap.MouseDoubleClick += new MouseButtonEventHandler(MapWithPushpins_MouseDoubleClick);
IGeocoder geocoder = new MicrosoftGeocoder("KEY HERE");
}
I should say that I haven't dealt with github very much so excuse my ignorance if I'm missing something.
There is no MicrosoftGeocoder type available in Geocoding.Microsoft but the constructor of BingMapsGeocoder accepts a key:
IGeocoder geocoder = new BingMapsGeocoder("KEY HERE");

How to use Orc.SystemInfo?

I downloaded via nuget the package Orc.SystemInfo (Orc.SystemInfo). I managed to display some SystemInfoElements as a list. However no name is provided (name in List is null). I think there is a problem with the LanguageService. I already googled for this problem but I was unable to find a solution.
Here is my code so far (Linq-Pad)
void Main()
{
var service = new Orc.SystemInfo.WindowsManagementInformationService();
var dotnet = new Orc.SystemInfo.DotNetFrameworkService();
var db = new Orc.SystemInfo.DbProvidersService();
ILanguageService lang = new Catel.Services.LanguageService();
var info = new Orc.SystemInfo.SystemInfoService(service, dotnet, lang, db);
var infoList = info.GetSystemInfo();
infoList.Dump();
}
Thank you for your help!
You can simply resolve the ISystemInfo service using the ServiceLocator and all should be taken care of for you.

"C#/Xaml Windows app store" Get a file.mbtiles on a localhost using nodejs

I wanna use a tile map in my c# program using a nodejs server.
The server is actually working because I can see tiles on my browser.
The problem is that my program correctly works on Visual Studio but when I'm trying to use the packaged version on a different device it doesn't recognize my server.
Here is my actual code :
public MapPage()
{
this.InitializeComponent();
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += navigationHelper_LoadState;
this.navigationHelper.SaveState += navigationHelper_SaveState;
MapTileLayer layer2 = new MapTileLayer();
layer2.Opacity = 1;
string ip = this.getCurrentIPAddress().ToString();
layer2.GetTileUri += (s, e) =>
{
e.Uri = new Uri(string.Format("http://localhost:3000/{0}/{1}/{2}.png", e.LevelOfDetail, e.X, e.Y));
};
MyMap.TileLayers.Add(layer2);
shapeLayer = new MapLayer();
MyMap.Children.Add(shapeLayer);
poiLayer = new MapLayer();
MyMap.Children.Add(poiLayer);
this.all_btn.IsChecked = true;
}
Does anyone got an idea ?
Thanks for reading =)
EDIT:
It seems to be caused by the absence of Visual Studio on the device
EDIT2:
I tried to do the same process using the new VS2015 Xaml controller MapControl And I had the same issue.
EDIT3:
I went back to w8.1 and it seems that for the app to work I've to install VS and download the bing maps SDK so it may be due to this =/

Database Dataset errors in form designer view

I'm using visual studio 2012, c# and have created several windows form applications but whenever I try to run my program, there is an error with the "designer view":
this.employee_DatabaseDataSet = new Form1.Employee_DatabaseDataSet();
this.tblCustLoginBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblCustLoginTableAdapter = new Form1.Employee_DatabaseDataSetTableAdapters.**tblCustLoginTableAdapter();
this.tableAdapterManager = new Form1.Employee_DatabaseDataSetTableAdapters**.TableAdapterManager();
It seems to me that there is a problem with my data source but I have started fresh so I don't see what the problem is.
This is the error that comes up:
"The type name Employee_DatabaseDataSet does not exist in the type form1.form1"
Can someone be so kind to help me please? Thanks for reading
you are missing the () parenthesis pair after Form1
Try this :
this.employee_DatabaseDataSet = new Form1().Employee_DatabaseDataSet();
this.tblCustLoginBindingSource = new System.Windows.Forms.BindingSource(this.components);
this.tblCustLoginTableAdapter = new Form1().Employee_DatabaseDataSetTableAdapters.tblCustLoginTableAdapter();
this.tableAdapterManager = new Form1().Employee_DatabaseDataSetTableAdapters.TableAdapterManager();

Categories