Compare commits
3
Commits
csv_export
...
2.15.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb568aab39 | ||
|
|
1f80c3366e | ||
|
|
19e66a1c32 |
No files matched your search
@@ -115,7 +115,7 @@ namespace mbts.ui.shell
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BTS\\stunnel\\";
|
string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\BTS\\stunnel\\";
|
||||||
if (File.Exists(path + "config\\stunnel.conf"))
|
if (File.Exists(path + "config\\stunnel.conf"))
|
||||||
{
|
{
|
||||||
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
||||||
@@ -124,6 +124,15 @@ namespace mbts.ui.shell
|
|||||||
kill_stunnel();
|
kill_stunnel();
|
||||||
start_stunnel(path, job_error);
|
start_stunnel(path, job_error);
|
||||||
}
|
}
|
||||||
|
path = AppDomain.CurrentDomain.BaseDirectory + "\\..\\stunnel\\";
|
||||||
|
if (File.Exists(path + "config\\stunnel.conf"))
|
||||||
|
{
|
||||||
|
uint job_error = BTSUINativeMethods.setup_process_job_object();
|
||||||
|
//if we can't put this process and stunnel into a job, try to stop stunnel then restart
|
||||||
|
if (job_error != 0)
|
||||||
|
kill_stunnel();
|
||||||
|
start_stunnel(path, job_error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(Exception ex)
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -534,8 +534,7 @@ namespace mbts.spark {
|
|||||||
_size_from_row(row, _price_list, _asks, _vm.security.ContractSpec);
|
_size_from_row(row, _price_list, _asks, _vm.security.ContractSpec);
|
||||||
|
|
||||||
uint _volume_from_row(int row) {
|
uint _volume_from_row(int row) {
|
||||||
if (_price_list != null) {
|
if (_price_list.SafeTryGetAt(row, out var price)) {
|
||||||
var price = _price_list[row];
|
|
||||||
var vapls = _volume_container.read_new_value();
|
var vapls = _volume_container.read_new_value();
|
||||||
if (vapls != null) {
|
if (vapls != null) {
|
||||||
return vapls.SelectFirstOrDefault(v => MathUtils.epsilon_equals(v.Price, price), v => v.Volume);
|
return vapls.SelectFirstOrDefault(v => MathUtils.epsilon_equals(v.Price, price), v => v.Volume);
|
||||||
|
|||||||
@@ -103,6 +103,15 @@ namespace bts.collections {
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool SafeTryGetAt<T>(this IList<T> list, int index, out T value) {
|
||||||
|
if (list != null && index >= 0 && index < list.Count) {
|
||||||
|
value = list[index];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
value = default;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public static bool TryGetAt<T>(this IList<T> list, int index, out T value) {
|
public static bool TryGetAt<T>(this IList<T> list, int index, out T value) {
|
||||||
if (index >= 0 && index < list.Count) {
|
if (index >= 0 && index < list.Count) {
|
||||||
value = list[index];
|
value = list[index];
|
||||||
|
|||||||
Reference in new issue
Block a user