mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-09 00:47:51 +00:00
Added projects MtApi4 and MtApi5
This commit is contained in:
Executable
+35
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MtApi
|
||||
{
|
||||
static class ExtensionMethods
|
||||
{
|
||||
#region Event Methods
|
||||
public static void FireEvent(this EventHandler eventHandler, object sender)
|
||||
{
|
||||
if (eventHandler != null)
|
||||
{
|
||||
eventHandler(sender, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public static void FireEvent<T>(this EventHandler<T> eventHandler, object sender, T e)
|
||||
where T : EventArgs
|
||||
{
|
||||
if (eventHandler != null)
|
||||
{
|
||||
eventHandler(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public static MtQuote Parse(this MTApiService.MtQuote quote)
|
||||
{
|
||||
return (quote != null) ? new MtQuote(quote.Instrument, quote.Bid, quote.Ask) : null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user