mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-06 15:37:52 +00:00
Implemented function Alert (MT5)
This commit is contained in:
@@ -526,12 +526,16 @@
|
||||
</WrapPanel>
|
||||
|
||||
<Grid Margin="10" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox Grid.Column="0" Text="{Binding MessageText}" Margin="5"/>
|
||||
<Button Grid.Column="1" Command="{Binding PrintCommand}" Content="Print" Margin="5"/>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBox Grid.Row="0" Text="{Binding MessageText}" Margin="2"/>
|
||||
<StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Command="{Binding PrintCommand}" Content="Print" Margin="2" />
|
||||
<Button Command="{Binding AlertCommand}" Content="Alert" Margin="2" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -70,6 +70,7 @@ namespace MtApi5TestClient
|
||||
public DelegateCommand GetLastErrorCommand { get; private set; }
|
||||
public DelegateCommand ResetLastErrorCommand { get; private set; }
|
||||
public DelegateCommand PrintCommand { get; private set; }
|
||||
public DelegateCommand AlertCommand { get; private set; }
|
||||
|
||||
public DelegateCommand iCustomCommand { get; private set; }
|
||||
|
||||
@@ -425,6 +426,7 @@ namespace MtApi5TestClient
|
||||
PositionOpenCommand = new DelegateCommand(ExecutePositionOpen);
|
||||
|
||||
PrintCommand = new DelegateCommand(ExecutePrint);
|
||||
AlertCommand = new DelegateCommand(ExecuteAlert);
|
||||
GetLastErrorCommand = new DelegateCommand(ExecuteGetLastError);
|
||||
ResetLastErrorCommand = new DelegateCommand(ExecuteResetLastError);
|
||||
|
||||
@@ -1136,6 +1138,14 @@ namespace MtApi5TestClient
|
||||
AddLog($"Print: message print in MetaTrader - {retVal}");
|
||||
}
|
||||
|
||||
private void ExecuteAlert(object obj)
|
||||
{
|
||||
var message = MessageText;
|
||||
|
||||
_mtApiClient.Alert(message);
|
||||
AddLog($"Alert: send alert to MetaTrader - {message}.");
|
||||
}
|
||||
|
||||
private async void ExecuteGetLastError(object obj)
|
||||
{
|
||||
var retVal = await Execute(() => _mtApiClient.GetLastError());
|
||||
|
||||
Reference in New Issue
Block a user