Skip to content

Commit fe35915

Browse files
author
Ahmad Noman Musleh
committed
Removed LiteDb from UI
1 parent 8ce8911 commit fe35915

File tree

11 files changed

+50
-49
lines changed

11 files changed

+50
-49
lines changed

src/Alert/Alert.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@
7474
<Reference Include="Microsoft.CSharp" />
7575
<Reference Include="System.Data" />
7676
<Reference Include="System.Xml" />
77-
<Reference Include="TelegramBotApi, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
78-
<HintPath>..\..\packages\TelegramBotApi.1.0.1\lib\net45\TelegramBotApi.dll</HintPath>
77+
<Reference Include="TelegramBotApi, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
78+
<HintPath>..\..\packages\TelegramBotApi.1.0.2\lib\net45\TelegramBotApi.dll</HintPath>
7979
</Reference>
8080
<Reference Include="WindowsBase" />
8181
</ItemGroup>
8282
<ItemGroup>
83-
<Compile Include="Models\AlertContainer.cs" />
8483
<Compile Include="Models\Configuration.cs" />
8584
<Compile Include="Launcher.cs" />
8685
<Compile Include="INotificationsExtensions.cs" />

src/Alert/Models/AlertContainer.cs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/Alert/Models/Configuration.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public Configuration()
2020
Directory.CreateDirectory(alertsDirPath);
2121
}
2222

23-
AlertsFilePath = Path.Combine(alertsDirPath, $"Alerts_{version}.db");
24-
SettingsFilePath = Path.Combine(alertsDirPath, $"AlertPopupSettings_{version}.xml");
25-
LogFilePath = Path.Combine(alertsDirPath, $"Alerts_{version}.log");
23+
AlertsFilePath = Path.Combine(alertsDirPath, $"data.db");
24+
SettingsFilePath = Path.Combine(alertsDirPath, $"settings.xml");
25+
LogFilePath = Path.Combine(alertsDirPath, $"logs.log");
2626

2727
Title = $"Alerts - cTrader";
2828
}

src/Alert/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("AlgoDeveloper")]
1212
[assembly: AssemblyProduct("cAlgo.API.Alert")]
13-
[assembly: AssemblyCopyright("Copyright © 2019")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.1.6.1")]
36-
[assembly: AssemblyFileVersion("2.1.6.1")]
35+
[assembly: AssemblyVersion("2.2.0.0")]
36+
[assembly: AssemblyFileVersion("2.2.0.0")]
3737
[assembly: NeutralResourcesLanguage("en-US")]

src/Alert/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
88
<package id="Prism.Core" version="7.1.0.431" targetFramework="net45" />
99
<package id="Prism.Wpf" version="7.1.0.431" targetFramework="net45" />
10-
<package id="TelegramBotApi" version="1.0.1" targetFramework="net45" />
10+
<package id="TelegramBotApi" version="1.0.2" targetFramework="net45" />
1111
</packages>

src/UI/Models/AlertModel.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using LiteDB;
2-
using Prism.Mvvm;
1+
using Prism.Mvvm;
32
using System;
43

54
namespace cAlgo.API.Alert.UI.Models
@@ -18,14 +17,13 @@ public class AlertModel : BindableBase, ICloneable
1817

1918
#region Properties
2019

21-
[BsonId]
2220
public string Id
2321
{
2422
get
2523
{
2624
if (string.IsNullOrEmpty(_id))
2725
{
28-
_id = $"{Time.Ticks}_{Symbol}_{Type}";
26+
_id = $"{Time.Ticks}_{Symbol}_{Type}_{Price}_{TriggeredBy}_{TimeFrame}";
2927
}
3028

3129
return _id;

src/UI/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("AlgoDeveloper")]
1212
[assembly: AssemblyProduct("cAlgo.API.Alert.UI")]
13-
[assembly: AssemblyCopyright("Copyright © 2019")]
13+
[assembly: AssemblyCopyright("Copyright © 2020")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.1.6.0")]
36-
[assembly: AssemblyFileVersion("2.1.6.0")]
35+
[assembly: AssemblyVersion("2.2.0.0")]
36+
[assembly: AssemblyFileVersion("2.2.0.0")]
3737
[assembly: NeutralResourcesLanguage("en-US")]

src/UI/UI.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
<Reference Include="ControlzEx, Version=3.0.2.4, Culture=neutral, processorArchitecture=MSIL">
4040
<HintPath>..\..\packages\ControlzEx.3.0.2.4\lib\net45\ControlzEx.dll</HintPath>
4141
</Reference>
42-
<Reference Include="LiteDB, Version=5.0.7.0, Culture=neutral, PublicKeyToken=4ee40123013c9f27, processorArchitecture=MSIL">
43-
<HintPath>..\..\packages\LiteDB.5.0.7\lib\net45\LiteDB.dll</HintPath>
44-
</Reference>
4542
<Reference Include="MahApps.Metro, Version=1.6.5.1, Culture=neutral, processorArchitecture=MSIL">
4643
<HintPath>..\..\packages\MahApps.Metro.1.6.5\lib\net45\MahApps.Metro.dll</HintPath>
4744
</Reference>
@@ -70,8 +67,8 @@
7067
<Reference Include="System.Data" />
7168
<Reference Include="System.Net.Http" />
7269
<Reference Include="System.Xml" />
73-
<Reference Include="TelegramBotApi, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
74-
<HintPath>..\..\packages\TelegramBotApi.1.0.1\lib\net45\TelegramBotApi.dll</HintPath>
70+
<Reference Include="TelegramBotApi, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
71+
<HintPath>..\..\packages\TelegramBotApi.1.0.2\lib\net45\TelegramBotApi.dll</HintPath>
7572
</Reference>
7673
<Reference Include="WindowsBase" />
7774
</ItemGroup>

src/UI/packages.config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
<packages>
33
<package id="CommonServiceLocator" version="2.0.4" targetFramework="net45" />
44
<package id="ControlzEx" version="3.0.2.4" targetFramework="net45" />
5-
<package id="LiteDB" version="5.0.7" targetFramework="net45" />
65
<package id="MahApps.Metro" version="1.6.5" targetFramework="net45" />
76
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" />
87
<package id="Prism.Core" version="7.1.0.431" targetFramework="net45" />
98
<package id="Prism.Wpf" version="7.1.0.431" targetFramework="net45" />
10-
<package id="TelegramBotApi" version="1.0.1" targetFramework="net45" />
9+
<package id="TelegramBotApi" version="1.0.2" targetFramework="net45" />
1110
</packages>

test/UITestConsole/Program.cs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,24 @@ private static void Main(string[] args)
1919

2020
string[] arrows = { "1", "2", "3" };
2121

22-
while (counter < 100)
22+
while (counter < 10)
2323
{
2424
counter++;
2525

26-
string type = string.Format("Trend Line {0}", arrows[new Random().Next(0, 3)]);
26+
var alert = new AlertModel
27+
{
28+
//TimeFrame = "Hour",
29+
Type = string.Format("Trend Line {0}", arrows[new Random().Next(0, 3)]),
30+
Symbol = "EURUSD",
31+
Time = DateTimeOffset.Now,
32+
Price = 1.23456,
33+
Comment = counter.ToString(),
34+
//TriggeredBy = "UITestConsole"
35+
};
2736

28-
notifications.ShowPopup("Hour", "EURUSD", type, "UITestConsole", 1.23452, counter.ToString(), DateTimeOffset.Now);
37+
notifications.ShowPopup(alert);
2938

30-
Thread.Sleep(200);
39+
Thread.Sleep(500);
3140
}
3241

3342
//TestMultiThread();

0 commit comments

Comments
 (0)