Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be68e006bf | ||
|
|
b1a1f83ea8 | ||
|
|
9495435780 | ||
|
|
e3d9b59759 | ||
|
|
eb0f6ae25a | ||
|
|
a9d72c22fb | ||
|
|
caf5463565 | ||
|
|
eb5290932f | ||
|
|
a0fb42f1cf | ||
|
|
a450d6447a | ||
|
|
db22dc2853 | ||
|
|
d042da8708 | ||
|
|
bed44db642 | ||
|
|
9c5ac2eb19 | ||
|
|
bec0e7dd15 | ||
|
|
9c7013082d | ||
|
|
80a9df9d73 | ||
|
|
7040af5545 | ||
|
|
fe8866118d | ||
|
|
d699f85784 | ||
|
|
0a797c0cfb |
No files matched your search
@@ -30,9 +30,6 @@
|
||||
<Setter
|
||||
Property="FontStyle"
|
||||
Value="Italic" />
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="Gray" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -51,9 +48,6 @@
|
||||
<Setter
|
||||
Property="FontStyle"
|
||||
Value="Italic" />
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="Gray" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -123,6 +117,20 @@
|
||||
CommandParameter="{Binding}"
|
||||
/>
|
||||
</ContextMenu>
|
||||
|
||||
<Style x:Key="TextBlockCellElement" TargetType="TextBlock">
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=DataGridCell}}" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ComboBoxCellElement" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}">
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=DataGridCell}}" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="IsSynchronizedWithCurrentItem" Value="False" />
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
@@ -147,24 +155,37 @@
|
||||
Margin="5,2,2,2"
|
||||
TextBlock.Foreground="Black"
|
||||
HeaderContent="Symbols"
|
||||
ShowSelectAll="True"
|
||||
/>
|
||||
ShowSelectAll="True">
|
||||
<c:ComboCheckBox.HeaderContentTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Foreground="{u:BTSColor UI.default_text}" />
|
||||
</DataTemplate>
|
||||
</c:ComboCheckBox.HeaderContentTemplate>
|
||||
</c:ComboCheckBox>
|
||||
|
||||
<WrapPanel>
|
||||
<TextBlock Margin="5,5,0,0" Text="Auto copy rolls:" />
|
||||
<CheckBox Margin="5,5,10,0" IsChecked="{Binding auto_copy_rolls_is_checked}" />
|
||||
<TextBlock
|
||||
Margin="5,5,0,0" Text="Auto copy rolls:" Style="{StaticResource TextBlock.Dark}" />
|
||||
<CheckBox
|
||||
Margin="5,5,10,0"
|
||||
IsChecked="{Binding auto_copy_rolls_is_checked}"
|
||||
Style="{StaticResource CheckBox.Dark}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<TextBlock Margin='0,5,0,0' Text="Auto copy rates:" />
|
||||
<CheckBox Margin="5,5,0,0" IsChecked="{Binding auto_copy_rates_is_checked}" />
|
||||
<TextBlock
|
||||
Margin='0,5,0,0' Text="Auto copy rates:" Style="{StaticResource TextBlock.Dark}" />
|
||||
<CheckBox
|
||||
Margin="5,5,0,0"
|
||||
IsChecked="{Binding auto_copy_rates_is_checked}"
|
||||
Style="{StaticResource CheckBox.Dark}" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
<c:DataGridEx
|
||||
x:Name="_grid"
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding visible_rows}"
|
||||
AlternatingRowBackground="{u:BTSColor MarketData.driver_background}"
|
||||
VerticalGridLinesBrush="Gray"
|
||||
Background="Transparent"
|
||||
VerticalGridLinesBrush="{u:BTSColor Grid.grid_line}"
|
||||
EnableRowVirtualization="True"
|
||||
EnableColumnVirtualization="True"
|
||||
CanUserAddRows="False"
|
||||
@@ -177,35 +198,10 @@
|
||||
SelectionUnit="FullRow"
|
||||
SelectedUnits="{Binding selected_rows}"
|
||||
PreviewMouseRightButtonUp="_grid_PreviewMouseRightButtonUp">
|
||||
<DataGrid.Resources>
|
||||
<Style TargetType="{x:Type DataGridCell}" BasedOn="{StaticResource {x:Type DataGridCell}}">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Style.Triggers>
|
||||
<Trigger
|
||||
Property="IsSelected"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="Background"
|
||||
Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.Resources>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<c:DataGridEx.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected, Mode=TwoWay}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Style.Triggers>
|
||||
<Trigger
|
||||
Property="IsSelected"
|
||||
Value="true">
|
||||
<Setter
|
||||
Property="Background"
|
||||
Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
</Trigger>
|
||||
<DataTrigger
|
||||
Binding="{Binding is_last_row_of_month_group}"
|
||||
Value="True">
|
||||
@@ -218,7 +214,7 @@
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</c:DataGridEx.RowStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter
|
||||
@@ -230,9 +226,6 @@
|
||||
<Setter
|
||||
Property="HorizontalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter
|
||||
Property="BorderThickness"
|
||||
Value="0,0,1,0" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Black" />
|
||||
@@ -259,9 +252,6 @@
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="{u:BTSColor Name=header_text}" />
|
||||
<Setter
|
||||
Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter
|
||||
Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
@@ -308,9 +298,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_driver_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="{u:BTSColor UI.input_dirty_border}" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -318,11 +306,10 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemsSource="{Binding Source={StaticResource Drivers}}"
|
||||
ItemTemplate="{StaticResource DriverTemplate}"
|
||||
SelectedItem="{Binding driver, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="2" />
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -340,21 +327,28 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_deliverable_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding is_deliverable_dirty}" Value="False" />
|
||||
<Condition Binding="{Binding
|
||||
deliverable,
|
||||
Converter={x:Static shell:AnalyticsExpirationParametersView.expiration_is_defined_converter}}"
|
||||
Value="False" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_foreground_dark}" />
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTemplateColumn.CellStyle>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemsSource="{Binding Source={StaticResource NonOptionsWithEmpty}}"
|
||||
ItemTemplate="{StaticResource ExpirationTemplate}"
|
||||
SelectedItem="{Binding deliverable, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="2" />
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -372,21 +366,28 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_roll_schedule_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
<Condition Binding="{Binding is_roll_schedule_dirty}" Value="False" />
|
||||
<Condition Binding="{Binding
|
||||
roll_schedule,
|
||||
Converter={x:Static shell:AnalyticsExpirationParametersView.expiration_is_defined_converter}}"
|
||||
Value="False" />
|
||||
</MultiDataTrigger.Conditions>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_foreground_dark}" />
|
||||
</MultiDataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTemplateColumn.CellStyle>
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemsSource="{Binding Source={StaticResource NonOptionsWithEmpty}}"
|
||||
ItemTemplate="{StaticResource ExpirationTemplate}"
|
||||
SelectedItem="{Binding roll_schedule, UpdateSourceTrigger=PropertyChanged}"
|
||||
Margin="2" />
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -402,9 +403,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_roll_target_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -415,14 +414,16 @@
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource RollTargetContextMenu}" />
|
||||
ContextMenu="{StaticResource RollTargetContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
Margin="2" />
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
Margin="2"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -438,9 +439,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_riskless_rate_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -451,12 +450,15 @@
|
||||
Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource RisklessRateContextMenu}" />
|
||||
ContextMenu="{StaticResource RisklessRateContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}" />
|
||||
<TextBox
|
||||
Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -472,9 +474,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_settlement_price_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -485,12 +485,15 @@
|
||||
Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource SettlementPriceContextMenu}" />
|
||||
ContextMenu="{StaticResource SettlementPriceContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}" />
|
||||
<TextBox
|
||||
Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -507,9 +510,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_delta_beta_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -520,12 +521,15 @@
|
||||
Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource DeltaBetaContextMenu}" />
|
||||
ContextMenu="{StaticResource DeltaBetaContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}" />
|
||||
<TextBox
|
||||
Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -542,9 +546,7 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_vega_beta_dirty}"
|
||||
Value="True">
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -552,15 +554,18 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource VegaBetaContextMenu}" />
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource VegaBetaContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}" />
|
||||
<TextBox
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -51,6 +51,10 @@ namespace mbts.ui.shell {
|
||||
} :
|
||||
null);
|
||||
|
||||
public static IValueConverter expiration_is_defined_converter =>
|
||||
ValueConverter.create<SecurityExpiration?, bool>(exp =>
|
||||
exp is not null && exp.expiration != default);
|
||||
|
||||
void _grid_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e) {
|
||||
Disposable.dispose(ref _context_menu_op);
|
||||
if (e.OriginalSource is not FrameworkElement el || DataContext is not AnalyticsExpirationParametersVM vm) {
|
||||
|
||||
@@ -46,7 +46,9 @@ namespace mbts.spark {
|
||||
if (startup_data.vol_curve_x_axis == null) {
|
||||
var x_axis = BTSOxyGraphAxisDouble.Default;
|
||||
x_axis.name = "Strike";
|
||||
x_axis.axis_line_color = BTSColors.Graph.axis_line;
|
||||
x_axis.major_grid_line_color = BTSColors.Graph.grid_line;
|
||||
x_axis.tick_line_color = BTSColors.Graph.tick_line;
|
||||
x_axis.position = AxisPosition.BottomLeftToRight;
|
||||
x_axis.minimum = 0;
|
||||
x_axis.maximum = 2000;
|
||||
@@ -58,7 +60,9 @@ namespace mbts.spark {
|
||||
if (startup_data.vol_curve_y_axis == null) {
|
||||
var y_axis = BTSOxyGraphAxisDouble.Default;
|
||||
y_axis.name = "Volatility";
|
||||
y_axis.axis_line_color = BTSColors.Graph.axis_line;
|
||||
y_axis.major_grid_line_color = BTSColors.Graph.grid_line;
|
||||
y_axis.tick_line_color = BTSColors.Graph.tick_line;
|
||||
y_axis.position = AxisPosition.LeftBottomToTop;
|
||||
y_axis.minimum = 0;
|
||||
y_axis.maximum = 1;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace mbts.spark.VolSurface {
|
||||
var view = new TextBlock {
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
Margin = _cell_padding,
|
||||
Foreground = Brushes.Blue,
|
||||
Foreground = BTSColors.VolSurfaceGrid.readonly_column_foreground
|
||||
};
|
||||
view.SetBinding(FrameworkElement.DataContextProperty, new Binding() {
|
||||
Converter = _data_context_converter
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
public IRaiseCanExecuteChangedCommand vol_shift { get; }
|
||||
|
||||
IEnumerable<IRaiseCanExecuteChangedCommand> _commands =>
|
||||
ReflectionHelper.property_delegates_of_type<VolSurfaceMacroActionsVM, IRaiseCanExecuteChangedCommand>()
|
||||
.Select(g => g(this));
|
||||
ReflectionHelper.property_getters<VolSurfaceMacroActionsVM, IRaiseCanExecuteChangedCommand>()
|
||||
.Select(pg => pg.get(this));
|
||||
|
||||
public void selection_changed(IEnumerable<VolSurfaceDisplayGridExpiration> selected) {
|
||||
_selected_exps = selected.ToList();
|
||||
|
||||
@@ -19,8 +19,9 @@ namespace mbts.analytics
|
||||
/// with default inputs
|
||||
public static VolSurfaceInput sync_input_expirations_to_master_list(VolSurfaceInput vs_input, IEnumerable<VolSurfaceExpiration> system_exp_list)
|
||||
{
|
||||
HashSet<VolSurfaceExpiration> vs_exp_map = new HashSet<VolSurfaceExpiration>(vs_input.surface_parameters.curve_parameters_map.Select(t => t.Item1)),
|
||||
sys_exp_map = new HashSet<VolSurfaceExpiration>(system_exp_list);
|
||||
var vs_exp_map = vs_input.surface_parameters.curve_parameters_map
|
||||
.empty_if_null().Select(t => t.Item1).ToHashSet();
|
||||
var sys_exp_map = system_exp_list.ToHashSet();
|
||||
sys_exp_map.difference(
|
||||
vs_exp_map,
|
||||
out HashSet<VolSurfaceExpiration> deleted_exps,
|
||||
|
||||
@@ -674,7 +674,7 @@ namespace mbts.analytics {
|
||||
var vol_time = VolSurfaceCoreFunctions.compute_vol_time(
|
||||
vs_input, vs_standard_time.server_time_utc);
|
||||
var exp_inp_data = vs_nonvol_input.get_option_exp_input();
|
||||
foreach (var (exp, curve_params) in vs_input.surface_parameters.curve_parameters_map) {
|
||||
foreach (var (exp, curve_params) in vs_input.surface_parameters.curve_parameters_map.empty_if_null()) {
|
||||
var time_shift = DoubleHelper.CoerceNaN(curve_params.core_parameters.time_shift);
|
||||
_compute_option_bizt(
|
||||
vs_input, exp, vol_time, time_shift, out var biz_yrs, out var biz_days_per_yr);
|
||||
|
||||
@@ -262,9 +262,9 @@ namespace mbts.ui {
|
||||
public static ImageSource vol_surface => Math;
|
||||
public static ImageSource Wrench { get { return load_resource_and_freeze("Wrench"); } }
|
||||
public static ImageSource RightArrow => create_icon(
|
||||
ArrowGeometryKey, null, new(Brushes.Black, 3));
|
||||
ArrowGeometryKey, null, new(BTSColors.UI.icon_foreground, 3));
|
||||
public static ImageSource DownArrow => create_icon(
|
||||
ArrowGeometryKey, null, new(Brushes.Black, 3), new RotateTransform(90, 0.5, 0.5));
|
||||
ArrowGeometryKey, null, new(BTSColors.UI.icon_foreground, 3), new RotateTransform(90, 0.5, 0.5));
|
||||
public static ImageSource Factory { get { return (load_resource_and_freeze("Factory")); } }
|
||||
public static ImageSource DotsVertical { get { return (load_resource_and_freeze("DotsVertical")); } }
|
||||
public static ImageSource HandPointingOverDocument => load_resource_and_freeze("HandPointingOverDocument");
|
||||
@@ -272,10 +272,10 @@ namespace mbts.ui {
|
||||
public static ImageSource FloppyDisk => create_icon("FloppyDisk");
|
||||
|
||||
static Brush _default_chevron_brush => null;
|
||||
static Pen _default_chevron_pen { get; } = new Pen(Brushes.Black, 3).frozen();
|
||||
static Pen _default_chevron_pen { get; } = new Pen(BTSColors.UI.default_text, 3).frozen();
|
||||
|
||||
public static ImageSource create_icon(string geometric_path_key) =>
|
||||
create_icon(geometric_path_key, Brushes.Black);
|
||||
create_icon(geometric_path_key, BTSColors.UI.icon_foreground);
|
||||
|
||||
public static ImageSource create_icon(string geometric_path_key, Brush brush, Pen pen = null, Transform transform = null) {
|
||||
var rv = new DrawingImage(create_drawing(geometric_path_key, brush, pen, transform));
|
||||
|
||||
@@ -503,7 +503,7 @@
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Geometry="M1540.22,2082.07L1546.95,2102.78 1568.73,2102.78 1551.11,2115.58 1557.84,2136.29 1540.22,2123.49 1522.6,2136.29 1529.33,2115.58 1511.71,2102.78 1533.49,2102.78 1540.22,2082.07z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="3" Brush="Black" />
|
||||
<Pen Thickness="3" Brush="{mbts:BTSColor UI.icon_foreground}" />
|
||||
</GeometryDrawing.Pen>
|
||||
<GeometryDrawing.Brush>
|
||||
<SolidColorBrush Color="Transparent" />
|
||||
@@ -525,7 +525,7 @@ M 52.868601,3.8869994 C51.026201,3.8869996 49.534,5.3791947 49.534,7.2190399 49.
|
||||
M5.2010002,14.812L5.2010002,43.573997 56.098,43.573997 56.098,14.812z
|
||||
M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="1" Brush="Black" />
|
||||
<Pen Thickness="1" Brush="{mbts:BTSColor UI.icon_foreground}" />
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -537,14 +537,14 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="
|
||||
M 32.868601,3.8869994 C31.026201,3.8869996 29.534,5.3791947 29.534,7.2190399 29.534,9.0588851 31.026201,10.553 32.868601,10.553 34.7085,10.553 36.202,9.0588851 36.202,7.2190399 36.202,5.3791947 34.7085,3.8869996 32.868601,3.8869994z
|
||||
M 42.868601,3.8869994 C41.026201,3.8869996 39.534,5.3791947 39.534,7.2190399 39.534,9.0588851 41.026201,10.553 42.868601,10.553 44.7085,10.553 46.202,9.0588851 46.202,7.2190399 46.202,5.3791947 44.7085,3.8869996 42.868601,3.8869994z
|
||||
M 52.868601,3.8869994 C51.026201,3.8869996 49.534,5.3791947 49.534,7.2190399 49.534,9.0588851 51.026201,10.553 52.868601,10.553 54.7085,10.553 56.202,9.0588851 56.202,7.2190399 56.202,5.3791947 54.7085,3.8869996 52.868601,3.8869994z
|
||||
M5.2010002,14.812L5.2010002,43.573997 56.098,43.573997 56.098,14.812z
|
||||
M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="1" Brush="Black" />
|
||||
<Pen Thickness="1" Brush="{mbts:BTSColor UI.icon_foreground}" />
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -556,7 +556,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="F1M-198.67,4280.19C-197.609,4277.78 -197.035,4275.17 -197.035,4272.46 -197.035,4267.33 -199.032,4262.51 -202.665,4258.88 -206.286,4255.25 -211.107,4253.26 -216.235,4253.26 -221.365,4253.26 -226.186,4255.25 -229.811,4258.88 -232.498,4261.57 -234.282,4264.92 -235.032,4268.56L-225.835,4278.86 -252.503,4278.86 -250.373,4251.38 -241.577,4261.22C-240.214,4258.14 -238.303,4255.3 -235.844,4252.85 -230.61,4247.61 -223.644,4244.72 -216.235,4244.72 -208.822,4244.72 -201.861,4247.61 -196.627,4252.85 -191.39,4258.08 -188.503,4265.05 -188.503,4272.46 -188.503,4275.11 -188.894,4277.71 -189.617,4280.19L-198.67,4280.19z">
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="F1M-198.67,4280.19C-197.609,4277.78 -197.035,4275.17 -197.035,4272.46 -197.035,4267.33 -199.032,4262.51 -202.665,4258.88 -206.286,4255.25 -211.107,4253.26 -216.235,4253.26 -221.365,4253.26 -226.186,4255.25 -229.811,4258.88 -232.498,4261.57 -234.282,4264.92 -235.032,4268.56L-225.835,4278.86 -252.503,4278.86 -250.373,4251.38 -241.577,4261.22C-240.214,4258.14 -238.303,4255.3 -235.844,4252.85 -230.61,4247.61 -223.644,4244.72 -216.235,4244.72 -208.822,4244.72 -201.861,4247.61 -196.627,4252.85 -191.39,4258.08 -188.503,4265.05 -188.503,4272.46 -188.503,4275.11 -188.894,4277.71 -189.617,4280.19L-198.67,4280.19z">
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -567,7 +567,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="m 430.4375 225.625 c -1.92352 0.0276 -3.82501 0.82944 -5.1875 2.1875 L 330.0625 323 288 280.9375 c -1.38915 -1.39371 -3.34472 -2.2056 -5.3125 -2.2056 -1.96778 0 -3.92335 0.81189 -5.3125 2.2056 l -23.9375 23.9375 c -1.3844 1.38804 -2.18997 3.33646 -2.18997 5.29687 0 1.96042 0.80557 3.90884 2.18997 5.29688 l 71.3125 71.3125 c 1.38804 1.3844 3.33646 2.18997 5.29687 2.18997 1.96042 0 3.90884 -0.80557 5.29688 -2.18997 l 4.34375 -4.34375 19.59375 -19.59375 100.5 -100.5 c 1.3844 -1.38804 2.18997 -3.33646 2.18997 -5.29688 0 -1.96041 -0.80557 -3.90883 -2.18997 -5.29687 l -23.9375 -23.9375 c -1.41413 -1.40955 -3.40982 -2.21706 -5.40625 -2.1875 z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="m 430.4375 225.625 c -1.92352 0.0276 -3.82501 0.82944 -5.1875 2.1875 L 330.0625 323 288 280.9375 c -1.38915 -1.39371 -3.34472 -2.2056 -5.3125 -2.2056 -1.96778 0 -3.92335 0.81189 -5.3125 2.2056 l -23.9375 23.9375 c -1.3844 1.38804 -2.18997 3.33646 -2.18997 5.29687 0 1.96042 0.80557 3.90884 2.18997 5.29688 l 71.3125 71.3125 c 1.38804 1.3844 3.33646 2.18997 5.29687 2.18997 1.96042 0 3.90884 -0.80557 5.29688 -2.18997 l 4.34375 -4.34375 19.59375 -19.59375 100.5 -100.5 c 1.3844 -1.38804 2.18997 -3.33646 2.18997 -5.29688 0 -1.96041 -0.80557 -3.90883 -2.18997 -5.29687 l -23.9375 -23.9375 c -1.41413 -1.40955 -3.40982 -2.21706 -5.40625 -2.1875 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -577,7 +577,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M37.063741,37.405188L33.240929,50.771959 33.345182,50.829412C33.743126,51.061163,34.109612,51.337603,34.437061,51.651468L34.468327,51.682901 44.707291,44.003126 44.641921,43.880777C44.347813,43.295671,44.183001,42.63962,44.183001,41.946699L44.185978,41.833834z M24.591099,31.982382L10.519234,39.24213 10.504738,39.424831C10.479679,39.661278,10.436295,39.892527,10.375957,40.117252L10.337856,40.24584 10.451912,40.307037C10.495525,40.332783,10.538376,40.360497,10.58033,40.390192L26.361021,51.547636 26.448517,51.467699C27.339916,50.69132,28.485014,50.17779,29.750544,50.054647L30.015249,50.035364 34.145618,35.590685 29.192999,32.51112C29.04261,32.417593,28.908485,32.31176,28.79232,32.197899L28.716364,32.117622 28.685419,32.139805C28.132467,32.49791 27.465902,32.706999 26.748449,32.706999 26.030621,32.706999 25.363836,32.49791 24.810755,32.139805z M28.780092,24.040133L28.448082,26.492748 28.685419,26.630915C29.607006,27.227547 30.212999,28.238197 30.212999,29.385599 30.212999,29.614918 30.188759,29.838802 30.142603,30.055031L30.080193,30.287708 30.111809,30.297695C30.268356,30.353413,30.424189,30.42791,30.574446,30.521399L34.837221,33.172018 35.327473,31.457518C35.410911,31.165865,35.525216,30.895145,35.662153,30.652515L35.756067,30.497255 35.710442,30.474535C33.991901,29.570229,32.844,27.933699,32.844,26.065052L32.845716,26.006275z M53.770291,20.119031L44.688253,25.319921 44.720247,25.537884C44.740581,25.711212 44.750998,25.887079 44.750998,26.065052 44.750998,28.912514 42.084275,31.221001 38.797749,31.221001L38.67025,31.218208 38.672958,31.305962C38.671358,31.615515,38.625373,31.944508,38.53014,32.277802L37.755445,34.986586 44.966217,39.470285 44.977812,39.451984C45.814164,38.264851 47.230547,37.483999 48.837201,37.483999 49.078189,37.483999 49.314904,37.501568 49.546028,37.535442L49.656656,37.554392 54.505396,20.597714 54.402527,20.541037C54.290171,20.475618,54.180146,20.40689,54.0726,20.334991z M9.6452522,14.786494L9.5807686,14.857854C9.0475883,15.420187,8.3894768,15.871748,7.6484566,16.172216L7.5149994,16.222663 7.5149994,34.615192 7.5420074,34.625397C8.4930382,35.010883,9.2904701,35.676405,9.8216705,36.51416L9.9140587,36.668142 23.306246,29.758877 23.300888,29.725224C23.289059,29.61356 23.282999,29.500257 23.282999,29.385599 23.282999,27.893976 24.307062,26.633465 25.717823,26.213213L26.001564,26.143343 26.439465,22.908201z M25.594164,6.962996L10.989891,11.757046 10.982574,11.849259C10.963779,12.026639,10.935814,12.201424,10.899147,12.373173L10.896881,12.382581 26.821791,20.083639 28.28179,9.2974239 28.12504,9.2381914C27.074772,8.8124379,26.207533,8.0535914,25.667171,7.0996943z M34.637348,6.8116302L34.599276,6.8923512C33.894737,8.2938632,32.502018,9.3174334,30.841724,9.5606082L30.738474,9.5731842 29.162455,21.21555 33.69524,23.407539 33.705906,23.391473C34.750082,21.903184 36.639784,20.909001 38.797749,20.909001 40.441011,20.909001 41.929324,21.486123 43.006821,22.41919L43.020344,22.431472 51.760321,17.426437 51.737371,17.368303C51.521266,16.762437 51.403998,16.112631 51.403998,15.436536 51.403998,14.921415 51.472072,14.421554 51.600069,13.944759L51.681425,13.670171z M30.077951,0C32.588049,0,34.668222,1.7676992,35.036192,4.0752702L35.064489,4.2886443 52.961684,11.489869 53.021899,11.423252C54.161165,10.222043 55.804663,9.4679997 57.631995,9.4679992 61.070987,9.4680003 63.858998,12.139764 63.858998,15.436536 63.858998,18.733305 61.070987,21.405001 57.631995,21.405001L57.456546,21.40075 52.402265,39.080206 52.428996,39.108406C53.093061,39.879898 53.492,40.868822 53.492,41.946699 53.492,44.410421 51.407745,46.407999 48.837201,46.407999 48.033874,46.407999 47.278115,46.212923 46.618644,45.869505L46.615751,45.867823 35.872695,53.925859 35.950705,54.189234C36.069708,54.632677 36.132998,55.097586 36.132998,55.5767 36.132998,58.641745 33.540598,61.126001 30.342699,61.126001 27.144098,61.126001 24.550999,58.641745 24.550999,55.5767 24.550999,55.193407 24.591516,54.819208 24.668669,54.457815L24.711109,54.281561 8.605793,42.894129C8.5577812,42.860109,8.5120659,42.824305,8.4686737,42.786901L8.4553757,42.77429 8.3729744,42.833338C7.5921974,43.338846 6.6510086,43.634001 5.6380043,43.634001 2.935627,43.634001 0.74499893,41.535135 0.74499893,38.9454 0.74499893,36.841322 2.1911545,35.061296 4.1829567,34.467758L4.2889977,34.438908 4.2889977,16.456114 4.1295319,16.420828C1.7547989,15.835048 0,13.768469 0,11.309781 0,8.3958501 2.4649048,6.0340006 5.5053978,6.0339997 7.5959015,6.0340006 9.4142189,7.1503434 10.346516,8.7949429L10.425873,8.9434187 25.113558,4.1221313 25.119768,4.0752702C25.48749,1.7676992,27.566404,0,30.077951,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M37.063741,37.405188L33.240929,50.771959 33.345182,50.829412C33.743126,51.061163,34.109612,51.337603,34.437061,51.651468L34.468327,51.682901 44.707291,44.003126 44.641921,43.880777C44.347813,43.295671,44.183001,42.63962,44.183001,41.946699L44.185978,41.833834z M24.591099,31.982382L10.519234,39.24213 10.504738,39.424831C10.479679,39.661278,10.436295,39.892527,10.375957,40.117252L10.337856,40.24584 10.451912,40.307037C10.495525,40.332783,10.538376,40.360497,10.58033,40.390192L26.361021,51.547636 26.448517,51.467699C27.339916,50.69132,28.485014,50.17779,29.750544,50.054647L30.015249,50.035364 34.145618,35.590685 29.192999,32.51112C29.04261,32.417593,28.908485,32.31176,28.79232,32.197899L28.716364,32.117622 28.685419,32.139805C28.132467,32.49791 27.465902,32.706999 26.748449,32.706999 26.030621,32.706999 25.363836,32.49791 24.810755,32.139805z M28.780092,24.040133L28.448082,26.492748 28.685419,26.630915C29.607006,27.227547 30.212999,28.238197 30.212999,29.385599 30.212999,29.614918 30.188759,29.838802 30.142603,30.055031L30.080193,30.287708 30.111809,30.297695C30.268356,30.353413,30.424189,30.42791,30.574446,30.521399L34.837221,33.172018 35.327473,31.457518C35.410911,31.165865,35.525216,30.895145,35.662153,30.652515L35.756067,30.497255 35.710442,30.474535C33.991901,29.570229,32.844,27.933699,32.844,26.065052L32.845716,26.006275z M53.770291,20.119031L44.688253,25.319921 44.720247,25.537884C44.740581,25.711212 44.750998,25.887079 44.750998,26.065052 44.750998,28.912514 42.084275,31.221001 38.797749,31.221001L38.67025,31.218208 38.672958,31.305962C38.671358,31.615515,38.625373,31.944508,38.53014,32.277802L37.755445,34.986586 44.966217,39.470285 44.977812,39.451984C45.814164,38.264851 47.230547,37.483999 48.837201,37.483999 49.078189,37.483999 49.314904,37.501568 49.546028,37.535442L49.656656,37.554392 54.505396,20.597714 54.402527,20.541037C54.290171,20.475618,54.180146,20.40689,54.0726,20.334991z M9.6452522,14.786494L9.5807686,14.857854C9.0475883,15.420187,8.3894768,15.871748,7.6484566,16.172216L7.5149994,16.222663 7.5149994,34.615192 7.5420074,34.625397C8.4930382,35.010883,9.2904701,35.676405,9.8216705,36.51416L9.9140587,36.668142 23.306246,29.758877 23.300888,29.725224C23.289059,29.61356 23.282999,29.500257 23.282999,29.385599 23.282999,27.893976 24.307062,26.633465 25.717823,26.213213L26.001564,26.143343 26.439465,22.908201z M25.594164,6.962996L10.989891,11.757046 10.982574,11.849259C10.963779,12.026639,10.935814,12.201424,10.899147,12.373173L10.896881,12.382581 26.821791,20.083639 28.28179,9.2974239 28.12504,9.2381914C27.074772,8.8124379,26.207533,8.0535914,25.667171,7.0996943z M34.637348,6.8116302L34.599276,6.8923512C33.894737,8.2938632,32.502018,9.3174334,30.841724,9.5606082L30.738474,9.5731842 29.162455,21.21555 33.69524,23.407539 33.705906,23.391473C34.750082,21.903184 36.639784,20.909001 38.797749,20.909001 40.441011,20.909001 41.929324,21.486123 43.006821,22.41919L43.020344,22.431472 51.760321,17.426437 51.737371,17.368303C51.521266,16.762437 51.403998,16.112631 51.403998,15.436536 51.403998,14.921415 51.472072,14.421554 51.600069,13.944759L51.681425,13.670171z M30.077951,0C32.588049,0,34.668222,1.7676992,35.036192,4.0752702L35.064489,4.2886443 52.961684,11.489869 53.021899,11.423252C54.161165,10.222043 55.804663,9.4679997 57.631995,9.4679992 61.070987,9.4680003 63.858998,12.139764 63.858998,15.436536 63.858998,18.733305 61.070987,21.405001 57.631995,21.405001L57.456546,21.40075 52.402265,39.080206 52.428996,39.108406C53.093061,39.879898 53.492,40.868822 53.492,41.946699 53.492,44.410421 51.407745,46.407999 48.837201,46.407999 48.033874,46.407999 47.278115,46.212923 46.618644,45.869505L46.615751,45.867823 35.872695,53.925859 35.950705,54.189234C36.069708,54.632677 36.132998,55.097586 36.132998,55.5767 36.132998,58.641745 33.540598,61.126001 30.342699,61.126001 27.144098,61.126001 24.550999,58.641745 24.550999,55.5767 24.550999,55.193407 24.591516,54.819208 24.668669,54.457815L24.711109,54.281561 8.605793,42.894129C8.5577812,42.860109,8.5120659,42.824305,8.4686737,42.786901L8.4553757,42.77429 8.3729744,42.833338C7.5921974,43.338846 6.6510086,43.634001 5.6380043,43.634001 2.935627,43.634001 0.74499893,41.535135 0.74499893,38.9454 0.74499893,36.841322 2.1911545,35.061296 4.1829567,34.467758L4.2889977,34.438908 4.2889977,16.456114 4.1295319,16.420828C1.7547989,15.835048 0,13.768469 0,11.309781 0,8.3958501 2.4649048,6.0340006 5.5053978,6.0339997 7.5959015,6.0340006 9.4142189,7.1503434 10.346516,8.7949429L10.425873,8.9434187 25.113558,4.1221313 25.119768,4.0752702C25.48749,1.7676992,27.566404,0,30.077951,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -587,7 +587,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M3.3500004,28.921999L16.410999,28.921999 16.410999,29.396999 16.410999,32.959999 16.410999,38.421999 25.514,38.421999 25.514,42.458 25.495,42.458 25.495,47.602999 34.698,47.602999 34.698,51.640999 25.495,51.640999 25.495,51.671 21.458,51.671 21.458,42.458 16.410999,42.458 12.453001,42.458 12.374001,42.458 12.374001,32.959999 3.3500004,32.959999z M54.794001,20.069L59.39695,23.324425 64,26.580851 59.39695,29.837375 54.794001,33.094 54.794001,30.650999 33.583,30.650999 33.583,22.698998 54.794001,22.698998z M14.7162,0.3409996L24.9141,0.3409996C25.97705,0.3409996,26.865667,1.1746159,27.071213,2.1986313L27.086924,2.3030968 27.124624,2.3546333C27.940995,3.4717503 29.881758,6.1571293 30.565413,7.3636971 30.565413,7.3636971 34.096944,13.338465 34.877442,15.061705L34.890623,15.092 40.170837,15.092C41.324416,15.092 42.257998,16.195044 42.257998,17.396999 42.257998,18.600256 41.324416,19.702 40.170837,19.702L33.450961,19.702C32.370606,19.702,31.482553,18.733671,31.375766,17.621177L31.37387,17.581701 29.230907,13.962816 22.261399,18.123934 26.40747,22.377669C27.150276,23.141019,27.230264,24.306093,26.654201,25.155003L26.643522,25.169146 26.636381,25.286112C26.628118,25.36014,26.616044,25.434453,26.600019,25.508835L24.851152,33.574084C24.592043,34.765377 23.418798,35.519273 22.228654,35.261475 21.03861,35.004976 20.280681,33.829283 20.53979,32.64039L22.288656,24.57524 22.309726,24.495231 17.488041,19.548167 17.480572,19.539678 17.253374,19.529043C16.366886,19.445599,15.589428,19.018761,15.078829,18.394262L15.074381,18.388281 12.282196,21.977999 12.216562,21.901865 12.1124,21.994324C11.720974,22.306216,11.1803,22.469,10.5833,22.469L2.1626606,22.469C0.96679688,22.469 0,21.817864 0,20.624998 0,19.428434 0.96679688,18.779999 2.1626606,18.779999L9.5252495,18.779999 9.3850002,18.617311 14.600033,11.548028C14.600033,11.548028,15.127697,11.125361,15.599133,10.798839L15.614553,10.78836 15.604,10.776026 24.149192,5.6036739 23.803184,4.9510002 14.7162,4.9510002C13.500099,4.9510002 12.514999,3.8623199 12.514999,2.6472778 12.514999,1.4298038 13.500099,0.3409996 14.7162,0.3409996z M34.6091,0C36.912666,0 38.780001,1.8671761 38.780001,4.1704998 38.780001,6.4739532 36.912666,8.3409996 34.6091,8.3409996 32.304335,8.3409996 30.437,6.4739532 30.437,4.1704998 30.437,1.8671761 32.304335,0 34.6091,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M3.3500004,28.921999L16.410999,28.921999 16.410999,29.396999 16.410999,32.959999 16.410999,38.421999 25.514,38.421999 25.514,42.458 25.495,42.458 25.495,47.602999 34.698,47.602999 34.698,51.640999 25.495,51.640999 25.495,51.671 21.458,51.671 21.458,42.458 16.410999,42.458 12.453001,42.458 12.374001,42.458 12.374001,32.959999 3.3500004,32.959999z M54.794001,20.069L59.39695,23.324425 64,26.580851 59.39695,29.837375 54.794001,33.094 54.794001,30.650999 33.583,30.650999 33.583,22.698998 54.794001,22.698998z M14.7162,0.3409996L24.9141,0.3409996C25.97705,0.3409996,26.865667,1.1746159,27.071213,2.1986313L27.086924,2.3030968 27.124624,2.3546333C27.940995,3.4717503 29.881758,6.1571293 30.565413,7.3636971 30.565413,7.3636971 34.096944,13.338465 34.877442,15.061705L34.890623,15.092 40.170837,15.092C41.324416,15.092 42.257998,16.195044 42.257998,17.396999 42.257998,18.600256 41.324416,19.702 40.170837,19.702L33.450961,19.702C32.370606,19.702,31.482553,18.733671,31.375766,17.621177L31.37387,17.581701 29.230907,13.962816 22.261399,18.123934 26.40747,22.377669C27.150276,23.141019,27.230264,24.306093,26.654201,25.155003L26.643522,25.169146 26.636381,25.286112C26.628118,25.36014,26.616044,25.434453,26.600019,25.508835L24.851152,33.574084C24.592043,34.765377 23.418798,35.519273 22.228654,35.261475 21.03861,35.004976 20.280681,33.829283 20.53979,32.64039L22.288656,24.57524 22.309726,24.495231 17.488041,19.548167 17.480572,19.539678 17.253374,19.529043C16.366886,19.445599,15.589428,19.018761,15.078829,18.394262L15.074381,18.388281 12.282196,21.977999 12.216562,21.901865 12.1124,21.994324C11.720974,22.306216,11.1803,22.469,10.5833,22.469L2.1626606,22.469C0.96679688,22.469 0,21.817864 0,20.624998 0,19.428434 0.96679688,18.779999 2.1626606,18.779999L9.5252495,18.779999 9.3850002,18.617311 14.600033,11.548028C14.600033,11.548028,15.127697,11.125361,15.599133,10.798839L15.614553,10.78836 15.604,10.776026 24.149192,5.6036739 23.803184,4.9510002 14.7162,4.9510002C13.500099,4.9510002 12.514999,3.8623199 12.514999,2.6472778 12.514999,1.4298038 13.500099,0.3409996 14.7162,0.3409996z M34.6091,0C36.912666,0 38.780001,1.8671761 38.780001,4.1704998 38.780001,6.4739532 36.912666,8.3409996 34.6091,8.3409996 32.304335,8.3409996 30.437,6.4739532 30.437,4.1704998 30.437,1.8671761 32.304335,0 34.6091,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -597,7 +597,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M55.859353,59.282085C56.00929,59.285538,56.143475,59.392647,56.172002,59.547607L55.789193,65.810493C55.674588,66.466682,55.295579,65.802589,55.295579,65.802589L54.473962,64.431519C51.7422,68.327347 47.221295,70.881996 42.101273,70.881996 36.226228,70.881996 31.13625,67.53186 28.632329,62.638653 28.382323,62.158161 28.059378,61.686871 27.969502,61.146481 27.66084,59.337914 29.858891,59.01112 30.614098,59.864002 30.926646,60.216797 31.299044,60.827484 31.563321,61.306576 33.567227,65.081306 37.533479,67.649055 42.101273,67.649055 46.122369,67.649055 49.669251,65.651596 51.828099,62.602253L50.338567,62.323559C50.338567,62.323559,49.473847,62.210258,50.067658,61.849567L55.794392,59.287113C55.816193,59.283215,55.837933,59.28159,55.859353,59.282085z M40.764077,45.717999L43.468282,45.717999 43.468282,47.945969C44.940877,48.043633,45.939504,48.464172,46.57486,48.781933L46.850839,48.919876 45.9889,51.849625 45.591931,51.649216C44.965676,51.336708 43.994244,50.849598 42.497052,50.849598 41.307038,50.849598 40.589589,51.340611 40.589589,52.155632 40.589589,52.883549 41.269242,53.390064 43.278195,54.159683 46.150391,55.237812 47.377004,56.67535 47.377004,58.964413 47.377004,61.232674 45.806714,62.99192 43.348592,63.516731L43.348592,66.047997 40.616887,66.047997 40.616887,63.706738C39.216088,63.607735,37.791692,63.200325,36.902394,62.633808L36.672002,62.482704 37.5286,59.474827 37.945279,59.724831C38.568932,60.09864 39.856541,60.726257 41.489224,60.726257 42.825127,60.726257 43.684468,60.136341 43.684468,59.230118 43.684468,58.503498 43.274297,57.873283 41.294038,57.157166 39.122395,56.362843 36.898515,55.19091 36.898515,52.516441 36.898515,50.313221 38.372449,48.646427 40.764077,48.112602z M42.010037,40.691002C47.882275,40.691002 52.973134,44.039906 55.477063,48.93552 55.725755,49.413418 56.051247,49.888626 56.139745,50.42767 56.447038,52.237579 54.249299,52.563072 53.493916,51.708893 53.181527,51.354805 52.809136,50.742821 52.546143,50.264954 50.543599,46.492958 46.577512,43.922722 42.010037,43.922722 37.98795,43.922722 34.44249,45.919983 32.28362,48.96946L33.773167,49.248013C33.773167,49.248013,34.636472,49.363979,34.044091,49.72456L28.316394,52.28698C28.141854,52.318275,27.969985,52.199879,27.940001,52.026585L28.322789,45.767639C28.43744,45.104939,28.815036,45.774227,28.815036,45.774227L29.632752,47.140041C32.366937,43.245621,36.88775,40.691002,42.010037,40.691002z M21.804616,0L44.531026,0C48.257512,0,51.280999,3.0222199,51.280999,6.7460904L51.280999,38.274937 50.537671,37.898952C49.215222,37.269638,47.812577,36.778652,46.348977,36.444992L45.879922,36.344151 45.879922,6.7460904C45.879922,6.0039101,45.273122,5.3972201,44.531026,5.3972206L22.158713,5.3972206 21.794215,17.167999C21.794215,17.167999,21.325417,24.9519,12.747249,24.0117L5.3957184,23.8125 5.3957184,57.253899C5.3957189,57.998699,6.0024966,58.602901,6.7473038,58.602901L21.820422,58.602901 21.860354,58.884754C22.115357,60.533066,22.574946,62.114872,23.212727,63.604115L23.393945,64 6.7473038,64C3.0207885,64,2.9307267E-07,60.980499,0,57.253899L0,23.0051 2.6718498,20.1863 2.6743804,20.1094 16.677035,5.3972206 16.637936,5.3972206 12.89565,9.3464394 16.817534,5.1914101 16.872334,5.1914101 16.997233,5.0612788 17.007634,5.0612788z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M55.859353,59.282085C56.00929,59.285538,56.143475,59.392647,56.172002,59.547607L55.789193,65.810493C55.674588,66.466682,55.295579,65.802589,55.295579,65.802589L54.473962,64.431519C51.7422,68.327347 47.221295,70.881996 42.101273,70.881996 36.226228,70.881996 31.13625,67.53186 28.632329,62.638653 28.382323,62.158161 28.059378,61.686871 27.969502,61.146481 27.66084,59.337914 29.858891,59.01112 30.614098,59.864002 30.926646,60.216797 31.299044,60.827484 31.563321,61.306576 33.567227,65.081306 37.533479,67.649055 42.101273,67.649055 46.122369,67.649055 49.669251,65.651596 51.828099,62.602253L50.338567,62.323559C50.338567,62.323559,49.473847,62.210258,50.067658,61.849567L55.794392,59.287113C55.816193,59.283215,55.837933,59.28159,55.859353,59.282085z M40.764077,45.717999L43.468282,45.717999 43.468282,47.945969C44.940877,48.043633,45.939504,48.464172,46.57486,48.781933L46.850839,48.919876 45.9889,51.849625 45.591931,51.649216C44.965676,51.336708 43.994244,50.849598 42.497052,50.849598 41.307038,50.849598 40.589589,51.340611 40.589589,52.155632 40.589589,52.883549 41.269242,53.390064 43.278195,54.159683 46.150391,55.237812 47.377004,56.67535 47.377004,58.964413 47.377004,61.232674 45.806714,62.99192 43.348592,63.516731L43.348592,66.047997 40.616887,66.047997 40.616887,63.706738C39.216088,63.607735,37.791692,63.200325,36.902394,62.633808L36.672002,62.482704 37.5286,59.474827 37.945279,59.724831C38.568932,60.09864 39.856541,60.726257 41.489224,60.726257 42.825127,60.726257 43.684468,60.136341 43.684468,59.230118 43.684468,58.503498 43.274297,57.873283 41.294038,57.157166 39.122395,56.362843 36.898515,55.19091 36.898515,52.516441 36.898515,50.313221 38.372449,48.646427 40.764077,48.112602z M42.010037,40.691002C47.882275,40.691002 52.973134,44.039906 55.477063,48.93552 55.725755,49.413418 56.051247,49.888626 56.139745,50.42767 56.447038,52.237579 54.249299,52.563072 53.493916,51.708893 53.181527,51.354805 52.809136,50.742821 52.546143,50.264954 50.543599,46.492958 46.577512,43.922722 42.010037,43.922722 37.98795,43.922722 34.44249,45.919983 32.28362,48.96946L33.773167,49.248013C33.773167,49.248013,34.636472,49.363979,34.044091,49.72456L28.316394,52.28698C28.141854,52.318275,27.969985,52.199879,27.940001,52.026585L28.322789,45.767639C28.43744,45.104939,28.815036,45.774227,28.815036,45.774227L29.632752,47.140041C32.366937,43.245621,36.88775,40.691002,42.010037,40.691002z M21.804616,0L44.531026,0C48.257512,0,51.280999,3.0222199,51.280999,6.7460904L51.280999,38.274937 50.537671,37.898952C49.215222,37.269638,47.812577,36.778652,46.348977,36.444992L45.879922,36.344151 45.879922,6.7460904C45.879922,6.0039101,45.273122,5.3972201,44.531026,5.3972206L22.158713,5.3972206 21.794215,17.167999C21.794215,17.167999,21.325417,24.9519,12.747249,24.0117L5.3957184,23.8125 5.3957184,57.253899C5.3957189,57.998699,6.0024966,58.602901,6.7473038,58.602901L21.820422,58.602901 21.860354,58.884754C22.115357,60.533066,22.574946,62.114872,23.212727,63.604115L23.393945,64 6.7473038,64C3.0207885,64,2.9307267E-07,60.980499,0,57.253899L0,23.0051 2.6718498,20.1863 2.6743804,20.1094 16.677035,5.3972206 16.637936,5.3972206 12.89565,9.3464394 16.817534,5.1914101 16.872334,5.1914101 16.997233,5.0612788 17.007634,5.0612788z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -607,7 +607,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="F1M70.546875,54.3758316040039L77.484375,54.3758316040039 77.484375,89.0633316040039 70.546875,89.0633316040039 70.546875,54.3758316040039z M48.5625,54.3758316040039L65.90625,71.7195816040039 48.5625,89.0633316040039 48.5625,75.1883316040039 8.109375,75.1883316040039 8.109375,68.2508316040039 48.5625,68.2508316040039 48.5625,54.3758316040039z M37.03125,19.6883316040039L37.03125,33.5633316040039 77.484375,33.5633316040039 77.484375,40.5008316040039 37.03125,40.5008316040039 37.03125,54.3758316040039 19.6875,37.0320816040039 37.03125,19.6883316040039z M8.109375,19.6883316040039L15.046875,19.6883316040039 15.046875,54.3758316040039 8.109375,54.3758316040039 8.109375,19.6883316040039z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="F1M70.546875,54.3758316040039L77.484375,54.3758316040039 77.484375,89.0633316040039 70.546875,89.0633316040039 70.546875,54.3758316040039z M48.5625,54.3758316040039L65.90625,71.7195816040039 48.5625,89.0633316040039 48.5625,75.1883316040039 8.109375,75.1883316040039 8.109375,68.2508316040039 48.5625,68.2508316040039 48.5625,54.3758316040039z M37.03125,19.6883316040039L37.03125,33.5633316040039 77.484375,33.5633316040039 77.484375,40.5008316040039 37.03125,40.5008316040039 37.03125,54.3758316040039 19.6875,37.0320816040039 37.03125,19.6883316040039z M8.109375,19.6883316040039L15.046875,19.6883316040039 15.046875,54.3758316040039 8.109375,54.3758316040039 8.109375,19.6883316040039z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -617,7 +617,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M0,27.006001L37.806999,27.006001 37.806999,31.806 0,31.806z M0,18.003L37.806999,18.003 37.806999,22.806 0,22.806z M0,8.9999999L37.806999,8.9999999 37.806999,13.803 0,13.803z M0,0L37.806999,0 37.806999,4.8030009 0,4.8030009z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M0,27.006001L37.806999,27.006001 37.806999,31.806 0,31.806z M0,18.003L37.806999,18.003 37.806999,22.806 0,22.806z M0,8.9999999L37.806999,8.9999999 37.806999,13.803 0,13.803z M0,0L37.806999,0 37.806999,4.8030009 0,4.8030009z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -627,7 +627,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M -2.7407407 21.999952 V 25 H 11.37037 v -3.000048 z m 0 -4.999952 v 2.999952 H 11.37037 V 17 Z m 0 -5 v 3 H 11.37037 v -3 z m 0 -5 v 3 H 11.37037 V 7 Z m -1 -7 c 0.552 0 1.0810413 0.45297098 1 1 V 5 H 11.37037 V 1 c 0 -0.5529995 0.448 -1 1 -1 0.552 0 1 0.4470005 1 1 0 11.544484 0 19.62158 0 30 0 0.553 -0.448 1 -1 1 -0.552 0 -0.918958 -0.45297 -1 -1 V 27 H -2.7407407 v 4 c 0 0.553 -0.448 1 -1 1 -0.552 0 -1 -0.447 -1 -1 0 -11.54448 0 -19.621581 0 -30 0 -0.5529995 0.448 -1 1 -1 z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M -2.7407407 21.999952 V 25 H 11.37037 v -3.000048 z m 0 -4.999952 v 2.999952 H 11.37037 V 17 Z m 0 -5 v 3 H 11.37037 v -3 z m 0 -5 v 3 H 11.37037 V 7 Z m -1 -7 c 0.552 0 1.0810413 0.45297098 1 1 V 5 H 11.37037 V 1 c 0 -0.5529995 0.448 -1 1 -1 0.552 0 1 0.4470005 1 1 0 11.544484 0 19.62158 0 30 0 0.553 -0.448 1 -1 1 -0.552 0 -0.918958 -0.45297 -1 -1 V 27 H -2.7407407 v 4 c 0 0.553 -0.448 1 -1 1 -0.552 0 -1 -0.447 -1 -1 0 -11.54448 0 -19.621581 0 -30 0 -0.5529995 0.448 -1 1 -1 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -637,7 +637,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M50.14375,33.389126C50.416863,33.394688,50.653496,33.587773,50.705998,33.864617L50.015995,45.114388C49.810295,46.291462,49.130394,45.097489,49.130394,45.097489L47.65659,42.640538C42.747776,49.635197 34.633152,54.221001 25.433924,54.221001 14.884193,54.221001 5.7437552,48.204125 1.2449617,39.419205 0.80087067,38.552021 0.21358696,37.705738 0.052086769,36.736958 -0.49735315,33.490925 3.4507786,32.901036 4.8049124,34.432404 5.3674143,35.067692 6.034036,36.16407 6.5079177,37.026051 10.106778,43.799416 17.2321,48.413819 25.433924,48.413819 32.656544,48.413819 39.026364,44.826695 42.903977,39.351506L40.229367,38.854115C40.229367,38.854115,38.677464,38.647118,39.742466,37.996033L50.024895,33.398526C50.064972,33.391365,50.104733,33.388333,50.14375,33.389126z M23.030291,9.0310004L27.889918,9.0310004 27.889918,13.028299C30.539786,13.205498,32.324932,13.958096,33.464161,14.528294L33.964176,14.775793 32.417435,20.038878 31.706417,19.68068C30.579987,19.11958 28.839241,18.244583 26.149073,18.244583 24.006916,18.244583 22.723183,19.122181 22.723183,20.590876 22.723183,21.894272 23.943314,22.804369 27.551308,24.187165 32.706444,26.124659 34.911,28.702853 34.911,32.817341 34.911,36.892929 32.090527,40.05172 27.673611,40.989117L27.673611,45.540001 22.767485,45.540001 22.767485,41.330414C20.252919,41.155815,17.695551,40.424118,16.101811,39.404721L15.683999,39.137619 17.221739,33.731438 17.969059,34.180634C19.088988,34.851235 21.402748,35.97873 24.340325,35.97873 26.734886,35.97873 28.276728,34.921635 28.276728,33.291336 28.276728,31.986641 27.547409,30.853846 23.986016,29.57255 20.083815,28.144253 16.095511,26.04406 16.095511,21.239174 16.095511,17.280985 18.737379,14.291395 23.030291,13.329098z M25.268765,0C35.819447,2.7347414E-07 44.961449,6.0155495 49.458798,14.804573 49.902695,15.669173 50.490094,16.516972 50.651287,17.48427 51.198281,20.734265 47.255726,21.318962 45.901341,19.789065 45.336346,19.153567 44.669552,18.051968 44.19566,17.19517 40.5957,10.421881 33.473275,5.8072398 25.268765,5.8072393 18.047545,5.8072398 11.678013,9.3918336 7.8003562,14.867073L10.474627,15.367072C10.474627,15.367072,12.026909,15.574172,10.962921,16.223872L0.67933281,20.826762C0.36037083,20.880062,0.057029126,20.669165,0.00099972012,20.354063L0.69093342,9.1118043C0.89552094,7.9296158,1.5738537,9.124924,1.5738539,9.124924L3.0452772,11.583379C7.9566038,4.584462,16.073666,2.7347414E-07,25.268765,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M50.14375,33.389126C50.416863,33.394688,50.653496,33.587773,50.705998,33.864617L50.015995,45.114388C49.810295,46.291462,49.130394,45.097489,49.130394,45.097489L47.65659,42.640538C42.747776,49.635197 34.633152,54.221001 25.433924,54.221001 14.884193,54.221001 5.7437552,48.204125 1.2449617,39.419205 0.80087067,38.552021 0.21358696,37.705738 0.052086769,36.736958 -0.49735315,33.490925 3.4507786,32.901036 4.8049124,34.432404 5.3674143,35.067692 6.034036,36.16407 6.5079177,37.026051 10.106778,43.799416 17.2321,48.413819 25.433924,48.413819 32.656544,48.413819 39.026364,44.826695 42.903977,39.351506L40.229367,38.854115C40.229367,38.854115,38.677464,38.647118,39.742466,37.996033L50.024895,33.398526C50.064972,33.391365,50.104733,33.388333,50.14375,33.389126z M23.030291,9.0310004L27.889918,9.0310004 27.889918,13.028299C30.539786,13.205498,32.324932,13.958096,33.464161,14.528294L33.964176,14.775793 32.417435,20.038878 31.706417,19.68068C30.579987,19.11958 28.839241,18.244583 26.149073,18.244583 24.006916,18.244583 22.723183,19.122181 22.723183,20.590876 22.723183,21.894272 23.943314,22.804369 27.551308,24.187165 32.706444,26.124659 34.911,28.702853 34.911,32.817341 34.911,36.892929 32.090527,40.05172 27.673611,40.989117L27.673611,45.540001 22.767485,45.540001 22.767485,41.330414C20.252919,41.155815,17.695551,40.424118,16.101811,39.404721L15.683999,39.137619 17.221739,33.731438 17.969059,34.180634C19.088988,34.851235 21.402748,35.97873 24.340325,35.97873 26.734886,35.97873 28.276728,34.921635 28.276728,33.291336 28.276728,31.986641 27.547409,30.853846 23.986016,29.57255 20.083815,28.144253 16.095511,26.04406 16.095511,21.239174 16.095511,17.280985 18.737379,14.291395 23.030291,13.329098z M25.268765,0C35.819447,2.7347414E-07 44.961449,6.0155495 49.458798,14.804573 49.902695,15.669173 50.490094,16.516972 50.651287,17.48427 51.198281,20.734265 47.255726,21.318962 45.901341,19.789065 45.336346,19.153567 44.669552,18.051968 44.19566,17.19517 40.5957,10.421881 33.473275,5.8072398 25.268765,5.8072393 18.047545,5.8072398 11.678013,9.3918336 7.8003562,14.867073L10.474627,15.367072C10.474627,15.367072,12.026909,15.574172,10.962921,16.223872L0.67933281,20.826762C0.36037083,20.880062,0.057029126,20.669165,0.00099972012,20.354063L0.69093342,9.1118043C0.89552094,7.9296158,1.5738537,9.124924,1.5738539,9.124924L3.0452772,11.583379C7.9566038,4.584462,16.073666,2.7347414E-07,25.268765,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -647,7 +647,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M22.1575,13.53399L21.794301,25.304994C21.794301,25.304994,21.3242,33.088695,12.747401,32.148692L5.3958107,31.949492 5.3958107,65.390895C5.3958107,66.135493,6.0026208,66.7391,6.7473808,66.7391L44.5313,66.7391C45.2734,66.7391,45.8802,66.135493,45.8802,65.390895L45.8802,14.883091C45.8802,14.140891,45.2734,13.53399,44.5313,13.53399z M21.804701,8.1369996L44.5313,8.1369996C48.257802,8.1370001,51.279999,11.15899,51.279999,14.883091L51.279999,65.390895C51.279999,69.117496,48.257802,72.136996,44.5313,72.136996L6.7473808,72.136996C3.0208105,72.136996,5.8073994E-07,69.117496,0,65.390895L0,31.142392 2.6718808,28.322993 2.6745006,28.246392 16.6771,13.53399 16.638001,13.53399 12.8945,17.483192 16.816401,13.328391 16.872401,13.328391 16.9961,13.19799 17.0078,13.19799z M30.352,0L55.255002,0 60.581002,0 60.581002,4.747 60.581002,55.207999 55.255002,55.207999 55.255002,4.747 30.352,4.747z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M22.1575,13.53399L21.794301,25.304994C21.794301,25.304994,21.3242,33.088695,12.747401,32.148692L5.3958107,31.949492 5.3958107,65.390895C5.3958107,66.135493,6.0026208,66.7391,6.7473808,66.7391L44.5313,66.7391C45.2734,66.7391,45.8802,66.135493,45.8802,65.390895L45.8802,14.883091C45.8802,14.140891,45.2734,13.53399,44.5313,13.53399z M21.804701,8.1369996L44.5313,8.1369996C48.257802,8.1370001,51.279999,11.15899,51.279999,14.883091L51.279999,65.390895C51.279999,69.117496,48.257802,72.136996,44.5313,72.136996L6.7473808,72.136996C3.0208105,72.136996,5.8073994E-07,69.117496,0,65.390895L0,31.142392 2.6718808,28.322993 2.6745006,28.246392 16.6771,13.53399 16.638001,13.53399 12.8945,17.483192 16.816401,13.328391 16.872401,13.328391 16.9961,13.19799 17.0078,13.19799z M30.352,0L55.255002,0 60.581002,0 60.581002,4.747 60.581002,55.207999 55.255002,55.207999 55.255002,4.747 30.352,4.747z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -671,7 +671,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M17.9349,52.632801L13.5176,60.285198 22.3529,60.285198z M4.1452103,50.3647L4.1452103,52.622398 59.855499,52.622398 59.855499,50.3647z M17.062819,7.9790001L21.601147,36.012657 25.301687,19.424307 28.011845,37.14275 33.26696,12.41387 36.744106,37.14275 40.357449,27.929331 43.067604,37.14275 46.822746,19.489307 50.89698,37.14275 56.015999,23.676769 56.015999,42.608997 8.1710005,42.608997 8.1710005,23.135174 13.86557,31.999594z M4.1452103,3.8098803L4.1452103,45.6199 59.855499,45.6199 59.855499,3.8098803z M0,0L64,0 64,64 0,64z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M17.9349,52.632801L13.5176,60.285198 22.3529,60.285198z M4.1452103,50.3647L4.1452103,52.622398 59.855499,52.622398 59.855499,50.3647z M17.062819,7.9790001L21.601147,36.012657 25.301687,19.424307 28.011845,37.14275 33.26696,12.41387 36.744106,37.14275 40.357449,27.929331 43.067604,37.14275 46.822746,19.489307 50.89698,37.14275 56.015999,23.676769 56.015999,42.608997 8.1710005,42.608997 8.1710005,23.135174 13.86557,31.999594z M4.1452103,3.8098803L4.1452103,45.6199 59.855499,45.6199 59.855499,3.8098803z M0,0L64,0 64,64 0,64z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -681,7 +681,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M18.660349,20.393C14.879011,20.393 11.806,23.468643 11.806,27.249899 11.806,31.026154 14.879011,34.103001 18.660349,34.103001 22.444386,34.103001 25.519998,31.026154 25.519998,27.249899 25.519998,23.468643 22.444386,20.393 18.660349,20.393z M50.07317,8.7561953C49.408178,8.7706149 48.735172,8.9156297 48.090648,9.2053407 45.51765,10.359123 44.36155,13.394207 45.51765,15.96858 46.671449,18.541552 49.709146,19.691384 52.283444,18.540251 54.856342,17.378819 56.012442,14.352736 54.856342,11.771862 53.990993,9.8450501 52.068145,8.7129386 50.07317,8.7561953z M15.597473,8.6000007L21.868224,8.6000007 22.20032,14.327933 22.20032,14.531032C23.236712,14.816134,24.218506,15.221134,25.133898,15.736836L25.253695,15.615635 29.675461,11.900828 34.111725,16.338337 30.296556,20.624846 30.165057,20.758946C30.683352,21.674349,31.08955,22.659951,31.378649,23.696451L31.544045,23.696451 37.293999,24.196451 37.293999,30.468565 31.566147,30.803267 31.378649,30.803267C31.08955,31.836972,30.683352,32.821373,30.165057,33.736874L30.280955,33.853974 33.993225,38.274582 29.558261,42.709496 25.271895,38.896988 25.133898,38.758988C24.218506,39.274586,23.236712,39.678185,22.20032,39.963387L22.20032,40.146988 21.868224,45.897 15.597473,45.897 15.093578,40.166485 15.093578,39.959488C14.064985,39.671688,13.084595,39.265385,12.174301,38.749787L12.040102,38.881485 7.7381763,42.709496 3.3033104,38.274582 6.9999428,33.869675 7.1522102,33.721176C6.6379356,32.807072,6.2343292,31.83057,5.9464817,30.803267L5.7499523,30.803267 0,30.468565 0,24.196451 5.7278118,23.696451 5.9464817,23.696451C6.2343292,22.665051,6.6379356,21.687248,7.1522102,20.775946L7.0128822,20.640444 3.1874237,16.338337 7.6209869,11.900828 12.027203,15.600036 12.174301,15.744536C13.084595,15.231535,14.064985,14.825334,15.093578,14.537533L15.093578,14.350033z M52.888157,0L57.259197,1.6601361 56.091211,5.7941664 56.035212,5.937414C56.665401,6.3971274,57.240894,6.9413698,57.753986,7.5533617L57.878984,7.4947021 61.949226,6.0845716 63.865797,10.35405 60.071657,12.331821 59.933659,12.393021C60.053354,13.18731,60.075457,13.977598,60.003952,14.758987L60.12245,14.803286 63.999998,16.682059 62.337223,21.053194 58.253977,19.771912 58.12108,19.721113C57.656389,20.352705,57.112095,20.928097,56.496105,21.441189L56.549604,21.556988 57.962284,25.627228 53.691446,27.541302 51.712375,23.744456 51.653774,23.615557C50.862186,23.736756,50.066597,23.760056,49.285309,23.687157L49.241009,23.800455 47.366036,27.678 42.991099,26.017823 44.277584,21.928082 44.325682,21.799183C43.696789,21.334391,43.121297,20.784899,42.607106,20.171606L42.487208,20.225006 38.469066,21.753483 36.553693,17.486847 40.297138,15.390477 40.441637,15.327978C40.321941,14.53499,40.299839,13.744601,40.372736,12.963413L40.24384,12.915114 36.321998,11.158738 37.984774,6.7851217 42.113513,7.9530752 42.263212,8.009104C42.728206,7.3840535,43.269797,6.8124616,43.879186,6.3033789L43.82189,6.1652506 42.29051,2.1496897 46.562749,0.22918414 48.656518,3.977782 48.722916,4.1289099C49.511906,4.0091622,50.299695,3.9843827,51.075585,4.0534113L51.127785,3.9218233z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M18.660349,20.393C14.879011,20.393 11.806,23.468643 11.806,27.249899 11.806,31.026154 14.879011,34.103001 18.660349,34.103001 22.444386,34.103001 25.519998,31.026154 25.519998,27.249899 25.519998,23.468643 22.444386,20.393 18.660349,20.393z M50.07317,8.7561953C49.408178,8.7706149 48.735172,8.9156297 48.090648,9.2053407 45.51765,10.359123 44.36155,13.394207 45.51765,15.96858 46.671449,18.541552 49.709146,19.691384 52.283444,18.540251 54.856342,17.378819 56.012442,14.352736 54.856342,11.771862 53.990993,9.8450501 52.068145,8.7129386 50.07317,8.7561953z M15.597473,8.6000007L21.868224,8.6000007 22.20032,14.327933 22.20032,14.531032C23.236712,14.816134,24.218506,15.221134,25.133898,15.736836L25.253695,15.615635 29.675461,11.900828 34.111725,16.338337 30.296556,20.624846 30.165057,20.758946C30.683352,21.674349,31.08955,22.659951,31.378649,23.696451L31.544045,23.696451 37.293999,24.196451 37.293999,30.468565 31.566147,30.803267 31.378649,30.803267C31.08955,31.836972,30.683352,32.821373,30.165057,33.736874L30.280955,33.853974 33.993225,38.274582 29.558261,42.709496 25.271895,38.896988 25.133898,38.758988C24.218506,39.274586,23.236712,39.678185,22.20032,39.963387L22.20032,40.146988 21.868224,45.897 15.597473,45.897 15.093578,40.166485 15.093578,39.959488C14.064985,39.671688,13.084595,39.265385,12.174301,38.749787L12.040102,38.881485 7.7381763,42.709496 3.3033104,38.274582 6.9999428,33.869675 7.1522102,33.721176C6.6379356,32.807072,6.2343292,31.83057,5.9464817,30.803267L5.7499523,30.803267 0,30.468565 0,24.196451 5.7278118,23.696451 5.9464817,23.696451C6.2343292,22.665051,6.6379356,21.687248,7.1522102,20.775946L7.0128822,20.640444 3.1874237,16.338337 7.6209869,11.900828 12.027203,15.600036 12.174301,15.744536C13.084595,15.231535,14.064985,14.825334,15.093578,14.537533L15.093578,14.350033z M52.888157,0L57.259197,1.6601361 56.091211,5.7941664 56.035212,5.937414C56.665401,6.3971274,57.240894,6.9413698,57.753986,7.5533617L57.878984,7.4947021 61.949226,6.0845716 63.865797,10.35405 60.071657,12.331821 59.933659,12.393021C60.053354,13.18731,60.075457,13.977598,60.003952,14.758987L60.12245,14.803286 63.999998,16.682059 62.337223,21.053194 58.253977,19.771912 58.12108,19.721113C57.656389,20.352705,57.112095,20.928097,56.496105,21.441189L56.549604,21.556988 57.962284,25.627228 53.691446,27.541302 51.712375,23.744456 51.653774,23.615557C50.862186,23.736756,50.066597,23.760056,49.285309,23.687157L49.241009,23.800455 47.366036,27.678 42.991099,26.017823 44.277584,21.928082 44.325682,21.799183C43.696789,21.334391,43.121297,20.784899,42.607106,20.171606L42.487208,20.225006 38.469066,21.753483 36.553693,17.486847 40.297138,15.390477 40.441637,15.327978C40.321941,14.53499,40.299839,13.744601,40.372736,12.963413L40.24384,12.915114 36.321998,11.158738 37.984774,6.7851217 42.113513,7.9530752 42.263212,8.009104C42.728206,7.3840535,43.269797,6.8124616,43.879186,6.3033789L43.82189,6.1652506 42.29051,2.1496897 46.562749,0.22918414 48.656518,3.977782 48.722916,4.1289099C49.511906,4.0091622,50.299695,3.9843827,51.075585,4.0534113L51.127785,3.9218233z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -691,7 +691,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M33.597977,10.759002C37.946865,10.759002 41.485962,14.285001 41.485962,18.649 41.485962,23 37.946865,26.535 33.597977,26.535 29.23909,26.535 25.709992,23 25.709992,18.649 25.709992,17.784 25.849955,16.953001 26.109888,16.174002 26.779719,16.881001 27.70948,17.327002 28.759213,17.327002 30.778696,17.327002 32.418278,15.691001 32.418278,13.668001 32.418278,12.663001 32.008381,11.748001 31.348551,11.087002 32.058369,10.876001 32.818176,10.759002 33.597977,10.759002z M33.606682,4.3679962C25.92741,4.3679957 19.698065,10.594956 19.698065,18.27293 19.698065,25.953894 25.92741,32.177862 33.606682,32.177862 41.295838,32.177862 47.515175,25.953894 47.515175,18.27293 47.515175,10.594956 41.295838,4.3679957 33.606682,4.3679962z M34.867642,1.546141E-09C36.890393,2.6508449E-05 58.705193,0.41938579 68.893006,18.299923 68.893006,18.299923 57.1442,36.139837 34.44656,34.768854 34.44656,34.768854 14.428583,36.59984 0,18.299923 0,18.299923 9.0791523,0.4590019 34.716553,0.0010111886 34.716553,0.0010114873 34.768162,-1.4442128E-06 34.867642,1.546141E-09z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M33.597977,10.759002C37.946865,10.759002 41.485962,14.285001 41.485962,18.649 41.485962,23 37.946865,26.535 33.597977,26.535 29.23909,26.535 25.709992,23 25.709992,18.649 25.709992,17.784 25.849955,16.953001 26.109888,16.174002 26.779719,16.881001 27.70948,17.327002 28.759213,17.327002 30.778696,17.327002 32.418278,15.691001 32.418278,13.668001 32.418278,12.663001 32.008381,11.748001 31.348551,11.087002 32.058369,10.876001 32.818176,10.759002 33.597977,10.759002z M33.606682,4.3679962C25.92741,4.3679957 19.698065,10.594956 19.698065,18.27293 19.698065,25.953894 25.92741,32.177862 33.606682,32.177862 41.295838,32.177862 47.515175,25.953894 47.515175,18.27293 47.515175,10.594956 41.295838,4.3679957 33.606682,4.3679962z M34.867642,1.546141E-09C36.890393,2.6508449E-05 58.705193,0.41938579 68.893006,18.299923 68.893006,18.299923 57.1442,36.139837 34.44656,34.768854 34.44656,34.768854 14.428583,36.59984 0,18.299923 0,18.299923 9.0791523,0.4590019 34.716553,0.0010111886 34.716553,0.0010114873 34.768162,-1.4442128E-06 34.867642,1.546141E-09z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -701,7 +701,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M3.3390064,47.374004L26.00104,47.374004C26.17504,47.881321 26.361041,48.388939 26.575041,48.889757 27.610043,51.333344 29.086045,53.523722 30.968048,55.406689 31.135048,55.573593 31.309048,55.733997 31.476048,55.894005L3.3390064,55.894005C1.4960022,55.894005,0,54.398552,0,52.555387L0,50.712622C0,48.869556,1.4960022,47.374004,3.3390064,47.374004z M8.6740417,35.422004L25.713049,35.422004C25.220049,37.198282 24.972049,39.03446 24.972049,40.910738 24.972049,41.932125 25.046049,42.947113 25.193049,43.942001L8.6740417,43.942001C6.8310413,43.942001,5.3350391,42.44632,5.3350391,40.60354L5.3350391,38.760464C5.3350391,36.917886,6.8310413,35.422004,8.6740417,35.422004z M44.333998,28.91725L44.333998,31.014374C42.649975,31.25297 41.419993,31.901375 40.634958,32.963784 39.852975,34.026392 39.458993,35.225903 39.458993,36.554114 39.458993,37.565422 39.677987,38.455833 40.118966,39.221838 40.555979,39.98354 41.125986,40.573252 41.829967,40.99555 42.53297,41.425255 43.508984,41.850658 44.758986,42.28466 46.149979,42.776463 47.048965,43.183067 47.451004,43.502871 47.852982,43.819578 48.055986,44.291979 48.055986,44.913282 48.055986,45.51469 47.852982,46.022491 47.451004,46.448399 47.048965,46.874603 46.41597,47.0849 45.560011,47.0849 43.728954,47.0849 42.649975,46.093193 42.325999,44.11248L38.810005,45.030586C39.521005,48.178713,41.360971,49.909225,44.333998,50.214329L44.333998,52.91765 46.607986,52.91765 46.607986,50.202824C48.391985,50.015223 49.755999,49.390217 50.701008,48.33131 51.646992,47.273104 52.118979,45.952789 52.118979,44.36648 52.118979,43.331467 51.888998,42.429262 51.431965,41.65526 50.970966,40.886349 50.360981,40.276442 49.59096,39.839542 48.826006,39.401939 47.763016,38.933239 46.41597,38.440628 45.185011,37.991329 44.384962,37.612823 44.008986,37.307821 43.633984,36.999621 43.446972,36.561912 43.446972,35.991115 43.446972,35.429106 43.641979,34.952402 44.032972,34.558096 44.419996,34.163196 44.935011,33.967896 45.576002,33.967896 46.85701,33.967896 47.797989,34.850602 48.407976,36.612617L51.545002,35.327107C50.795002,32.756988,49.14699,31.319575,46.607986,31.015068L46.607986,28.91725z M3.3390026,23.690004L34.347016,23.690004C33.139015,24.471167 32.010015,25.379241 30.975014,26.414426 29.286014,28.103764 27.917013,30.053523 26.909013,32.203998L3.3390026,32.203998C1.4960022,32.203998,0,30.708376,0,28.865226L0,27.028776C0,25.185925,1.4960022,23.690004,3.3390026,23.690004z M45.470961,22.415C55.686974,22.415 63.96701,30.694868 63.959991,40.924053 63.959991,51.140034 55.680992,59.419998 45.464003,59.419998 41.41096,59.419998 37.659003,58.110893 34.613955,55.900974 31.696961,53.777658 29.412962,50.819633 28.130979,47.380901 27.716977,46.285692 27.408993,45.137482 27.215939,43.948774 27.055966,42.96047 26.96899,41.952459 26.968991,40.917248 26.96899,39.007633 27.255978,37.164823 27.796994,35.428709 28.150998,34.306995 28.597959,33.23199 29.145994,32.210482 31.195984,28.371248 34.553958,25.346428 38.626961,23.723612 40.743967,22.882503 43.053967,22.415 45.470961,22.415z M3.3390045,11.952L38.153052,11.952C39.996056,11.952,41.492057,13.448001,41.492057,15.290001L41.492057,17.133002C41.492057,18.976003,39.996056,20.472003,38.153052,20.472004L3.3390045,20.472004C1.4960022,20.472003,0,18.976003,0,17.133002L0,15.290001C0,13.448001,1.4960022,11.952,3.3390045,11.952z M8.6735134,0L43.487543,0C45.330534,0,46.826027,1.4958782,46.826027,3.3386841L46.826027,5.1814384C46.826027,7.0245428,45.330534,8.5200005,43.487543,8.5200005L8.6735134,8.5200005C6.8304424,8.5200005,5.3350277,7.0245428,5.3350277,5.1814384L5.3350277,3.3386841C5.3350277,1.4958782,6.8304424,0,8.6735134,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M3.3390064,47.374004L26.00104,47.374004C26.17504,47.881321 26.361041,48.388939 26.575041,48.889757 27.610043,51.333344 29.086045,53.523722 30.968048,55.406689 31.135048,55.573593 31.309048,55.733997 31.476048,55.894005L3.3390064,55.894005C1.4960022,55.894005,0,54.398552,0,52.555387L0,50.712622C0,48.869556,1.4960022,47.374004,3.3390064,47.374004z M8.6740417,35.422004L25.713049,35.422004C25.220049,37.198282 24.972049,39.03446 24.972049,40.910738 24.972049,41.932125 25.046049,42.947113 25.193049,43.942001L8.6740417,43.942001C6.8310413,43.942001,5.3350391,42.44632,5.3350391,40.60354L5.3350391,38.760464C5.3350391,36.917886,6.8310413,35.422004,8.6740417,35.422004z M44.333998,28.91725L44.333998,31.014374C42.649975,31.25297 41.419993,31.901375 40.634958,32.963784 39.852975,34.026392 39.458993,35.225903 39.458993,36.554114 39.458993,37.565422 39.677987,38.455833 40.118966,39.221838 40.555979,39.98354 41.125986,40.573252 41.829967,40.99555 42.53297,41.425255 43.508984,41.850658 44.758986,42.28466 46.149979,42.776463 47.048965,43.183067 47.451004,43.502871 47.852982,43.819578 48.055986,44.291979 48.055986,44.913282 48.055986,45.51469 47.852982,46.022491 47.451004,46.448399 47.048965,46.874603 46.41597,47.0849 45.560011,47.0849 43.728954,47.0849 42.649975,46.093193 42.325999,44.11248L38.810005,45.030586C39.521005,48.178713,41.360971,49.909225,44.333998,50.214329L44.333998,52.91765 46.607986,52.91765 46.607986,50.202824C48.391985,50.015223 49.755999,49.390217 50.701008,48.33131 51.646992,47.273104 52.118979,45.952789 52.118979,44.36648 52.118979,43.331467 51.888998,42.429262 51.431965,41.65526 50.970966,40.886349 50.360981,40.276442 49.59096,39.839542 48.826006,39.401939 47.763016,38.933239 46.41597,38.440628 45.185011,37.991329 44.384962,37.612823 44.008986,37.307821 43.633984,36.999621 43.446972,36.561912 43.446972,35.991115 43.446972,35.429106 43.641979,34.952402 44.032972,34.558096 44.419996,34.163196 44.935011,33.967896 45.576002,33.967896 46.85701,33.967896 47.797989,34.850602 48.407976,36.612617L51.545002,35.327107C50.795002,32.756988,49.14699,31.319575,46.607986,31.015068L46.607986,28.91725z M3.3390026,23.690004L34.347016,23.690004C33.139015,24.471167 32.010015,25.379241 30.975014,26.414426 29.286014,28.103764 27.917013,30.053523 26.909013,32.203998L3.3390026,32.203998C1.4960022,32.203998,0,30.708376,0,28.865226L0,27.028776C0,25.185925,1.4960022,23.690004,3.3390026,23.690004z M45.470961,22.415C55.686974,22.415 63.96701,30.694868 63.959991,40.924053 63.959991,51.140034 55.680992,59.419998 45.464003,59.419998 41.41096,59.419998 37.659003,58.110893 34.613955,55.900974 31.696961,53.777658 29.412962,50.819633 28.130979,47.380901 27.716977,46.285692 27.408993,45.137482 27.215939,43.948774 27.055966,42.96047 26.96899,41.952459 26.968991,40.917248 26.96899,39.007633 27.255978,37.164823 27.796994,35.428709 28.150998,34.306995 28.597959,33.23199 29.145994,32.210482 31.195984,28.371248 34.553958,25.346428 38.626961,23.723612 40.743967,22.882503 43.053967,22.415 45.470961,22.415z M3.3390045,11.952L38.153052,11.952C39.996056,11.952,41.492057,13.448001,41.492057,15.290001L41.492057,17.133002C41.492057,18.976003,39.996056,20.472003,38.153052,20.472004L3.3390045,20.472004C1.4960022,20.472003,0,18.976003,0,17.133002L0,15.290001C0,13.448001,1.4960022,11.952,3.3390045,11.952z M8.6735134,0L43.487543,0C45.330534,0,46.826027,1.4958782,46.826027,3.3386841L46.826027,5.1814384C46.826027,7.0245428,45.330534,8.5200005,43.487543,8.5200005L8.6735134,8.5200005C6.8304424,8.5200005,5.3350277,7.0245428,5.3350277,5.1814384L5.3350277,3.3386841C5.3350277,1.4958782,6.8304424,0,8.6735134,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -711,7 +711,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black"
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M14.200889,0C15.299896,0 16.59991,0.50000046 17.998923,1.4989944 19.597936,2.5990016 20.397944,4.5970043 21.196948,6.4960083 22.495954,9.6950015 23.495961,11.693005 26.093989,11.594006 26.793992,11.594006 27.293996,12.093014 27.293996,12.693005 27.293996,13.393002 26.793992,13.892012 26.193997,13.892012 21.896949,14.092009 20.297938,10.394007 19.097932,7.3960032 18.398921,5.6969966 17.698918,4.0979957 16.699916,3.3979983 15.899907,2.8979978 14.600901,1.9989949 13.700884,2.4989952 12.701883,2.9980039 12.30187,5.0970048 12.20188,6.3960022L13.900898,6.2959961C14.600901,6.2959961,15.100904,6.6960057,15.199904,7.3960032L15.399903,9.6950015C16.799909,10.19401 18.098929,10.894008 19.197938,11.893001 23.995965,15.991012 24.494979,23.287025 20.397944,28.084026 16.099906,32.78203 8.8038569,33.381029 4.0068054,29.184019 -0.79122243,25.086023 -1.3902263,17.79001 2.8067985,12.993009 3.9068136,11.693005 5.405819,10.594005 7.0048309,9.9940128L6.9048391,7.9960098C6.9048391,7.3960032,7.3048363,6.7959966,8.0038471,6.6960057L9.9028645,6.5959992C9.9028645,5.3970083 10.302861,1.6989915 12.701883,0.50000046 13.10188,0.099990942 13.700884,0 14.200889,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -722,7 +722,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M10.659519,13.581999C10.787763,13.581999 10.916255,13.630751 11.01375,13.728755 11.207739,13.924762 11.207739,14.241775 11.01175,14.435782L8.5898266,16.850518 11.012901,19.265967C11.20889,19.460974 11.20889,19.776986 11.013901,19.972994 10.916906,20.070997 10.787913,20.119999 10.65992,20.119999 10.531927,20.119999 10.403934,20.070997 10.30694,19.973994L7.8819971,17.556247 5.4570541,19.973994C5.3600597,20.070997 5.2320671,20.119999 5.1040735,20.119999 4.9760809,20.119999 4.8470879,20.070997 4.7500935,19.972994 4.5551033,19.776986 4.5551033,19.460974 4.7510929,19.265967L7.1741672,16.850518 4.752244,14.435782C4.5562544,14.241775 4.5562544,13.924762 4.7502441,13.728755 4.9452333,13.532748 5.2642155,13.533748 5.4572048,13.727755L7.8819966,16.144916 10.306789,13.727755C10.403284,13.630751,10.531276,13.582,10.659519,13.581999z M7.7229891,10.151996C4.0159941,10.151996 0.99999809,13.156997 0.99999809,16.850998 0.99999809,20.544999 4.0159941,23.55 7.7229891,23.55 10.503235,23.55 12.895357,21.859687 13.917652,19.456124L14.034025,19.162648 14.034025,18.772999 14.164453,18.772999 14.191419,18.682897C14.357855,18.100457 14.44698,17.485905 14.44698,16.850998 14.44698,13.156997 11.429984,10.151996 7.7229891,10.151996z M28.477001,10.135L31.999016,13.663 28.424001,17.244999 27.716998,16.538999 29.693872,14.558 21.322995,14.558 21.322995,13.558 30.482195,13.558 27.769998,10.841z M7.4592972,5.1720018L15.45899,8.869 22.849004,5.1720018z M4.6849804,4.1720018L25.465012,4.1720018 25.465012,10.408002 24.465011,10.408002 24.465011,5.4821377 15.476991,9.9780006 5.6849813,5.4540205 5.6849813,9.4246554 5.7953281,9.3948154C6.4117265,9.2363219 7.0576777,9.1519957 7.7229891,9.1519957 11.981983,9.1519957 15.446978,12.605997 15.446978,16.850998 15.446978,17.514279 15.362384,18.158249 15.203383,18.772749L24.465023,18.772999 24.465023,16.665997 25.465026,16.665997 25.465026,19.772997 14.868521,19.772997 14.839026,19.844827C13.664856,22.607125 10.917235,24.550001 7.7229891,24.550001 3.4649954,24.550001 0,21.095999 0,16.850998 0,13.733575 1.8686953,11.042744 4.5478315,9.8331947L4.6849804,9.7732801z M7.8089724,0L29.631012,0 29.631012,7.2790012 28.63101,7.2790012 28.63101,1 8.8089738,1 8.8089738,3.1080008 7.8089724,3.1080008z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M10.659519,13.581999C10.787763,13.581999 10.916255,13.630751 11.01375,13.728755 11.207739,13.924762 11.207739,14.241775 11.01175,14.435782L8.5898266,16.850518 11.012901,19.265967C11.20889,19.460974 11.20889,19.776986 11.013901,19.972994 10.916906,20.070997 10.787913,20.119999 10.65992,20.119999 10.531927,20.119999 10.403934,20.070997 10.30694,19.973994L7.8819971,17.556247 5.4570541,19.973994C5.3600597,20.070997 5.2320671,20.119999 5.1040735,20.119999 4.9760809,20.119999 4.8470879,20.070997 4.7500935,19.972994 4.5551033,19.776986 4.5551033,19.460974 4.7510929,19.265967L7.1741672,16.850518 4.752244,14.435782C4.5562544,14.241775 4.5562544,13.924762 4.7502441,13.728755 4.9452333,13.532748 5.2642155,13.533748 5.4572048,13.727755L7.8819966,16.144916 10.306789,13.727755C10.403284,13.630751,10.531276,13.582,10.659519,13.581999z M7.7229891,10.151996C4.0159941,10.151996 0.99999809,13.156997 0.99999809,16.850998 0.99999809,20.544999 4.0159941,23.55 7.7229891,23.55 10.503235,23.55 12.895357,21.859687 13.917652,19.456124L14.034025,19.162648 14.034025,18.772999 14.164453,18.772999 14.191419,18.682897C14.357855,18.100457 14.44698,17.485905 14.44698,16.850998 14.44698,13.156997 11.429984,10.151996 7.7229891,10.151996z M28.477001,10.135L31.999016,13.663 28.424001,17.244999 27.716998,16.538999 29.693872,14.558 21.322995,14.558 21.322995,13.558 30.482195,13.558 27.769998,10.841z M7.4592972,5.1720018L15.45899,8.869 22.849004,5.1720018z M4.6849804,4.1720018L25.465012,4.1720018 25.465012,10.408002 24.465011,10.408002 24.465011,5.4821377 15.476991,9.9780006 5.6849813,5.4540205 5.6849813,9.4246554 5.7953281,9.3948154C6.4117265,9.2363219 7.0576777,9.1519957 7.7229891,9.1519957 11.981983,9.1519957 15.446978,12.605997 15.446978,16.850998 15.446978,17.514279 15.362384,18.158249 15.203383,18.772749L24.465023,18.772999 24.465023,16.665997 25.465026,16.665997 25.465026,19.772997 14.868521,19.772997 14.839026,19.844827C13.664856,22.607125 10.917235,24.550001 7.7229891,24.550001 3.4649954,24.550001 0,21.095999 0,16.850998 0,13.733575 1.8686953,11.042744 4.5478315,9.8331947L4.6849804,9.7732801z M7.8089724,0L29.631012,0 29.631012,7.2790012 28.63101,7.2790012 28.63101,1 8.8089738,1 8.8089738,3.1080008 7.8089724,3.1080008z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -732,7 +732,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M2,2L2,25 30,25 30,2z M1,0L31,0C31.552002,0,32,0.44702148,32,1L32,26C32,26.552979,31.552002,27,31,27L17,27 17,30 25,30 25,32 7,32 7,30 15,30 15,27 1,27C0.44799805,27,0,26.552979,0,26L0,1C0,0.44702148,0.44799805,0,1,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M2,2L2,25 30,25 30,2z M1,0L31,0C31.552002,0,32,0.44702148,32,1L32,26C32,26.552979,31.552002,27,31,27L17,27 17,30 25,30 25,32 7,32 7,30 15,30 15,27 1,27C0.44799805,27,0,26.552979,0,26L0,1C0,0.44702148,0.44799805,0,1,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -742,7 +742,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M16.2,11.1C19,11.1 21.2,13.3 21.2,16.1 21.2,18.9 19,21.1 16.2,21.1 13.4,21.1 11.2,18.9 11.2,16.1 11.2,13.4 13.4,11.1 16.2,11.1z M16.2,6C10.6,6 6,10.6 6,16.1 6,21.7 10.5,26.2 16.1,26.2 21.7,26.2 26.2,21.7 26.2,16.1 26.3,10.6 21.7,6 16.2,6z M15.3,0L16.8,0 16.8,5.1999998C22.2,5.5,26.6,9.6999998,27.1,15L32,15 32,16.5 27.1,16.5 27.1,16.7C26.8,22.3,22.3,26.8,16.7,27.1L16.7,32 15.2,32 15.2,27.1 15.5,27.1 16,27.1C10.2,27,5.5,22.5,5.1999998,16.7L5.1999998,16.5 5.1999998,16.4 0,16.4 0,15 5.3000002,15C5.9000001,9.6999998,10.3,5.5,15.7,5.1999998L15.6,5.1999998 15.3,5.1999998z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M16.2,11.1C19,11.1 21.2,13.3 21.2,16.1 21.2,18.9 19,21.1 16.2,21.1 13.4,21.1 11.2,18.9 11.2,16.1 11.2,13.4 13.4,11.1 16.2,11.1z M16.2,6C10.6,6 6,10.6 6,16.1 6,21.7 10.5,26.2 16.1,26.2 21.7,26.2 26.2,21.7 26.2,16.1 26.3,10.6 21.7,6 16.2,6z M15.3,0L16.8,0 16.8,5.1999998C22.2,5.5,26.6,9.6999998,27.1,15L32,15 32,16.5 27.1,16.5 27.1,16.7C26.8,22.3,22.3,26.8,16.7,27.1L16.7,32 15.2,32 15.2,27.1 15.5,27.1 16,27.1C10.2,27,5.5,22.5,5.1999998,16.7L5.1999998,16.5 5.1999998,16.4 0,16.4 0,15 5.3000002,15C5.9000001,9.6999998,10.3,5.5,15.7,5.1999998L15.6,5.1999998 15.3,5.1999998z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -752,7 +752,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M5.5803752,0C7.1813383,0 8.8833761,0.6000061 10.084373,1.8009948 11.785374,3.5029907 12.285377,5.8049927 11.685397,7.9060059L24.094478,20.31601C26.096505,19.714996 28.398524,20.216003 30.099524,21.916992 31.500535,23.317993 32.101552,25.320007 31.901538,27.121002L28.998504,24.118988C27.69753,22.817993 25.496465,22.817993 24.094478,24.118988 22.693467,25.519989 22.693467,27.622009 24.094478,29.02301L26.997514,31.924988C25.195498,32.225006 23.194447,31.625 21.793437,30.123993 20.191436,28.522003 19.591456,26.119995 20.191436,24.118988L7.7823553,11.709015C5.6803512,12.309998 3.3783338,11.80899 1.6773333,10.108002 0.37629925,8.7070007 -0.224718,6.8049927 0.076309212,5.0039978L2.978307,7.9060059C4.2793407,9.2070007 6.4813823,9.2070007 7.8823928,7.9060059 9.2834034,6.605011 9.2834034,4.4030151 7.8823928,3.0020142L4.9803342,0.10000607C5.1803479,0,5.3803615,0,5.5803752,0z" />
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M5.5803752,0C7.1813383,0 8.8833761,0.6000061 10.084373,1.8009948 11.785374,3.5029907 12.285377,5.8049927 11.685397,7.9060059L24.094478,20.31601C26.096505,19.714996 28.398524,20.216003 30.099524,21.916992 31.500535,23.317993 32.101552,25.320007 31.901538,27.121002L28.998504,24.118988C27.69753,22.817993 25.496465,22.817993 24.094478,24.118988 22.693467,25.519989 22.693467,27.622009 24.094478,29.02301L26.997514,31.924988C25.195498,32.225006 23.194447,31.625 21.793437,30.123993 20.191436,28.522003 19.591456,26.119995 20.191436,24.118988L7.7823553,11.709015C5.6803512,12.309998 3.3783338,11.80899 1.6773333,10.108002 0.37629925,8.7070007 -0.224718,6.8049927 0.076309212,5.0039978L2.978307,7.9060059C4.2793407,9.2070007 6.4813823,9.2070007 7.8823928,7.9060059 9.2834034,6.605011 9.2834034,4.4030151 7.8823928,3.0020142L4.9803342,0.10000607C5.1803479,0,5.3803615,0,5.5803752,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -762,7 +762,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M25.700012,16.000016L28.800019,16.000016 28.800019,17.099989 25.700012,17.099989z M23.200012,8.599998L17.200012,16.300004C17.200012,16.500016,17.100006,16.800002,17,17.000014L20.100006,22.50001 15.700012,17.699965C15,17.599989 14.5,17.000014 14.5,16.300004 14.5,15.599991 15,15.000017 15.700012,14.89998L15.800019,14.89998z M15.700012,2.9999971C8.7000124,3.2000091,3.0000002,9.0000224,3,16.000016L6.1000063,16.000016 6.1000063,17.099989 3.1000061,17.099989 3.1000061,17.300002C3.7000124,23.699959,9.1000063,28.79999,15.700012,29.000002L15.800019,29.000002 15.800019,26.000006 16.900025,26.000006 16.900025,29.000002 17.100006,29.000002C23.800019,28.500004 29.100006,22.899971 29.100006,16.099991 29.100006,9.3000092 23.800019,3.7000086 17.100006,3.2000089L16.900025,3.2000089 16.900025,6.2000065 15.800019,6.2000065 15.800019,2.9999971z M16,0C24.800019,0 32,7.2000055 32,16.000016 32,24.799994 24.800019,32 16,32 7.2000124,32 2.3106986E-07,24.799994 0,16.000016 2.3106986E-07,7.2000055 7.2000124,0 16,0z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M25.700012,16.000016L28.800019,16.000016 28.800019,17.099989 25.700012,17.099989z M23.200012,8.599998L17.200012,16.300004C17.200012,16.500016,17.100006,16.800002,17,17.000014L20.100006,22.50001 15.700012,17.699965C15,17.599989 14.5,17.000014 14.5,16.300004 14.5,15.599991 15,15.000017 15.700012,14.89998L15.800019,14.89998z M15.700012,2.9999971C8.7000124,3.2000091,3.0000002,9.0000224,3,16.000016L6.1000063,16.000016 6.1000063,17.099989 3.1000061,17.099989 3.1000061,17.300002C3.7000124,23.699959,9.1000063,28.79999,15.700012,29.000002L15.800019,29.000002 15.800019,26.000006 16.900025,26.000006 16.900025,29.000002 17.100006,29.000002C23.800019,28.500004 29.100006,22.899971 29.100006,16.099991 29.100006,9.3000092 23.800019,3.7000086 17.100006,3.2000089L16.900025,3.2000089 16.900025,6.2000065 15.800019,6.2000065 15.800019,2.9999971z M16,0C24.800019,0 32,7.2000055 32,16.000016 32,24.799994 24.800019,32 16,32 7.2000124,32 2.3106986E-07,24.799994 0,16.000016 2.3106986E-07,7.2000055 7.2000124,0 16,0z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -772,7 +772,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M7,26L19,26 19,28 7,28z M12.732999,14.533003L13.867999,14.533003 13.867999,15.486002C14.643999,15.519002,15.164999,15.671002,15.546999,15.844003L15.210999,17.068001C14.909999,16.949001 14.376999,16.700003 13.543999,16.700003 12.790999,16.700003 12.547999,17.003002 12.547999,17.307001 12.547999,17.664001 12.952999,17.892002 13.936999,18.238001 15.315999,18.693001 15.870998,19.289001 15.870998,20.264 15.870998,21.228001 15.141998,22.052 13.809999,22.268999L13.809999,23.372999 12.674999,23.372999 12.674999,22.344C11.898999,22.310999,11.146,22.116999,10.705999,21.878L11.052999,20.610001C11.539999,20.860001 12.223,21.087999 12.975999,21.087999 13.635999,21.087999 14.087999,20.85 14.087999,20.416 14.087999,20.004 13.716999,19.744001 12.859999,19.474001 11.620999,19.083 10.775999,18.542002 10.775999,17.490002 10.775999,16.537003 11.492999,15.790002 12.732999,15.562002z M2,12L2,30 24,30 24,12z M2,7L2,10 24,10 24,7z M2,2L2,5 24,5 24,2z M0,0L26,0 26,32 0,32z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M7,26L19,26 19,28 7,28z M12.732999,14.533003L13.867999,14.533003 13.867999,15.486002C14.643999,15.519002,15.164999,15.671002,15.546999,15.844003L15.210999,17.068001C14.909999,16.949001 14.376999,16.700003 13.543999,16.700003 12.790999,16.700003 12.547999,17.003002 12.547999,17.307001 12.547999,17.664001 12.952999,17.892002 13.936999,18.238001 15.315999,18.693001 15.870998,19.289001 15.870998,20.264 15.870998,21.228001 15.141998,22.052 13.809999,22.268999L13.809999,23.372999 12.674999,23.372999 12.674999,22.344C11.898999,22.310999,11.146,22.116999,10.705999,21.878L11.052999,20.610001C11.539999,20.860001 12.223,21.087999 12.975999,21.087999 13.635999,21.087999 14.087999,20.85 14.087999,20.416 14.087999,20.004 13.716999,19.744001 12.859999,19.474001 11.620999,19.083 10.775999,18.542002 10.775999,17.490002 10.775999,16.537003 11.492999,15.790002 12.732999,15.562002z M2,12L2,30 24,30 24,12z M2,7L2,10 24,10 24,7z M2,2L2,5 24,5 24,2z M0,0L26,0 26,32 0,32z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -782,7 +782,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M12.099998,0L19.799995,0 19.799995,12.1 32,12.1 32,19.799996 19.900002,19.799996 19.900002,31.999999 12.199997,31.999999 12.199997,19.900003 0,19.900003 0,12.199999 12.099998,12.199999z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M12.099998,0L19.799995,0 19.799995,12.1 32,12.1 32,19.799996 19.900002,19.799996 19.900002,31.999999 12.199997,31.999999 12.199997,19.900003 0,19.900003 0,12.199999 12.099998,12.199999z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -794,7 +794,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Transparent" Geometry="M14.100037,6L14.100037,14.099998 6,14.099998 6,18 14.100037,18 14.100037,26.099998 18,26.099998 18,18 26,18 26,14.099998 17.900024,14.099998 17.900024,6z M16,0C24.800049,0 32,7.1999969 32,16 32,24.800003 24.800049,32 16,32 7.2000122,32 0,24.800003 0,16 0,7.1999969 7.2000122,0 16,0z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="2" Brush="Black"/>
|
||||
<Pen Thickness="2" Brush="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -806,7 +806,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M454.352,398.431L331,190.879V87.42c17.459-6.192,30-22.865,30-42.42c0-24.813-20.187-45-45-45H196
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M454.352,398.431L331,190.879V87.42c17.459-6.192,30-22.865,30-42.42c0-24.813-20.187-45-45-45H196
|
||||
c-24.813,0-45,20.187-45,45c0,19.555,12.541,36.228,30,42.42v103.459L57.659,398.413c-14.085,23.476-14.442,51.715-0.953,75.539
|
||||
C70.196,497.776,94.594,512,121.972,512h268.055c27.378,0,51.776-14.224,65.266-38.048
|
||||
C468.779,450.134,468.427,421.903,454.352,398.431z M196,30h120c8.271,0,15,6.729,15,15s-6.729,15-15,15H196
|
||||
@@ -829,7 +829,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Transparent" Geometry="M16.378574,2.0941912E-05C17.053625,-0.0029775997,17.669592,0.31702943,17.669592,0.31702964L27.747614,10.181254C30.078613,11.977292,28.301632,12.163302,28.301632,12.163302L14.005584,15.500376C11.924586,18.496447,15.130586,19.519465,15.130586,19.519465L30.870606,16.081391C32.66065,16.035383,31.786623,17.428421,31.786623,17.428421L15.130586,21.214503C12.353603,22.20553,10.869592,20.092476,10.869592,20.092476L0.76355401,8.8182232C-1.4574583,4.6071207,1.8735417,3.616101,1.8735417,3.616101L16.08762,0.023016395C16.184605,0.0080166093,16.282566,2.082104E-05,16.378574,2.0941912E-05z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Brush="Black" Thickness="2"/>
|
||||
<Pen Brush="{mbts:BTSColor UI.icon_foreground}" Thickness="2"/>
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -841,7 +841,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M26.84801,26.411987L31.841998,26.411987 31.841998,31.915009 26.84801,31.915009z M10.497003,26.411987L18.709003,26.411987 18.709003,31.915009 10.497003,31.915009z M20.052005,18.708984L25.386005,18.708984 25.386005,31.915009 20.052005,31.915009z M10.497003,14.221985L18.709003,14.221985 18.709003,25.057983 10.497003,25.057983z M20.052005,9.5660095L25.386005,9.5660095 25.386005,17.18399 20.052005,17.18399z M26.84801,7.07901L31.841998,7.07901 31.841998,25.057983 26.84801,25.057983z M10.497003,1.9949951L18.709003,1.9949951 18.709003,12.686005 10.497003,12.686005z M0,0L9.2280055,0 9.2280055,32 0,32z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M26.84801,26.411987L31.841998,26.411987 31.841998,31.915009 26.84801,31.915009z M10.497003,26.411987L18.709003,26.411987 18.709003,31.915009 10.497003,31.915009z M20.052005,18.708984L25.386005,18.708984 25.386005,31.915009 20.052005,31.915009z M10.497003,14.221985L18.709003,14.221985 18.709003,25.057983 10.497003,25.057983z M20.052005,9.5660095L25.386005,9.5660095 25.386005,17.18399 20.052005,17.18399z M26.84801,7.07901L31.841998,7.07901 31.841998,25.057983 26.84801,25.057983z M10.497003,1.9949951L18.709003,1.9949951 18.709003,12.686005 10.497003,12.686005z M0,0L9.2280055,0 9.2280055,32 0,32z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -853,7 +853,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Geometry="M38.642,39.289c-3.895-3.373-2.645-7.564-0.338-13.896c1.898-5.21,4.051-11.118,1.445-16.945 c-1.789-4.001-6.2-8.319-13.215-8.442L25.963,0c-2.518,0-6.289,0.283-9.953,2.734c-0.286,0.191-0.462,0.51-0.472,0.855 c-0.01,0.345,0.148,0.672,0.424,0.879c0.583,0.438,0.94,1.313,1.138,2.049c-2.711,0.486-3.37,1.934-4.01,3.34 c-0.676,1.486-1.443,3.17-5.15,4.794c-1.008,0.442-1.693,1.499-1.789,2.757c-0.092,1.221,0.412,2.334,1.315,2.905 c0.385,0.244,0.778,0.269,1.094,0.289c0.382,0.025,0.657,0.043,1.07,0.409c0.327,0.292,0.593,0.621,0.827,0.912 c0.388,0.481,0.722,0.896,1.268,1.021c0.77,0.181,1.694-0.278,2.761-0.843c0.693-0.368,1.479-0.784,2.073-0.904 c0.754-0.15,1.721-0.323,2.52-0.323c0.684,0,0.909,0.134,0.928,0.114c0.18,1.047-1.972,2.48-3.87,3.745 c-3.333,2.224-7.481,4.988-6.394,9.455c0.17,0.699,0.523,2.123,3.82,3.819C6.66,39.331,1.21,41.742,1.21,43.609 c0,1.244,1.142,2.041,7.165,2.703C12.421,46.757,17.793,47,23.5,47s11.079-0.243,15.125-0.688 c6.022-0.662,7.165-1.459,7.165-2.703C45.79,42.247,42.89,40.596,38.642,39.289z">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Brush="Black" Thickness="3"/>
|
||||
<Pen Brush="{mbts:BTSColor UI.icon_foreground}" Thickness="3"/>
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -865,7 +865,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M27,22.000013C25.346001,22.000013 24,23.345991 24,25.000013 24,26.654005 25.346001,28.000013 27,28.000013 28.653999,28.000013 30,26.654005 30,25.000013 30,23.345991 28.653999,22.000013 27,22.000013z M5,22C3.3460007,22 2,23.346 2,25 2,26.654 3.3460007,28 5,28 6.6540003,28 8,26.654 8,25 8,23.346 6.6540003,22 5,22z M16,2C14.346,2 13,3.3460007 13,5 13,6.6540003 14.346,8 16,8 17.654,8 19,6.6540003 19,5 19,3.3460007 17.654,2 16,2z M16,0C18.757,0 21,2.243 21,5 21,6.2061872 20.570676,7.3139925 19.856814,8.178627L19.749571,8.3023939 26.702677,20.009615 26.74309,20.006532C26.828189,20.002204 26.913844,20.000013 27,20.000013 29.757004,20.000013 32,22.242994 32,25.000013 32,27.757002 29.757004,30.000013 27,30.000013 24.242996,30.000013 22,27.757002 22,25.000013 22,23.104563 23.060166,21.452075 24.618662,20.604373L24.703606,20.560808 18.143555,9.5162544 17.944359,9.6064529C17.346375,9.8598127 16.68925,10 16,10 15.224594,10 14.489846,9.8225756 13.834221,9.5061913L13.749143,9.4625559 7.9581623,20.972196 7.9896793,20.994624C9.2092552,21.907268 10,23.363032 10,25 10,27.757 7.757,30 5,30 2.243,30 0,27.757 0,25 0,22.243 2.243,20 5,20 5.3446255,20 5.6812191,20.035047 6.0064049,20.101764L6.1420031,20.133139 12.151809,8.1885796 12.143186,8.178627C11.429324,7.3139925 11,6.2061872 11,5 11,2.243 13.243,0 16,0z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M27,22.000013C25.346001,22.000013 24,23.345991 24,25.000013 24,26.654005 25.346001,28.000013 27,28.000013 28.653999,28.000013 30,26.654005 30,25.000013 30,23.345991 28.653999,22.000013 27,22.000013z M5,22C3.3460007,22 2,23.346 2,25 2,26.654 3.3460007,28 5,28 6.6540003,28 8,26.654 8,25 8,23.346 6.6540003,22 5,22z M16,2C14.346,2 13,3.3460007 13,5 13,6.6540003 14.346,8 16,8 17.654,8 19,6.6540003 19,5 19,3.3460007 17.654,2 16,2z M16,0C18.757,0 21,2.243 21,5 21,6.2061872 20.570676,7.3139925 19.856814,8.178627L19.749571,8.3023939 26.702677,20.009615 26.74309,20.006532C26.828189,20.002204 26.913844,20.000013 27,20.000013 29.757004,20.000013 32,22.242994 32,25.000013 32,27.757002 29.757004,30.000013 27,30.000013 24.242996,30.000013 22,27.757002 22,25.000013 22,23.104563 23.060166,21.452075 24.618662,20.604373L24.703606,20.560808 18.143555,9.5162544 17.944359,9.6064529C17.346375,9.8598127 16.68925,10 16,10 15.224594,10 14.489846,9.8225756 13.834221,9.5061913L13.749143,9.4625559 7.9581623,20.972196 7.9896793,20.994624C9.2092552,21.907268 10,23.363032 10,25 10,27.757 7.757,30 5,30 2.243,30 0,27.757 0,25 0,22.243 2.243,20 5,20 5.3446255,20 5.6812191,20.035047 6.0064049,20.101764L6.1420031,20.133139 12.151809,8.1885796 12.143186,8.178627C11.429324,7.3139925 11,6.2061872 11,5 11,2.243 13.243,0 16,0z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -875,8 +875,8 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black" Geometry="M106.965,252.716H262.11c5.522,0,10-4.477,10-10v-77.572c0-5.523-4.478-10-10-10h-67.572V10c0-5.523-4.478-10-10-10 h-77.572c-5.522,0-10,4.477-10,10v232.716C96.965,248.239,101.443,252.716,106.965,252.716z M116.965,20h57.572v145.144 c0,5.523,4.478,10,10,10h67.572v57.572H116.965V20z"/>
|
||||
<GeometryDrawing Brush="Black" Geometry="M417.253,193.93h-77.571c-5.522,0-10,4.477-10,10v67.572H262.11c-5.522,0-10,4.477-10,10v67.572H29.393 c-5.522,0-10,4.477-10,10v77.572c0,5.523,4.478,10,10,10h387.86c5.522,0,10-4.477,10-10V203.93 C427.253,198.407,422.776,193.93,417.253,193.93z M39.393,369.075h290.289v57.572H39.393V369.075z M407.253,426.646h-57.571 v-67.572c0-5.523-4.478-10-10-10H272.11v-57.572h67.572c5.522,0,10-4.477,10-10V213.93h57.571V426.646z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M106.965,252.716H262.11c5.522,0,10-4.477,10-10v-77.572c0-5.523-4.478-10-10-10h-67.572V10c0-5.523-4.478-10-10-10 h-77.572c-5.522,0-10,4.477-10,10v232.716C96.965,248.239,101.443,252.716,106.965,252.716z M116.965,20h57.572v145.144 c0,5.523,4.478,10,10,10h67.572v57.572H116.965V20z"/>
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}" Geometry="M417.253,193.93h-77.571c-5.522,0-10,4.477-10,10v67.572H262.11c-5.522,0-10,4.477-10,10v67.572H29.393 c-5.522,0-10,4.477-10,10v77.572c0,5.523,4.478,10,10,10h387.86c5.522,0,10-4.477,10-10V203.93 C427.253,198.407,422.776,193.93,417.253,193.93z M39.393,369.075h290.289v57.572H39.393V369.075z M407.253,426.646h-57.571 v-67.572c0-5.523-4.478-10-10-10H272.11v-57.572h67.572c5.522,0,10-4.477,10-10V213.93h57.571V426.646z"/>
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
</DrawingImage.Drawing>
|
||||
@@ -916,7 +916,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing>
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Brush="Black" Thickness="1" />
|
||||
<Pen Brush="{mbts:BTSColor UI.icon_foreground}" Thickness="1" />
|
||||
</GeometryDrawing.Pen>
|
||||
<GeometryDrawing.Geometry>
|
||||
<GeometryGroup>
|
||||
@@ -933,7 +933,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black"
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M18.51899,0L29.981999,0 29.981999,32 18.51899,32z M0,0L11.464992,0 11.464992,32 0,32z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -945,7 +945,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black"
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M23.679005,26.495C23.99901,26.495 24.265014,26.59 24.475017,26.78 24.685019,26.967 24.79102,27.204 24.79102,27.491 24.79102,27.783 24.68802,28.024 24.481016,28.214 24.271013,28.405 24.00301,28.5 23.679005,28.5 23.354001,28.5 23.085997,28.403 22.870994,28.208 22.655991,28.006 22.54899,27.766 22.54899,27.491 22.54899,27.207 22.655991,26.97 22.870994,26.78 23.085997,26.59 23.354001,26.495 23.679005,26.495z M23.734006,19.5C24.110011,19.5 24.460016,19.541 24.785021,19.625 25.110025,19.708 25.392029,19.839 25.632032,20.017 25.874036,20.195 26.062038,20.422 26.19904,20.7 26.333042,20.978 26.401043,21.311 26.401043,21.7 26.401043,21.947 26.373043,22.171 26.316042,22.371 26.259041,22.572 26.17704,22.762 26.067039,22.94 25.958037,23.118 25.822035,23.289 25.660033,23.453 25.498031,23.617 25.311028,23.786 25.101026,23.961 24.959023,24.078 24.835021,24.187 24.72802,24.289 24.620018,24.39 24.531017,24.49 24.460016,24.589 24.389015,24.689 24.335014,24.794 24.299014,24.905 24.262013,25.017 24.244013,25.144 24.244013,25.285 24.244013,25.383 24.257013,25.482 24.283013,25.583 24.310014,25.685 24.345015,25.77 24.390016,25.838L22.791993,25.838C22.751992,25.733 22.719992,25.615 22.697992,25.483 22.674991,25.351 22.663991,25.226 22.663991,25.109 22.663991,24.922 22.681992,24.752 22.718992,24.599 22.754992,24.445 22.809993,24.3 22.882994,24.164 22.955995,24.029 23.046997,23.898 23.155998,23.775 23.266,23.652 23.393002,23.529 23.539003,23.407 23.694005,23.278 23.828007,23.157 23.943009,23.046 24.059011,22.935 24.157012,22.823 24.238013,22.712 24.320014,22.6 24.380015,22.485 24.420015,22.365 24.460016,22.246 24.481016,22.113 24.481016,21.967 24.481016,21.841 24.459016,21.725 24.414016,21.618 24.369015,21.51 24.306014,21.419 24.222013,21.341 24.140012,21.264 24.03901,21.203 23.918009,21.159 23.799007,21.115 23.667005,21.092 23.521003,21.092 23.204998,21.092 22.876994,21.158 22.536989,21.29 22.195985,21.422 21.87398,21.621 21.569976,21.888L21.569976,20.059C21.88298,19.872 22.222985,19.733 22.59099,19.64 22.959995,19.547 23.341001,19.5 23.734006,19.5z M23.985949,18C20.670016,18 17.972007,20.69101 17.972007,24 17.972007,27.309021 20.670016,30 23.985949,30 27.302003,30 30.000989,27.309021 30.000989,24 30.000989,20.69101 27.302003,18 23.985949,18z M14,2C10.968,2 8.5,4.467 8.5,7.5 8.5,10.438219 10.81616,12.84526 13.717461,12.992831L13.973991,12.99934 13.99997,12.999012 14.027442,12.999304 14.28254,12.992831C17.18384,12.84526 19.5,10.438219 19.5,7.5 19.5,4.467 17.032,2 14,2z M14,0C18.136,0 21.5,3.3640003 21.5,7.5 21.5,9.95575 20.314059,12.13934 18.484733,13.508212L18.265061,13.664531 18.342722,13.68891C19.921902,14.202736,21.408062,14.995103,22.721599,16.037384L22.786062,16.089699 22.966662,16.064397C23.300515,16.021905 23.640717,16 23.985949,16 28.405035,16 32.000998,19.588989 32.000998,24 32.000998,28.411011 28.405035,32 23.985949,32 19.566984,32 15.971998,28.411011 15.971998,24 15.971998,20.96743 17.671191,18.323394 20.169134,16.967021L20.4065,16.845489 20.189965,16.712549C18.448412,15.669154,16.455822,15.076083,14.409823,15.006025L14.033219,14.999578 14,15 13.960834,14.999503 13.690718,15.00291C7.2160797,15.166433,1.9999962,20.449734,1.9999962,26.921989L0,26.928989 0,26.921989C0,20.80439,3.9878531,15.595488,9.51441,13.731782L9.7309766,13.661711 9.5152669,13.508212C7.6859417,12.13934 6.5,9.95575 6.5,7.5 6.5,3.3640003 9.8640003,0 14,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -958,7 +958,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M23,14C24.10498,14 25,14.89502 25,16 25,17.10498 24.10498,18 23,18 21.89502,18 21,17.10498 21,16 21,14.89502 21.89502,14 23,14z M16,14C17.105,14 18,14.895 18,16 18,17.105 17.105,18 16,18 14.895,18 14,17.105 14,16 14,14.895 14.895,14 16,14z M9,14C10.105,14 11,14.895 11,16 11,17.105 10.105,18 9,18 7.8950005,18 7,17.105 7,16 7,14.895 7.8950005,14 9,14z M16,2C8.2799997,2 2,8.2800002 2,16 2,23.72 8.2799997,30 16,30 23.72,30 30,23.72 30,16 30,8.2800002 23.72,2 16,2z M16,0C24.822,0 32,7.178 32,16 32,24.822 24.822,32 16,32 7.1780005,32 0,24.822 0,16 0,7.178 7.1780005,0 16,0z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -971,7 +971,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M299.152955025434,0L496.426178902388,0 268.890046089888,280.247772216797 198.190201729536,367.407897949219 199.87503144145,369.495361328125 271.502137154341,457.706451416016 498.999970406294,738 301.717621773481,738 101.234124153852,491.008697509766 99.5304498374462,488.936553955078 98.6409082114697,490.003173828125 0,368.488952636719 98.6409082114697,246.945526123047z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1008,7 +1008,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 5.3507926 32.045363 H 17.81645 v 2.401501 H 5.3507926 Z m 0 -4.937233 H 24.132995 v 2.401501 H 5.3507926 Z M 18.799228 22.222041 v 2.32929 h -1.567173 v -2.264886 q -2.179014 -0.01073 -4.057475 -0.987533 v -2.973336 q 0.622575 0.504501 1.856993 0.933864 1.234417 0.429362 2.200482 0.493766 v -3.907198 q -2.511771 -0.933863 -3.4349 -2.018003 -0.912395 -1.094874 -0.912395 -2.662047 0 -1.685248 1.191482 -2.8659947 1.19148 -1.1914807 3.155813 -1.3846939 V 4.918734 h 1.567173 v 1.9535992 q 2.264887 0.1073411 3.38123 0.7299162 V 10.500446 Q 20.677689 9.5880506 18.799228 9.3841034 v 4.0682086 q 2.35076 0.847992 3.370495 1.942866 1.019736 1.08414 1.019736 2.629845 0 1.781854 -1.137811 2.876728 -1.13781 1.08414 -3.25242 1.32029 z M 17.232055 12.829737 V 9.4270397 q -1.492034 0.2683516 -1.492034 1.5564393 0 1.105608 1.492034 1.846258 z m 1.567173 3.628113 v 3.25242 q 1.53497 -0.236149 1.53497 -1.53497 0 -1.051939 -1.53497 -1.71745 z m 13.258587 13.65074 h -3.954117 l 0.0014 7.641804 -7.643169 -10e-7 0.0014 3.952751 h 7.640439 l 0.0014 7.641803 h 3.951385 l 0.0014 -7.641802 7.640437 -10e-7 0.0014 -3.952751 -7.643169 10e-7 z M 5.3507926 36.982596 h 5.5381524 v 2.401501 H 5.3507926 Z M 1.3730469 0 A 1.3741374 1.3741374 0 0 0 0 1.3730469 V 45.630859 a 1.3741374 1.3741374 0 0 0 1.3730469 1.373047 H 16.853516 a 17.906029 17.906029 0 0 1 -0.05859 -1.373047 17.906029 17.906029 0 0 1 0.06836 -1.375 H 2.7480469 V 2.7480469 H 33.326172 V 27.783203 a 17.906029 17.906029 0 0 1 1.375 -0.05859 17.906029 17.906029 0 0 1 1.373047 0.06836 V 1.3730469 A 1.3741374 1.3741374 0 0 0 34.701172 0 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1020,7 +1020,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="m 26.463403 27.963318 h -2.359042 l -0.683586 -2.137882 h -3.417929 l -0.676884 2.137882 h -2.345638 l 3.498351 -9.610414 h 2.566798 z M 22.92484 24.163384 21.89276 20.933106 q -0.113931 -0.361899 -0.160844 -0.864535 h -0.05361 q -0.03351 0.422214 -0.167545 0.837727 l -1.045485 3.257086 z m 2.065112 7.055953 -1.51223 1.51223 2.923087 2.922042 -2.923087 2.923086 1.51223 1.511185 2.922042 -2.922042 2.923086 2.922042 1.511185 -1.511185 -2.922041 -2.923086 2.922041 -2.922042 -1.511185 -1.51223 -2.923086 2.923087 z m -9.484387 0.416058 h 6.108175 v 1.176737 h -6.108175 z m 0 -2.419244 h 9.203284 v 1.176735 h -9.203284 z m 0 4.83849 h 2.713696 v 1.176736 H 15.505565 Z M 13.556469 15.93316 a 0.67332766 0.67332766 0 0 0 -0.672794 0.672793 v 21.686339 a 0.67332766 0.67332766 0 0 0 0.672794 0.672793 h 7.585433 a 8.7739586 8.7739586 0 0 1 -0.02871 -0.672793 8.7739586 8.7739586 0 0 1 0.0335 -0.673751 H 14.230219 V 17.279703 h 14.983289 v 12.267233 a 8.7739586 8.7739586 0 0 1 0.67375 -0.02871 8.7739586 8.7739586 0 0 1 0.672794 0.0335 V 16.605953 A 0.67332766 0.67332766 0 0 0 29.887258 15.93316 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1032,7 +1032,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="m 24.706673 31.196264 -3.086181 3.086182 5.96548 5.963348 -5.96548 5.96548 3.086181 3.084049 5.963348 -5.963348 5.96548 5.963348 3.084049 -3.084049 -5.963347 -5.96548 5.963347 -5.963348 -3.084049 -3.086182 -5.96548 5.965481 z M 5.3507926 32.045363 H 17.81645 v 2.401501 H 5.3507926 Z m 0 -4.937233 H 24.132994 v 2.401501 H 5.3507926 Z M 26.434166 6.0031559 14.993666 17.443656 9.6399578 12.089946 6.0100982 15.719802 c 2.9622322 2.959826 6.0772448 6.092263 8.9969908 8.970151 L 30.064121 9.6329208 Z M 5.3507926 36.982596 h 5.5381524 v 2.401501 H 5.3507926 Z M 1.3730469 0 A 1.3741374 1.3741374 0 0 0 0 1.3730469 V 45.630859 a 1.3741374 1.3741374 0 0 0 1.3730469 1.373047 H 16.853516 a 17.906029 17.906029 0 0 1 -0.05859 -1.373047 17.906029 17.906029 0 0 1 0.06836 -1.375 H 2.7480469 V 2.7480469 H 33.326172 V 27.783203 a 17.906029 17.906029 0 0 1 1.375 -0.05859 17.906029 17.906029 0 0 1 1.373047 0.06836 V 1.3730469 A 1.3741374 1.3741374 0 0 0 34.701172 0 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1043,7 +1043,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingImage.Drawing>
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Brush="Black"
|
||||
<GeometryDrawing Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="m 18.887708 18.355738 v 1.910329 h -1.285291 v -1.857509 q -1.787082 -0.0088 -3.327671 -0.809909 v -2.438532 q 0.510595 0.413758 1.522982 0.765893 1.012387 0.352134 1.804689 0.404954 V 13.12654 q -2.059987 -0.765892 -2.817076 -1.655032 -0.748286 -0.897943 -0.748286 -2.1832341 0 -1.382128 0.977174 -2.3504979 0.977173 -0.9771733 2.588188 -1.1356339 V 4.1647166 h 1.285291 v 1.6022121 q 1.85751 0.088034 2.77306 0.5986287 v 2.376908 Q 20.428297 7.9941795 18.887708 7.8269156 V 11.16339 q 1.927937 0.695466 2.764256 1.593409 0.83632 0.88914 0.83632 2.156824 0 1.461358 -0.933157 2.359301 -0.933156 0.88914 -2.667419 1.082814 z M 17.602417 10.652795 V 7.8621291 q -1.223667 0.2200841 -1.223667 1.2764876 0 0.9067463 1.223667 1.5141783 z m 1.285291 2.975537 v 2.667419 q 1.258881 -0.193674 1.258881 -1.258881 0 -0.86273 -1.258881 -1.408538 z M 7.8581956 26.412174 H 18.081699 v 1.969551 H 7.8581956 Z m 0 -4.04919 H 23.262109 v 1.969551 H 7.8581956 Z m 23.8237084 -0.610988 -12.064762 12.064763 4.39301 4.393009 12.064761 -12.064762 z m -0.0014 3.48158 0.91143 0.91143 -8.583182 8.583183 -0.91143 -0.91143 z m -12.817392 9.398532 -1.583992 5.915617 5.914283 -1.585326 z M 7.8581956 30.461364 H 12.40022 v 1.969551 H 7.8581956 Z M 4.5959132 0.13069836 A 1.1269761 1.1269761 0 0 0 3.4698314 1.2567801 V 37.554094 a 1.1269761 1.1269761 0 0 0 1.1260818 1.126082 H 15.310509 a 8.0150307 8.0150307 0 0 1 -0.01762 -0.337985 8.0150307 8.0150307 0 0 1 0.240273 -1.915781 H 5.7235967 V 2.3844637 H 30.801741 V 20.486667 a 8.0150307 8.0150307 0 0 1 0.863383 -0.04966 8.0150307 8.0150307 0 0 1 1.390383 0.12334 V 1.2567801 A 1.1269761 1.1269761 0 0 0 31.929425 0.13069836 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1079,7 +1079,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 9.9417804 -0.02293875 1.9154138 8.0034278 17.4301 23.512569 1.9154138 39.027256 9.9417804 47.048077 25.450922 31.538936 40.965607 47.048077 48.986428 39.027256 33.47729 23.512569 48.986428 8.0034278 40.965607 -0.02293875 25.450922 15.491746 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1092,7 +1092,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="m 69.641861 87.129943 a 36.813842 36.813842 0 0 0 -36.813776 36.813767 36.813842 36.813842 0 0 0 31.044618 36.31355 l 1.208194 21.35839 1.804543 31.90967 a 41.092964 41.092964 0 0 0 -29.828154 39.50509 41.092964 41.092964 0 0 0 41.09258 41.0931 41.092964 41.092964 0 0 0 41.093104 -41.0931 41.092964 41.092964 0 0 0 -0.10284 -2.9068 41.092964 41.092964 0 0 0 -38.048841 -38.03902 l -2.962092 -52.36321 a 36.813842 36.813842 0 0 0 20.093347 -12.61939 l 33.150946 15.70705 v 5.3e-4 a 27.542416 27.542416 0 0 0 -0.12557 2.49907 27.542416 27.542416 0 0 0 27.54251 27.54249 27.542416 27.542416 0 0 0 27.5425 -27.5425 27.542416 27.542416 0 0 0 -27.5425 -27.5425 27.542416 27.542416 0 0 0 -22.44618 11.61479 l -31.44563 -14.89935 a 36.813842 36.813842 0 0 0 1.55701 -10.53786 36.813842 36.813842 0 0 0 -36.813769 -36.813767 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1104,7 +1104,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 36.50044 86.999995 A 36.813842 36.813842 0 0 0 -0.3133356 123.81377 36.813842 36.813842 0 0 0 30.731282 160.12732 l 1.208194 21.35839 1.804543 31.90967 a 41.092964 41.092964 0 0 0 -29.8281546 39.50509 41.092964 41.092964 0 0 0 41.0925806 41.0931 41.092964 41.092964 0 0 0 41.093099 -41.0931 41.092964 41.092964 0 0 0 -0.102836 -2.9068 41.092964 41.092964 0 0 0 -38.04884 -38.03902 l -2.962092 -52.36321 a 36.813842 36.813842 0 0 0 20.093347 -12.61939 l 33.150948 15.70705 v 5.3e-4 a 27.542416 27.542416 0 0 0 -0.125574 2.49907 27.542416 27.542416 0 0 0 27.542513 27.54249 27.542416 27.542416 0 0 0 27.5425 -27.5425 27.542416 27.542416 0 0 0 -27.5425 -27.5425 27.542416 27.542416 0 0 0 -22.44618 11.61479 L 71.757201 134.35163 A 36.813842 36.813842 0 0 0 73.314213 123.81377 36.813842 36.813842 0 0 0 36.50044 86.999995 Z m 116.60981 115.628085 0.007 37.48967 h -37.49716 l 0.007 19.39257 h 37.48344 L 153.11751 297 h 19.38493 l 0.007 -37.48968 h 37.48342 L 210 240.11775 h -37.49727 l 0.007 -37.48967 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1116,7 +1116,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 37.03498 86.999995 A 36.813842 36.813842 0 0 0 0.22120379 123.81377 36.813842 36.813842 0 0 0 31.265822 160.12731 l 1.208194 21.35839 1.804543 31.90967 a 41.092964 41.092964 0 0 0 -29.8281552 39.50509 41.092964 41.092964 0 0 0 41.0925812 41.0931 41.092964 41.092964 0 0 0 41.093099 -41.0931 41.092964 41.092964 0 0 0 -0.102836 -2.9068 41.092964 41.092964 0 0 0 -38.04884 -38.03902 l -2.962092 -52.36321 a 36.813842 36.813842 0 0 0 20.093346 -12.61938 l 33.150949 15.70704 v 5.3e-4 a 27.542416 27.542416 0 0 0 -0.125574 2.49907 27.542416 27.542416 0 0 0 27.542503 27.54249 27.542416 27.542416 0 0 0 27.5425 -27.5425 27.542416 27.542416 0 0 0 -27.5425 -27.54249 27.542416 27.542416 0 0 0 -22.44618 11.61479 L 72.29174 134.35163 A 36.813842 36.813842 0 0 0 73.848752 123.81377 36.813842 36.813842 0 0 0 37.03498 86.999995 Z m 94.72671 153.117755 0.008 18.80608 c 0 0 -6.42588 -1.1e-4 78.75576 1.3e-4 l 0.009 -18.80621 c 0 0 4.48208 0 -78.77178 0 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1129,7 +1129,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 37.03498 86.999995 A 36.813842 36.813842 0 0 0 0.2212037 123.81377 36.813842 36.813842 0 0 0 31.265822 160.12732 l 1.208194 21.35839 1.804543 31.90967 a 41.092964 41.092964 0 0 0 -29.8281553 39.50509 41.092964 41.092964 0 0 0 41.0925813 41.0931 41.092964 41.092964 0 0 0 41.093099 -41.0931 41.092964 41.092964 0 0 0 -0.102836 -2.9068 41.092964 41.092964 0 0 0 -38.04884 -38.03902 l -2.962092 -52.36321 a 36.813842 36.813842 0 0 0 20.093347 -12.61939 l 33.150948 15.70705 v 5.3e-4 a 27.542416 27.542416 0 0 0 -0.125574 2.49907 27.542416 27.542416 0 0 0 27.542503 27.54249 27.542416 27.542416 0 0 0 27.5425 -27.5425 27.542416 27.542416 0 0 0 -27.5425 -27.5425 27.542416 27.542416 0 0 0 -22.44618 11.61479 L 72.291741 134.35163 A 36.813842 36.813842 0 0 0 73.848753 123.81377 36.813842 36.813842 0 0 0 37.03498 86.999995 Z m 145.03189 90.486735 -76.71431 76.71435 27.93311 27.93293 L 210 205.41986 Z m -0.008 22.13769 5.79522 5.79544 -54.57645 54.57644 -5.7952 -5.79522 z m -81.50016 59.76108 -10.071854 37.61451 37.606034 -10.0803 z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1141,7 +1141,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="m 139.80129 180.78831 a 20.783495 20.783495 0 0 0 -20.78345 20.78346 20.783495 20.783495 0 0 0 17.52643 20.50105 l 0.68209 12.05803 1.01877 18.01482 a 23.1993 23.1993 0 0 0 -16.83968 22.30284 23.1993 23.1993 0 0 0 23.1991 23.19938 23.1993 23.1993 0 0 0 23.19935 -23.19938 23.1993 23.1993 0 0 0 -0.058 -1.64105 23.1993 23.1993 0 0 0 -21.4807 -21.47518 l -1.67225 -29.56198 a 20.783495 20.783495 0 0 0 11.34383 -7.12437 l 18.71558 8.86752 v 3.1e-4 a 15.549251 15.549251 0 0 0 -0.0708 1.41086 15.549251 15.549251 0 0 0 15.5493 15.54927 15.549251 15.549251 0 0 0 15.54931 -15.54927 15.549251 15.549251 0 0 0 -15.54931 -15.54932 15.549251 15.549251 0 0 0 -12.67213 6.5572 l -17.75282 -8.41152 a 20.783495 20.783495 0 0 0 0.87902 -5.94921 20.783495 20.783495 0 0 0 -20.78345 -20.78346 z M 31.983713 88.265691 A 30.676234 30.676234 0 0 0 1.3075339 118.94187 30.676234 30.676234 0 0 0 27.17639 149.20122 l 1.006764 17.79752 1.503689 26.58969 A 34.241941 34.241941 0 0 0 4.8316412 226.50722 34.241941 34.241941 0 0 0 39.073263 260.74928 34.241941 34.241941 0 0 0 73.315316 226.50722 34.241941 34.241941 0 0 0 73.229625 224.08505 34.241941 34.241941 0 0 0 41.524291 192.3879 L 39.05604 148.75469 A 30.676234 30.676234 0 0 0 55.799422 138.2392 l 27.624018 13.08837 v 4.4e-4 a 22.950541 22.950541 0 0 0 -0.104638 2.08242 22.950541 22.950541 0 0 0 22.950618 22.9506 22.950541 22.950541 0 0 0 22.95062 -22.9506 22.950541 22.950541 0 0 0 -22.95062 -22.95061 22.950541 22.950541 0 0 0 -18.703946 9.67837 L 61.362463 127.72286 A 30.676234 30.676234 0 0 0 62.65989 118.94187 30.676234 30.676234 0 0 0 31.983713 88.265691 Z" />
|
||||
</DrawingGroup.Children>
|
||||
</DrawingGroup>
|
||||
@@ -1153,7 +1153,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M22.889013,19.178117C23.365026,19.178117 23.75202,19.56508 23.75202,20.040055 23.75202,20.516007 23.365026,20.904069 22.889013,20.904069 22.413031,20.904069 22.02503,20.516007 22.02503,20.040055 22.02503,19.56508 22.413031,19.178117 22.889013,19.178117z M22.889013,15.528093C20.40003,15.528092 18.375006,17.552018 18.375006,20.040055 18.375006,22.529069 20.40003,24.554093 22.889013,24.554093 25.37702,24.554093 27.402014,22.529069 27.402014,20.040055 27.402014,17.552018 25.37702,15.528092 22.889013,15.528093z M22.167028,12.426042L23.834021,12.426042 23.834021,13.935075 23.981024,13.958024C24.912024,14.12404,25.772009,14.500016,26.509008,15.03505L26.62702,15.12404 27.757025,13.993058 28.935034,15.171037 27.806005,16.301042 27.940008,16.484025C28.422033,17.167008,28.769018,17.950089,28.943029,18.796037L28.996008,19.093034 30.500006,19.093034 30.500006,20.759049 29.02503,20.759049 28.997015,20.980119C28.848028,21.952043,28.472021,22.85109,27.924017,23.619035L27.805029,23.779069 28.935034,24.909074 27.757025,26.088029 26.62702,24.958024 26.61701,24.966081C25.866034,25.536027,24.981024,25.938004,24.019018,26.117082L23.834021,26.147111 23.834021,27.426042 22.167028,27.426042 22.167028,26.177018 21.949011,26.149064C20.942022,25.995011,20.014013,25.596086,19.228033,25.016007L19.151007,24.957047 18.019018,26.088029 16.841009,24.909074 17.972021,23.779069 17.863013,23.633073C17.294012,22.839005,16.908026,21.905046,16.767034,20.894059L16.75202,20.759049 15.500006,20.759049 15.500006,19.093034 16.783026,19.093034 16.812017,18.91005C16.991034,17.947038,17.393011,17.063004,17.963019,16.312028L17.972021,16.301042 16.841009,15.171037 18.019018,13.993058 19.15003,15.123063 19.310034,15.005021C20.078009,14.458024,20.977026,14.081071,21.949011,13.932023L22.167028,13.905046z M16.000014,6.0000114C14.346014,6.0000114 13.000014,7.3460112 13.000014,9.0000114 13.000014,10.654011 14.346014,12.000011 16.000014,12.000011 17.654014,12.000011 19.000014,10.654011 19.000014,9.0000114 19.000014,7.3460112 17.654014,6.0000114 16.000014,6.0000114z M16.000014,4.0000114C18.757014,4.0000114 21.000014,6.2430115 21.000014,9.0000114 21.000014,11.757011 18.757014,14.000011 16.000014,14.000011 13.243014,14.000011 11.000014,11.757011 11.000014,9.0000114 11.000014,6.2430115 13.243014,4.0000114 16.000014,4.0000114z M16.000123,0C24.651189,0 31.47924,8.0160384 31.765244,8.3580403 32.078245,8.7290418 32.078245,9.2720447 31.765244,9.6440461 31.700243,9.7220466 30.130231,11.580056 27.56321,13.533065L26.352201,11.941058C27.853213,10.798052 29.000222,9.6770465 29.645226,9.0010433 27.881213,7.1610341 22.366171,2.0000095 16.000123,2.0000095 9.6350741,2.0000095 4.1210318,7.1590343 2.3550186,9.0000434 4.013031,10.731052 8.9770689,15.388074 14.846114,15.946077L14.657112,17.936087C6.6410513,17.175083 0.49200439,9.9510479 0.23400211,9.6430461 -0.078000069,9.2720447 -0.078000069,8.7290418 0.23400211,8.3580403 0.52000427,8.0160384 7.3480568,0 16.000123,0z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1166,7 +1166,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M23.471008,4.2230202L32,12.800012 23.471008,20.360005 23.471008,16.322012C23.471008,16.322012 8.7430115,12.294 5.0610046,20.360005 5.0610046,18.343985 6.3990173,8.2560073 23.471008,8.2560073z M0,0L21.334015,0 21.334015,2.1340014 21.334015,4.2690102 19.200012,4.2690102 19.200012,2.1340014 2.1340027,2.1340014 2.1340027,23.466997 19.200012,23.466997 19.200012,21.331989 21.334015,21.331989 21.334015,23.466997 21.334015,25.601 19.200012,25.601 0,25.601 0,23.466997 0,2.1340014z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1179,7 +1179,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M13.594002,4.2219891L13.594002,8.255989C30.661003,8.255989 32,18.345018 32,20.360004 28.319,12.293011 13.594002,16.32399 13.594002,16.32399L13.594002,20.360004 5.0610008,12.798993z M0,0L21.333,0 21.333,2.1329974 21.333,4.2670025 19.201,4.2670025 19.201,2.1329974 2.1330032,2.1329974 2.1330032,23.467003 19.201,23.467003 19.201,21.332998 21.333,21.332998 21.333,23.467003 21.333,25.6 19.201,25.6 0,25.6 0,23.467003 0,2.1329974z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1192,7 +1192,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M25.400009,21.400005L29.800003,21.400005C28.100006,24.100017 25.400009,26.200025 22.300003,27.200025 23,26.500013 23.600006,25.600019 24.199997,24.600017 24.699997,23.600017 25.100006,22.500011 25.400009,21.400005z M19,21.400005L24,21.400005C23.699997,22.299998 23.300003,23.200023 22.900009,23.900005 21.800003,26.000013 20.400009,27.3 18.900009,27.700025z M12.300003,21.400005L17.699997,21.400005 17.600006,27.8C16,27.600019 14.5,26.200025 13.300003,23.900005 13,23.100017 12.600006,22.299998 12.300003,21.400005z M26.5,14.700019L32,14.700019C31.900009,16.600013,31.400009,18.400003,30.600006,20.100015L25.900009,20.100015C26.199997,18.400003,26.5,16.600013,26.5,14.700019z M19.100006,14.700019L25.199997,14.700019C25.100006,16.600013,24.900009,18.400003,24.400009,20.100015L19,20.100015z M16.199997,14.700019L17.699997,14.700019 17.699997,20.100015 12,20.100015C11.900009,19.799997,11.900009,19.500009,11.800003,19.200021L15.5,15.500007z M25.900009,7.7999913L30.600006,7.7999913C31.400009,9.500004,31.900009,11.399999,32,13.4L26.5,13.4C26.5,11.399999,26.300003,9.500004,25.900009,7.7999913z M19.100006,7.7999913L24.5,7.7999913C24.900009,9.500004,25.199997,11.399999,25.199997,13.4L19.100006,13.4z M12.100006,7.7999913L17.800003,7.7999913 17.800003,13.4 11.300003,13.4C11.300003,11.299993,11.600006,9.3999979,12.100006,7.7999913z M22.5,0.6000061C25.600006,1.6000066,28.199997,3.6000077,29.900009,6.3999969L25.600006,6.3999969C25.300003,5.2999904 24.900009,4.2000138 24.400009,3.2999892 23.800003,2.2999887 23.199997,1.3999944 22.5,0.6000061z M14.199997,0.6000061C13.5,1.2999882 12.900009,2.2000131 12.300003,3.2000136 10.900009,5.8999965 10,9.8999988 9.9000092,14.000007L9.9000092,14.700019 14.5,14.700019 7.1999969,22.000011 0,14.600013 4.5,14.600013 4.5,13.900001C4.5,7.7000157,8.6000061,2.2999887,14.199997,0.6000061z M19.199997,0.1000061C20.600006,0.50000006 22,1.7999884 23.100006,3.8999953 23.5,4.7000143 23.800003,5.5000026 24.100006,6.3999969L19.100006,6.3999969z M17.900009,0L17.800003,6.3999969 12.400009,6.3999969C12.699997,5.5000026 13.100006,4.6000082 13.5,3.7999892 14.699997,1.5000005 16.300003,0.20001213 17.900009,0z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1206,7 +1206,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Geometry="{Binding Source={StaticResource {x:Static mbts:Icons.ArrowGeometryKey}}}">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="3" Brush="Black"/>
|
||||
<Pen Thickness="3" Brush="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1220,7 +1220,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing Geometry="{Binding Source={StaticResource {x:Static mbts:Icons.ArrowGeometryKey}}}">
|
||||
<GeometryDrawing.Pen>
|
||||
<Pen Thickness="3" Brush="Black"/>
|
||||
<Pen Thickness="3" Brush="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
</GeometryDrawing.Pen>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1236,7 +1236,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M21.832001,24.424L21.832001,27.912998 26.218018,27.912998 26.218018,24.424z M13.757019,24.424L13.757019,27.912998 18.143005,27.912998 18.143005,24.424z M5.7820129,24.424L5.7820129,27.912998 10.167999,27.912998 10.167999,24.424z M1.8950195,6.3799964L3.8880005,6.3799964 4.1870117,17.745001 8.1750183,17.745001 8.1750183,13.956 16.050018,17.745001 16.149994,17.745001 16.149994,13.956 24.024994,17.745001 24.125,17.745001 24.125,13.956 32,17.745001 31.901001,17.745001 31.901001,31.103001 0,31.103001 0,17.745001 1.5950012,17.745001z M8.5740051,1.3959956C8.5740051,1.3959958 9.1719971,3.2899927 6.6800232,3.5889963 6.6800232,3.5889963 5.085022,3.6879953 4.2870178,4.4859993 4.2870178,4.4859993 3.9880066,4.7849952 3.8880005,4.4859993 3.8880005,4.4859993 3.9880066,3.0899958 6.480011,2.6919931 6.5800171,2.7909998 8.3740234,2.6919931 8.5740051,1.3959956z M5.5830078,0C5.5830078,-1.4470834E-07 6.8789978,1.4949948 4.5859985,2.6919931 4.5859985,2.6919931 3.1900024,3.2899927 2.6920166,4.3859931 2.6920166,4.3859931 2.5920105,4.7849952 2.2929993,4.4859993 2.2929993,4.4859993 1.8950195,3.1899942 4.0880127,1.8939967 4.1870117,1.9939953 5.882019,1.2959973 5.5830078,0z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1249,7 +1249,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
@@ -1263,7 +1263,7 @@ M0,0L63.999001,0 63.999001,48.792999 0,48.792999z">
|
||||
<DrawingGroup>
|
||||
<DrawingGroup.Children>
|
||||
<GeometryDrawing
|
||||
Brush="Black"
|
||||
Brush="{mbts:BTSColor UI.icon_foreground}"
|
||||
Geometry="M 0.814453 2e-6 C 0.365092 -7.56e-4 3.21e-4 0.36314 0 0.812502 v 23.945313 c 0.788895 1.126154 1.626953 -0.02112 1.626953 -0.02112 V 1.625002 h 16.241843 c 0 0 0.80538 -0.934678 -0.124651 -1.625002 z M 3.750875 3.43624 C 3.301514 3.435482 2.936743 3.799378 2.936422 4.24874 v 23.945313 c -7.6e-4 0.450124 0.364329 0.815213 0.814453 0.814453 h 7.439453 C 11.042745 28.716852 10.90913 28.418337 10.789937 28.113975 10.699431 27.872971 10.617994 27.628659 10.545796 27.381553 H 4.563375 V 5.06124 h 15.304687 v 7.039063 c 0.173002 -0.01023 0.346234 -0.01609 0.519531 -0.01758 0.343731 -2.6e-4 0.68726 0.01669 1.029297 0.05078 0.02606 0.0038 0.0521 0.0077 0.07813 0.01172 V 4.248738 C 21.494699 3.799376 21.129928 3.43548 20.680567 3.436238 Z m 13.332031 6.884766 c -1.226661 0 -2.230469 1.002456 -2.230469 2.228516 v 9.572265 l -0.824219 -0.8125 v 0.002 c -0.991917 -0.9815 -2.60964 -0.982302 -3.603515 0 -0.48293 0.477155 -0.751953 1.119962 -0.751953 1.796875 0 0.67607 0.269215 1.317958 0.751953 1.794922 l 4.841797 4.78711 0.0078 0.0078 c 2.115591 1.851014 4.144077 2.322266 5.615234 2.322266 0.547268 0 1.017683 -0.06414 1.388672 -0.142578 1.701281 -0.360558 3.108561 -1.372782 3.751954 -2.75586 0.419048 -0.9011 0.978455 -2.062137 0.923828 -3.261718 4.09e-4 -0.01025 0.0011 -0.0075 0.002 -0.02344 0.0015 -0.02655 0.0039 -0.01047 0.0039 -0.07813 v -5.113281 c 0 -1.161114 -0.955476 -2.109375 -2.121094 -2.109375 -0.04803 0 -0.09044 0.0088 -0.136719 0.01172 -0.207784 -1.015547 -1.021531 -1.826172 -2.095703 -1.826172 -0.343265 0 -0.63914 0.145124 -0.93164 0.285156 -0.397916 -0.616533 -1.045784 -1.0625 -1.830078 -1.0625 -0.189487 0 -0.354735 0.07615 -0.53125 0.121094 v -3.515625 c 0 -1.22606 -1.003809 -2.228516 -2.230469 -2.228516 z m 0 1.699219 c 0.148476 0 0.278642 0.05997 0.375 0.15625 0.09685 0.09678 0.15625 0.225142 0.15625 0.373047 v 5.625 1.740234 c 0 0.464846 0.384763 0.849609 0.849609 0.849609 0.464527 0 0.84961 -0.383921 0.84961 -0.849609 v -1.740234 c 0 -0.148598 0.05896 -0.275762 0.15625 -0.373047 0.09729 -0.09729 0.228277 -0.158203 0.375 -0.158203 0.146722 0 0.277709 0.06091 0.375 0.158203 0.09729 0.09729 0.15625 0.224449 0.15625 0.373047 v 0.77539 0.4375 c 0 0.465373 0.384236 0.84961 0.849609 0.84961 0.465373 0 0.849609 -0.384239 0.849609 -0.84961 v -0.425781 l 0.0059 -0.06836 c 0.0286 -0.265146 0.249414 -0.472657 0.52539 -0.472657 0.148238 0 0.278481 0.05996 0.375 0.15625 0.09649 0.09627 0.15625 0.225145 0.15625 0.373047 v 1.935547 c 0 0.465371 0.384237 0.84961 0.84961 0.84961 0.465372 0 0.849609 -0.384237 0.849609 -0.84961 v -0.65039 c 0.0016 -9e-6 2.95e-4 0 0.002 0 0.238806 0 0.421875 0.185008 0.421875 0.410156 l 0.002 5.0625 c -4.64e-4 0.0084 -0.0023 0.0401 -0.0039 0.07227 -0.0015 0.03041 -0.0059 0.02687 -0.002 0.101563 0.03253 0.757506 -0.372777 1.677807 -0.765625 2.521484 h -0.002 c -0.194342 0.418116 -0.532821 0.810028 -0.976563 1.126953 -0.443595 0.316821 -0.990203 0.55925 -1.585937 0.685547 -0.515602 0.10823 -1.298166 0.179402 -2.248047 -0.03125 -0.47546 -0.105441 -0.991926 -0.281044 -1.539063 -0.560547 -0.547306 -0.279588 -1.127683 -0.66381 -1.724609 -1.185547 L 11.620061 23.69601 c -0.162198 -0.160763 -0.248047 -0.365899 -0.248047 -0.587891 0 -0.223284 0.08648 -0.426518 0.248047 -0.585937 0.168295 -0.166151 0.386826 -0.249911 0.607422 -0.25 0.220595 -9e-5 0.437432 0.08144 0.605469 0.248047 l 2.240234 2.207031 0.01367 0.02148 0.04687 0.03516 0.03711 0.0332 0.02539 0.01758 0.01563 0.01367 0.01563 0.0098 c 0.114637 0.07747 0.248043 0.126397 0.388672 0.140625 l -0.04883 -0.0078 0.04102 0.0098 0.08594 0.0039 h 0.0078 c 0.06844 0 0.126002 -0.0085 0.169922 -0.01758 l 0.0059 -0.002 0.01953 -0.0039 h 0.02539 l 0.06641 -0.02734 0.02734 -0.0098 0.0098 -0.0039 c 0.102105 -0.04223 0.198238 -0.105586 0.28125 -0.189454 h 0.002 c 0.163006 -0.165519 0.243191 -0.385955 0.242188 -0.599609 v -0.002 -0.01953 -11.580078 c 0 -0.147904 0.0594 -0.276271 0.15625 -0.373047 0.09636 -0.09628 0.226522 -0.15625 0.375 -0.15625 z"
|
||||
/>
|
||||
</DrawingGroup.Children>
|
||||
|
||||
+31
-31
@@ -1,31 +1,31 @@
|
||||
using bts.utils;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace mbts.spark {
|
||||
[ProtoContract]
|
||||
class GlobalAlertSettings : IEquatable<GlobalAlertSettings> {
|
||||
[ProtoMember(1)]
|
||||
TradeAlert[] _trade_alerts;
|
||||
|
||||
public GlobalAlertSettings() { }
|
||||
public GlobalAlertSettings(IEnumerable<TradeAlert> trade_alerts) =>
|
||||
_trade_alerts = trade_alerts.ToArray();
|
||||
|
||||
public IReadOnlyList<TradeAlert> trade_alerts => _trade_alerts ?? Array.Empty<TradeAlert>();
|
||||
|
||||
public bool Equals(GlobalAlertSettings other) =>
|
||||
other != null &&
|
||||
trade_alerts.SequenceEqual(other.trade_alerts);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj as GlobalAlertSettings);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.auto_phase(trade_alerts);
|
||||
}
|
||||
}
|
||||
using bts.utils;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace mbts.spark {
|
||||
[ProtoContract]
|
||||
class GlobalAlertSettings : IEquatable<GlobalAlertSettings> {
|
||||
[ProtoMember(1)]
|
||||
TradeAlert[] _trade_alerts;
|
||||
|
||||
public GlobalAlertSettings() { }
|
||||
public GlobalAlertSettings(IEnumerable<TradeAlert> trade_alerts) =>
|
||||
_trade_alerts = trade_alerts.ToArray();
|
||||
|
||||
public IReadOnlyList<TradeAlert> trade_alerts => _trade_alerts ?? Array.Empty<TradeAlert>();
|
||||
|
||||
public bool Equals(GlobalAlertSettings other) =>
|
||||
other != null &&
|
||||
trade_alerts.SequenceEqual(other.trade_alerts);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj as GlobalAlertSettings);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.auto_phase(trade_alerts);
|
||||
}
|
||||
}
|
||||
+88
-88
@@ -1,88 +1,88 @@
|
||||
using bts;
|
||||
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.settings {
|
||||
public interface ISavedWindowFactory {
|
||||
Task<IShellWindow> restore(WindowState window);
|
||||
}
|
||||
|
||||
[Export(typeof(ISavedWindowFactory))]
|
||||
public class WindowFactory : ISavedWindowFactory {
|
||||
IShellWindowMigrationRule[] _compat;
|
||||
|
||||
[ImportingConstructor]
|
||||
public WindowFactory([ImportMany] IShellWindowMigrationRule[] migration) {
|
||||
_compat = migration;
|
||||
}
|
||||
|
||||
[Import]
|
||||
public ObservableCollection<IShellModule> modules { get; set; }
|
||||
|
||||
public Task<IShellWindow> restore(WindowState window) {
|
||||
Log.Ui.info("Loading window '{0}'".fmt(window.title));
|
||||
bool changed;
|
||||
int count = 0;
|
||||
do {
|
||||
count++;
|
||||
changed = apply_compatability_migrations(ref window);
|
||||
} while (count < 100 && changed);
|
||||
|
||||
if (count == 100) {
|
||||
Log.Persist.error("Error: Window state migration still changing after 100 iterations. Please check IShellWindowMigrationRule logic.");
|
||||
}
|
||||
|
||||
return restore(window.owner, window.app_data, window.position);
|
||||
}
|
||||
|
||||
/// When we apply the migration changes to a window we stop as soon as one "matches" and updates the state
|
||||
/// Since it's possible that we have multiple levels of migration we run this function until the data stops changing (or 100 iterations)
|
||||
/// ex: If change the data format twice from A to B to C then we would write 2 IShellWindowMigration instances.
|
||||
/// Starting in state A one of the _compat tests changes to state B. Now we need to re-run
|
||||
/// the migrations because state B will match a different rule and be converted to state C.
|
||||
private bool apply_compatability_migrations(ref WindowState window) {
|
||||
foreach (var test in _compat) {
|
||||
try {
|
||||
if (test.apply(ref window)) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Persist.error("Exception running compat rule {0}.\n{1}".fmt(test.GetType().Name, e.ToString()));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private async Task<IShellWindow> restore(string owner_name, byte[] state, WindowPosition windowPosition) {
|
||||
IShellModule owner = modules.empty_if_null().SingleOrDefault(m => m.key() == owner_name);
|
||||
if (owner == null) {
|
||||
Log.Ui.warn("Could not locate module '{0}'".fmt(owner_name));
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Task<IShellWindow> task = owner.create(new MemoryStream(state));
|
||||
if (task != null) {
|
||||
IShellWindow window = await task;
|
||||
if (window != null) {
|
||||
window.set_start_position(windowPosition);
|
||||
Log.Ui.info($"Restoring window {owner_name} - {window.diagnostic_name()}.");
|
||||
}
|
||||
return window;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Ui.error("Failure to re-create window for module {0}. Error: {1}".fmt(owner_name, e.Message));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts;
|
||||
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.settings {
|
||||
public interface ISavedWindowFactory {
|
||||
Task<IShellWindow> restore(WindowState window);
|
||||
}
|
||||
|
||||
[Export(typeof(ISavedWindowFactory))]
|
||||
public class WindowFactory : ISavedWindowFactory {
|
||||
IShellWindowMigrationRule[] _compat;
|
||||
|
||||
[ImportingConstructor]
|
||||
public WindowFactory([ImportMany] IShellWindowMigrationRule[] migration) {
|
||||
_compat = migration;
|
||||
}
|
||||
|
||||
[Import]
|
||||
public ObservableCollection<IShellModule> modules { get; set; }
|
||||
|
||||
public Task<IShellWindow> restore(WindowState window) {
|
||||
Log.Ui.info("Loading window '{0}'".fmt(window.title));
|
||||
bool changed;
|
||||
int count = 0;
|
||||
do {
|
||||
count++;
|
||||
changed = apply_compatability_migrations(ref window);
|
||||
} while (count < 100 && changed);
|
||||
|
||||
if (count == 100) {
|
||||
Log.Persist.error("Error: Window state migration still changing after 100 iterations. Please check IShellWindowMigrationRule logic.");
|
||||
}
|
||||
|
||||
return restore(window.owner, window.app_data, window.position);
|
||||
}
|
||||
|
||||
/// When we apply the migration changes to a window we stop as soon as one "matches" and updates the state
|
||||
/// Since it's possible that we have multiple levels of migration we run this function until the data stops changing (or 100 iterations)
|
||||
/// ex: If change the data format twice from A to B to C then we would write 2 IShellWindowMigration instances.
|
||||
/// Starting in state A one of the _compat tests changes to state B. Now we need to re-run
|
||||
/// the migrations because state B will match a different rule and be converted to state C.
|
||||
private bool apply_compatability_migrations(ref WindowState window) {
|
||||
foreach (var test in _compat) {
|
||||
try {
|
||||
if (test.apply(ref window)) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Persist.error("Exception running compat rule {0}.\n{1}".fmt(test.GetType().Name, e.ToString()));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private async Task<IShellWindow> restore(string owner_name, byte[] state, WindowPosition windowPosition) {
|
||||
IShellModule owner = modules.empty_if_null().SingleOrDefault(m => m.key() == owner_name);
|
||||
if (owner == null) {
|
||||
Log.Ui.warn("Could not locate module '{0}'".fmt(owner_name));
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
Task<IShellWindow> task = owner.create(new MemoryStream(state));
|
||||
if (task != null) {
|
||||
IShellWindow window = await task;
|
||||
if (window != null) {
|
||||
window.set_start_position(windowPosition);
|
||||
Log.Ui.info($"Restoring window {owner_name} - {window.diagnostic_name()}.");
|
||||
}
|
||||
return window;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Ui.error("Failure to re-create window for module {0}. Error: {1}".fmt(owner_name, e.Message));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+113
-86
@@ -1,86 +1,113 @@
|
||||
using bts;
|
||||
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace mbts.ui.settings {
|
||||
public interface ISettingsCollector {
|
||||
// Get the save state for every open window
|
||||
IEnumerable<WindowState> get_window_state();
|
||||
WindowState get_window_state(IShellWindow window);
|
||||
IEnumerable<ModuleState> get_module_state();
|
||||
WindowPosition get_launcher_state();
|
||||
}
|
||||
|
||||
[Export(typeof(ISettingsCollector))]
|
||||
class SettingsCollector : ISettingsCollector {
|
||||
WindowManager _wm;
|
||||
ILauncher _launcher;
|
||||
|
||||
[ImportingConstructor]
|
||||
public SettingsCollector(WindowManager wm, ILauncher launcher) {
|
||||
_wm = wm;
|
||||
_launcher = launcher;
|
||||
}
|
||||
|
||||
[Import]
|
||||
public ObservableCollection<IShellModule> modules { get; set; }
|
||||
|
||||
IWindowsInterop _interop => _wm;
|
||||
|
||||
public IEnumerable<WindowState> get_window_state() {
|
||||
foreach (var window in _wm.list_windows()) {
|
||||
// Check that the window is still open since we might be iterating asyncronously
|
||||
if (_wm.contains(window)) {
|
||||
var state = get_window_state(window);
|
||||
if (state != null) {
|
||||
yield return state;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<ModuleState> get_module_state() {
|
||||
//Note: I'm assuming that the list of modules is stable and I don't have to protect against it changing here
|
||||
foreach (var module in modules.OfTypeSafe<IPersistShellModule>()) {
|
||||
MemoryStream out_stream = new MemoryStream();
|
||||
module.get_state(out_stream);
|
||||
yield return new ModuleState() {
|
||||
name = module.key(),
|
||||
app_data = out_stream.ToArray(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public WindowPosition get_launcher_state() {
|
||||
return _launcher.get_position();
|
||||
}
|
||||
|
||||
public WindowState get_window_state(IShellWindow window) {
|
||||
try {
|
||||
if (window == null || window.Owner == null) return null;
|
||||
MemoryStream out_stream = new MemoryStream();
|
||||
window.GetState(out_stream);
|
||||
|
||||
var pos = _interop.GetPosition(window);
|
||||
var state = new WindowState() {
|
||||
owner = window.Owner.key(),
|
||||
app_data = out_stream.ToArray(),
|
||||
position = pos,
|
||||
title = string.IsNullOrEmpty(pos.custom_title) ? window.Title : pos.custom_title
|
||||
};
|
||||
return state;
|
||||
} catch (Exception e) {
|
||||
Log.Ui.error("Error saving window state for type {0}.\n {1}".fmt(window.GetType(), e.Message));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
using bts;
|
||||
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace mbts.ui.settings {
|
||||
public interface ISettingsCollector {
|
||||
// Get the save state for every open window
|
||||
Task<List<WindowState>> get_window_state();
|
||||
Task<WindowState> get_window_state(IShellWindow window);
|
||||
IEnumerable<ModuleState> get_module_state();
|
||||
WindowPosition get_launcher_state();
|
||||
}
|
||||
|
||||
[Export(typeof(ISettingsCollector))]
|
||||
class SettingsCollector : ISettingsCollector {
|
||||
WindowManager _wm;
|
||||
ILauncher _launcher;
|
||||
|
||||
[ImportingConstructor]
|
||||
public SettingsCollector(WindowManager wm, ILauncher launcher) {
|
||||
_wm = wm;
|
||||
_launcher = launcher;
|
||||
}
|
||||
|
||||
[Import]
|
||||
public ObservableCollection<IShellModule> modules { get; set; }
|
||||
|
||||
[Import]
|
||||
public IShellThreadFactory thread_factory { get; set; }
|
||||
|
||||
IWindowsInterop _interop => _wm;
|
||||
|
||||
public async Task<List<WindowState>> get_window_state() {
|
||||
var windows = _wm.list_windows();
|
||||
var rv = new List<WindowState>(windows.Count);
|
||||
foreach (var window in windows) {
|
||||
// Check that the window is still open since we might be iterating asyncronously
|
||||
if (_wm.contains(window)) {
|
||||
var state = await get_window_state(window);
|
||||
if (state != null) {
|
||||
rv.Add(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public IEnumerable<ModuleState> get_module_state() {
|
||||
//Note: I'm assuming that the list of modules is stable and I don't have to protect against it changing here
|
||||
foreach (var module in modules.OfTypeSafe<IPersistShellModule>()) {
|
||||
MemoryStream out_stream = new MemoryStream();
|
||||
module.get_state(out_stream);
|
||||
yield return new ModuleState() {
|
||||
name = module.key(),
|
||||
app_data = out_stream.ToArray(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public WindowPosition get_launcher_state() {
|
||||
return _launcher.get_position();
|
||||
}
|
||||
|
||||
public async Task<WindowState> get_window_state(IShellWindow window) {
|
||||
try {
|
||||
if (window == null || window.Owner == null) return null;
|
||||
Dispatcher dispatcher = null;
|
||||
if (window is ISlowWindow) {
|
||||
var tf = thread_factory;
|
||||
if (tf is not null) {
|
||||
var thread_id = (window as ISharedWindow)?.thread_id;
|
||||
dispatcher = tf.get_dispatcher(thread_id);
|
||||
if (dispatcher is null) {
|
||||
Log.Gen.error(
|
||||
$"Unable to get window state for '{window.Title}.' " +
|
||||
$"Didn't find dispatcher for thread {thread_id}.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var pos = _interop.GetPosition(window);
|
||||
var state = new WindowState() {
|
||||
owner = window.Owner.key(),
|
||||
app_data = dispatcher is null ?
|
||||
(await dispatcher.InvokeAsync(serialize)) : serialize(),
|
||||
position = pos,
|
||||
title = string.IsNullOrEmpty(pos.custom_title) ? window.Title : pos.custom_title
|
||||
};
|
||||
return state;
|
||||
|
||||
byte[] serialize() {
|
||||
using var ms = new MemoryStream();
|
||||
window.GetState(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.Ui.error("Error saving window state for type {0}.\n {1}".fmt(window.GetType(), e.Message));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+95
-95
@@ -1,95 +1,95 @@
|
||||
using bts.shell.pnl;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.ui.settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bts.settings {
|
||||
interface ISettingsMigrationRule<T> {
|
||||
bool apply(T settings, out T new_settings);
|
||||
}
|
||||
|
||||
// Migration rules of type ISettingsMigrationRule<T>, where 'T' is a common type, such as GridSettings,
|
||||
// should be exposed through explicitly named interfaces that inherit ISettingsMigrationRule<T>.
|
||||
// This avoids magic const names in the MEF import/export contracts, which would otherwise be needed to
|
||||
// determine the various windows to which such rules apply.
|
||||
interface IFillsGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IMarketViewGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IPAndLGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IPNLSettingsMigrationRule : ISettingsMigrationRule<PNLSettings> { }
|
||||
interface ISyntheticManagementMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IReconcileReportMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
|
||||
static class SettingsMigrationHelper {
|
||||
public static bool apply<T>(T settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules, out T new_settings) {
|
||||
bool applied = false;
|
||||
foreach (var r in migration_rules) {
|
||||
if (r.apply(settings, out var migrated)) {
|
||||
settings = migrated;
|
||||
applied = true;
|
||||
}
|
||||
}
|
||||
new_settings = applied ? settings : default;
|
||||
return applied;
|
||||
}
|
||||
|
||||
public static void apply_quiet<T>(ref T settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules) {
|
||||
if (apply(settings, migration_rules, out var new_settings))
|
||||
settings = new_settings;
|
||||
}
|
||||
|
||||
public static ISettingsMigrationRule<T> merge<T>(this IEnumerable<ISettingsMigrationRule<T>> rules) =>
|
||||
new MergeWrapper<T>(rules);
|
||||
|
||||
public static ISettingsMigrationRule<TOuter> wrap<TInner, TOuter>(this ISettingsMigrationRule<TInner> rule, IImmutableProperty<TOuter, TInner> propi) =>
|
||||
new SelectorWrapper<TInner, TOuter>(rule, propi.get, propi.set);
|
||||
|
||||
public static ISettingsMigrationRule<TOuter> wrap<TInner, TOuter>(this ISettingsMigrationRule<TInner> rule, Func<TOuter, TInner> get, Func<TOuter, TInner, TOuter> set) =>
|
||||
new SelectorWrapper<TInner, TOuter>(rule, get, set);
|
||||
|
||||
class MergeWrapper<T> : ISettingsMigrationRule<T> {
|
||||
readonly IEnumerable<ISettingsMigrationRule<T>> _rules;
|
||||
|
||||
public MergeWrapper(IEnumerable<ISettingsMigrationRule<T>> rules) =>
|
||||
_rules = rules;
|
||||
|
||||
public bool apply(T settings, out T new_settings) {
|
||||
bool applied = false;
|
||||
foreach (var r in _rules) {
|
||||
if (r.apply(settings, out var migrated)) {
|
||||
settings = migrated;
|
||||
applied = true;
|
||||
}
|
||||
}
|
||||
new_settings = applied ? settings : default;
|
||||
return applied;
|
||||
}
|
||||
}
|
||||
|
||||
class SelectorWrapper<TInner, TOuter> : ISettingsMigrationRule<TOuter> {
|
||||
readonly ISettingsMigrationRule<TInner> _rule;
|
||||
readonly Func<TOuter, TInner> _get;
|
||||
readonly Func<TOuter, TInner, TOuter> _set;
|
||||
|
||||
public SelectorWrapper(ISettingsMigrationRule<TInner> rule, Func<TOuter, TInner> get, Func<TOuter, TInner, TOuter> set) {
|
||||
_rule = rule;
|
||||
_get = get;
|
||||
_set = set;
|
||||
}
|
||||
|
||||
public bool apply(TOuter settings, out TOuter new_settings) {
|
||||
if (settings != null) {
|
||||
var ival = _get(settings);
|
||||
if (_rule.apply(ival, out var new_ival)) {
|
||||
new_settings = _set(settings, new_ival);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
new_settings = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts.shell.pnl;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.ui.settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace bts.settings {
|
||||
interface ISettingsMigrationRule<T> {
|
||||
bool apply(T settings, out T new_settings);
|
||||
}
|
||||
|
||||
// Migration rules of type ISettingsMigrationRule<T>, where 'T' is a common type, such as GridSettings,
|
||||
// should be exposed through explicitly named interfaces that inherit ISettingsMigrationRule<T>.
|
||||
// This avoids magic const names in the MEF import/export contracts, which would otherwise be needed to
|
||||
// determine the various windows to which such rules apply.
|
||||
interface IFillsGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IMarketViewGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IPAndLGridSettingsMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IPNLSettingsMigrationRule : ISettingsMigrationRule<PNLSettings> { }
|
||||
interface ISyntheticManagementMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
interface IReconcileReportMigrationRule : ISettingsMigrationRule<GridSettings> { }
|
||||
|
||||
static class SettingsMigrationHelper {
|
||||
public static bool apply<T>(T settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules, out T new_settings) {
|
||||
bool applied = false;
|
||||
foreach (var r in migration_rules) {
|
||||
if (r.apply(settings, out var migrated)) {
|
||||
settings = migrated;
|
||||
applied = true;
|
||||
}
|
||||
}
|
||||
new_settings = applied ? settings : default;
|
||||
return applied;
|
||||
}
|
||||
|
||||
public static void apply_quiet<T>(ref T settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules) {
|
||||
if (apply(settings, migration_rules, out var new_settings))
|
||||
settings = new_settings;
|
||||
}
|
||||
|
||||
public static ISettingsMigrationRule<T> merge<T>(this IEnumerable<ISettingsMigrationRule<T>> rules) =>
|
||||
new MergeWrapper<T>(rules);
|
||||
|
||||
public static ISettingsMigrationRule<TOuter> wrap<TInner, TOuter>(this ISettingsMigrationRule<TInner> rule, IImmutableProperty<TOuter, TInner> propi) =>
|
||||
new SelectorWrapper<TInner, TOuter>(rule, propi.get, propi.set);
|
||||
|
||||
public static ISettingsMigrationRule<TOuter> wrap<TInner, TOuter>(this ISettingsMigrationRule<TInner> rule, Func<TOuter, TInner> get, Func<TOuter, TInner, TOuter> set) =>
|
||||
new SelectorWrapper<TInner, TOuter>(rule, get, set);
|
||||
|
||||
class MergeWrapper<T> : ISettingsMigrationRule<T> {
|
||||
readonly IEnumerable<ISettingsMigrationRule<T>> _rules;
|
||||
|
||||
public MergeWrapper(IEnumerable<ISettingsMigrationRule<T>> rules) =>
|
||||
_rules = rules;
|
||||
|
||||
public bool apply(T settings, out T new_settings) {
|
||||
bool applied = false;
|
||||
foreach (var r in _rules) {
|
||||
if (r.apply(settings, out var migrated)) {
|
||||
settings = migrated;
|
||||
applied = true;
|
||||
}
|
||||
}
|
||||
new_settings = applied ? settings : default;
|
||||
return applied;
|
||||
}
|
||||
}
|
||||
|
||||
class SelectorWrapper<TInner, TOuter> : ISettingsMigrationRule<TOuter> {
|
||||
readonly ISettingsMigrationRule<TInner> _rule;
|
||||
readonly Func<TOuter, TInner> _get;
|
||||
readonly Func<TOuter, TInner, TOuter> _set;
|
||||
|
||||
public SelectorWrapper(ISettingsMigrationRule<TInner> rule, Func<TOuter, TInner> get, Func<TOuter, TInner, TOuter> set) {
|
||||
_rule = rule;
|
||||
_get = get;
|
||||
_set = set;
|
||||
}
|
||||
|
||||
public bool apply(TOuter settings, out TOuter new_settings) {
|
||||
if (settings != null) {
|
||||
var ival = _get(settings);
|
||||
if (_rule.apply(ival, out var new_ival)) {
|
||||
new_settings = _set(settings, new_ival);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
new_settings = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+152
-171
@@ -1,171 +1,152 @@
|
||||
using mbts.spark;
|
||||
using mbts.utils;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
interface IWindowSettingsManager<T> where T : class {
|
||||
T instance_settings { get; set; }
|
||||
T default_settings { get; }
|
||||
event Action<T> instance_settings_changed;
|
||||
IObservable<T> subscribe_default();
|
||||
Task save_default_settings(T value);
|
||||
IWindowSettingsManagerNonShared<T> as_non_shared();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An implementation of IWindowSettingsManager that uses a clone of the actual default settings;
|
||||
/// provides a convenient way to avoid problems that arise from sharing a single default settings object among multiple window instances.
|
||||
/// </summary>
|
||||
interface IWindowSettingsManagerNonShared<T> : IWindowSettingsManager<T>, IDisposable where T : class { }
|
||||
|
||||
class WindowSettingsManager<T> : IWindowSettingsManager<T> where T : class {
|
||||
readonly UserSettingsHub _hub;
|
||||
readonly Func<UserSettings, T> _get;
|
||||
readonly Func<UserSettings, T, UserSettings> _set;
|
||||
T _instance_settings;
|
||||
|
||||
public WindowSettingsManager(UserSettingsHub hub, T instance_settings, Func<UserSettings, T> get, Func<UserSettings, T, UserSettings> set) {
|
||||
_hub = hub;
|
||||
_instance_settings = instance_settings;
|
||||
_get = get;
|
||||
_set = set;
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _instance_settings;
|
||||
set {
|
||||
_instance_settings = value;
|
||||
instance_settings_changed?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
public T default_settings => _get(_hub.current);
|
||||
|
||||
public event Action<T> instance_settings_changed;
|
||||
|
||||
public async Task save_default_settings(T value) =>
|
||||
await _hub.save_default(_set(_hub.current, value));
|
||||
|
||||
public IObservable<T> subscribe_default() =>
|
||||
_hub.subscribe_default_settings().Select(_get).DistinctUntilChanged();
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() =>
|
||||
new NonSharedWrapper(this);
|
||||
|
||||
class NonSharedWrapper : IWindowSettingsManagerNonShared<T> {
|
||||
readonly IWindowSettingsManager<T> _wsm;
|
||||
readonly BehaviorSubject<T> _default_subject;
|
||||
IDisposable _dispose;
|
||||
|
||||
public NonSharedWrapper(IWindowSettingsManager<T> wsm) {
|
||||
_wsm = wsm;
|
||||
_default_subject = new BehaviorSubject<T>(_wsm.default_settings);
|
||||
_dispose = wsm.subscribe_default().Subscribe(s =>
|
||||
_default_subject.OnNext(default_settings = MiscUtils.clone_proto(s)));
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _wsm.instance_settings;
|
||||
set => _wsm.instance_settings = value;
|
||||
}
|
||||
public T default_settings { get; private set; }
|
||||
public event Action<T> instance_settings_changed {
|
||||
add => _wsm.instance_settings_changed += value;
|
||||
remove => _wsm.instance_settings_changed -= value;
|
||||
}
|
||||
public async Task save_default_settings(T value) =>
|
||||
await _wsm.save_default_settings(value);
|
||||
|
||||
public IObservable<T> subscribe_default() =>
|
||||
_default_subject.AsObservable();
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() =>
|
||||
new NonSharedWrapper(_wsm);
|
||||
|
||||
public void Dispose() => Disposable.dispose(ref _dispose);
|
||||
}
|
||||
|
||||
public class DisconnectedImpl : IWindowSettingsManager<T> {
|
||||
readonly BehaviorSubject<T> _default_settings_subject;
|
||||
T _instance_settings, _default_settings;
|
||||
|
||||
public DisconnectedImpl(T settings) : this(settings, settings) { }
|
||||
public DisconnectedImpl(T instance_settings, T default_settings) {
|
||||
_instance_settings = instance_settings;
|
||||
_default_settings = default_settings;
|
||||
_default_settings_subject = new BehaviorSubject<T>(default_settings);
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _instance_settings;
|
||||
set {
|
||||
if (!Equals(_instance_settings, value)) {
|
||||
_instance_settings = value;
|
||||
instance_settings_changed?.Invoke(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
public T default_settings {
|
||||
get => _default_settings;
|
||||
set {
|
||||
if (!Equals(_default_settings, _default_settings)) {
|
||||
_default_settings = value;
|
||||
_default_settings_subject.OnNext(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<T> instance_settings_changed;
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() => new NonSharedWrapper(this);
|
||||
public Task save_default_settings(T value) {
|
||||
default_settings = value;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
public IObservable<T> subscribe_default() => _default_settings_subject;
|
||||
}
|
||||
}
|
||||
|
||||
static class WindowSettingsManagerExtensions {
|
||||
/// <summary>
|
||||
/// Returns an observable sequence of the settings object used by a particular window.
|
||||
/// <para/>Note: 'Instance' settings take priority over 'default' settings. While the former is present, any changes to the latter will be ignored.
|
||||
/// </summary>
|
||||
public static IObservable<T> subscribe_current<T>(this IWindowSettingsManager<T> wsm) where T : class =>
|
||||
Observable.CombineLatest(
|
||||
Observable.FromEvent<Action<T>, T>(cb => wsm.instance_settings_changed += cb, cb => wsm.instance_settings_changed -= cb)
|
||||
.StartWith(wsm.instance_settings),
|
||||
wsm.subscribe_default(),
|
||||
(i, d) => i ?? d
|
||||
).Where(v => v != null)
|
||||
.DistinctUntilChanged();
|
||||
|
||||
public static IObservable<T> subscribe_current<T>(this IWindowSettingsManager<T> wsm, Func<(T defaults, T instance), T> merge_settings) where T : class, IDefaultableSettings {
|
||||
return Observable.Create<T>(o => {
|
||||
IDisposable defaults_sub = wsm.subscribe_default().Subscribe(_ => o.OnNext(get_current()));
|
||||
wsm.instance_settings_changed += on_instance_settings_changed;
|
||||
return Disposable.Create(() => {
|
||||
defaults_sub.Dispose();
|
||||
wsm.instance_settings_changed -= on_instance_settings_changed;
|
||||
});
|
||||
void on_instance_settings_changed(T _) =>
|
||||
o.OnNext(get_current());
|
||||
});
|
||||
T get_current() {
|
||||
var inst = wsm.instance_settings;
|
||||
if (inst == null) return wsm.default_settings;
|
||||
if (inst.use_defaults) return merge_settings((wsm.default_settings, inst));
|
||||
return inst;
|
||||
}
|
||||
}
|
||||
|
||||
public static T current_settings<T>(this IWindowSettingsManager<T> wsm) where T : class =>
|
||||
wsm.instance_settings ?? wsm.default_settings;
|
||||
}
|
||||
}
|
||||
using mbts.spark;
|
||||
using mbts.utils;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
interface IWindowSettingsManager<T> where T : class {
|
||||
T instance_settings { get; set; }
|
||||
T default_settings { get; }
|
||||
event Action<T> instance_settings_changed;
|
||||
IObservable<T> subscribe_default();
|
||||
Task save_default_settings(T value);
|
||||
IWindowSettingsManagerNonShared<T> as_non_shared();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An implementation of IWindowSettingsManager that uses a clone of the actual default settings;
|
||||
/// provides a convenient way to avoid problems that arise from sharing a single default settings object among multiple window instances.
|
||||
/// </summary>
|
||||
interface IWindowSettingsManagerNonShared<T> : IWindowSettingsManager<T>, IDisposable where T : class { }
|
||||
|
||||
class WindowSettingsManager<T> : IWindowSettingsManager<T> where T : class {
|
||||
readonly UserSettingsHub _hub;
|
||||
readonly Func<UserSettings, T> _get;
|
||||
readonly Func<UserSettings, T, UserSettings> _set;
|
||||
T _instance_settings;
|
||||
|
||||
public WindowSettingsManager(UserSettingsHub hub, T instance_settings, Func<UserSettings, T> get, Func<UserSettings, T, UserSettings> set) {
|
||||
_hub = hub;
|
||||
_instance_settings = instance_settings;
|
||||
_get = get;
|
||||
_set = set;
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _instance_settings;
|
||||
set {
|
||||
_instance_settings = value;
|
||||
instance_settings_changed?.Invoke(value);
|
||||
}
|
||||
}
|
||||
|
||||
public T default_settings => _get(_hub.current);
|
||||
|
||||
public event Action<T> instance_settings_changed;
|
||||
|
||||
public async Task save_default_settings(T value) =>
|
||||
await _hub.save_default(_set(_hub.current, value));
|
||||
|
||||
public IObservable<T> subscribe_default() =>
|
||||
_hub.subscribe_default_settings().Select(_get).DistinctUntilChanged();
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() =>
|
||||
new NonSharedWrapper(this);
|
||||
|
||||
class NonSharedWrapper : IWindowSettingsManagerNonShared<T> {
|
||||
readonly IWindowSettingsManager<T> _wsm;
|
||||
readonly BehaviorSubject<T> _default_subject;
|
||||
IDisposable _dispose;
|
||||
|
||||
public NonSharedWrapper(IWindowSettingsManager<T> wsm) {
|
||||
_wsm = wsm;
|
||||
_default_subject = new BehaviorSubject<T>(_wsm.default_settings);
|
||||
_dispose = wsm.subscribe_default().Subscribe(s =>
|
||||
_default_subject.OnNext(default_settings = MiscUtils.clone_proto(s)));
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _wsm.instance_settings;
|
||||
set => _wsm.instance_settings = value;
|
||||
}
|
||||
public T default_settings { get; private set; }
|
||||
public event Action<T> instance_settings_changed {
|
||||
add => _wsm.instance_settings_changed += value;
|
||||
remove => _wsm.instance_settings_changed -= value;
|
||||
}
|
||||
public async Task save_default_settings(T value) =>
|
||||
await _wsm.save_default_settings(value);
|
||||
|
||||
public IObservable<T> subscribe_default() =>
|
||||
_default_subject.AsObservable();
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() =>
|
||||
new NonSharedWrapper(_wsm);
|
||||
|
||||
public void Dispose() => Disposable.dispose(ref _dispose);
|
||||
}
|
||||
|
||||
public class DisconnectedImpl : IWindowSettingsManager<T> {
|
||||
readonly BehaviorSubject<T> _default_settings_subject;
|
||||
T _instance_settings, _default_settings;
|
||||
|
||||
public DisconnectedImpl(T settings) : this(settings, settings) { }
|
||||
public DisconnectedImpl(T instance_settings, T default_settings) {
|
||||
_instance_settings = instance_settings;
|
||||
_default_settings = default_settings;
|
||||
_default_settings_subject = new BehaviorSubject<T>(default_settings);
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
get => _instance_settings;
|
||||
set {
|
||||
if (!Equals(_instance_settings, value)) {
|
||||
_instance_settings = value;
|
||||
instance_settings_changed?.Invoke(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
public T default_settings {
|
||||
get => _default_settings;
|
||||
set {
|
||||
if (!Equals(_default_settings, _default_settings)) {
|
||||
_default_settings = value;
|
||||
_default_settings_subject.OnNext(value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<T> instance_settings_changed;
|
||||
|
||||
public IWindowSettingsManagerNonShared<T> as_non_shared() => new NonSharedWrapper(this);
|
||||
public Task save_default_settings(T value) {
|
||||
default_settings = value;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
public IObservable<T> subscribe_default() => _default_settings_subject;
|
||||
}
|
||||
}
|
||||
|
||||
static class WindowSettingsManagerExtensions {
|
||||
/// <summary>
|
||||
/// Returns an observable sequence of the settings object used by a particular window.
|
||||
/// <para/>Note: 'Instance' settings take priority over 'default' settings. While the former is present, any changes to the latter will be ignored.
|
||||
/// </summary>
|
||||
public static IObservable<T> subscribe_current<T>(this IWindowSettingsManager<T> wsm) where T : class =>
|
||||
Observable.CombineLatest(
|
||||
Observable.FromEvent<Action<T>, T>(cb => wsm.instance_settings_changed += cb, cb => wsm.instance_settings_changed -= cb)
|
||||
.StartWith(wsm.instance_settings),
|
||||
wsm.subscribe_default(),
|
||||
(i, d) => i ?? d
|
||||
).Where(v => v != null)
|
||||
.DistinctUntilChanged();
|
||||
|
||||
public static T current_settings<T>(this IWindowSettingsManager<T> wsm) where T : class =>
|
||||
wsm.instance_settings ?? wsm.default_settings;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
#nullable enable
|
||||
namespace mbts.persist {
|
||||
using bts;
|
||||
using bts.api.core;
|
||||
using bts.api.persistence;
|
||||
using bts.spark;
|
||||
|
||||
using Spark.Core.Protobuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
public class SettingsPersistenceModel : IPersist, IUserPersist {
|
||||
readonly PersistenceService _persist;
|
||||
readonly ErrorReporter _errors;
|
||||
readonly string _user;
|
||||
|
||||
public SettingsPersistenceModel(
|
||||
string user, PersistenceService persist, ErrorReporter errors) {
|
||||
_user = user;
|
||||
_persist = persist;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
public Task set<T>(string ns, string key, T value) {
|
||||
return _persist.store_async(new StoreRequest() {
|
||||
Ns = _user_ns(ns),
|
||||
Record = {
|
||||
new Record() {
|
||||
Key = key,
|
||||
Value = ProtobufSerializationHelper.serialize_to_byte_string(value)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Task clear(string ns, string key) {
|
||||
return _persist.remove_async(new RemoveRequest() {
|
||||
Ns = _user_ns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<T?> get<T>(string ns, string key) {
|
||||
var ret = await _persist.retrieve_async(new RetrieveRequest() {
|
||||
Ns = _user_ns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
_check_error(ret, ns, key, out var empty);
|
||||
if (empty) {
|
||||
return default;
|
||||
}
|
||||
return ProtobufSerializationHelper.deserialize<T>(ret.value.Record.Single().Value);
|
||||
}
|
||||
|
||||
public async Task<T[]> get_many<T>(string ns, string key) {
|
||||
var ret = await _persist.retrieve_async(new RetrieveRequest() {
|
||||
Ns = _user_ns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
_check_error(ret, ns, key, out bool empty);
|
||||
if (empty) {
|
||||
return Array.Empty<T>();
|
||||
}
|
||||
return ProtobufSerializationHelper.deserialize_many<T>(
|
||||
ret.value.Record.Single().Value.ToByteArray());
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<PersistResult<T>>> query<T>(string ns, string pattern) {
|
||||
var regex = new Regex(pattern);
|
||||
var results = await _persist.retrieve_all_async(
|
||||
new RetrieveAllRequest() {
|
||||
Ns = _user_ns(ns)
|
||||
});
|
||||
_check_error(results, ns, string.Empty, out bool empty);
|
||||
if (empty) {
|
||||
return Enumerable.Empty<PersistResult<T>>();
|
||||
}
|
||||
return results.value.Record
|
||||
.Where(r => regex.IsMatch(r.Key))
|
||||
.Select(r => new PersistResult<T>() {
|
||||
user = _user,
|
||||
ns = ns,
|
||||
key = r.Key,
|
||||
value = ProtobufSerializationHelper.deserialize<T>(r.Value)
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public IDisposable subscribe<T>(
|
||||
string ns, string pattern, Action<IEnumerable<PersistResult<T>>> callback) =>
|
||||
subscribe<T>(ns, pattern).Subscribe(callback);
|
||||
|
||||
public IObservable<IEnumerable<PersistResult<T>>> subscribe<T>(string ns, string pattern) {
|
||||
var ctx = SynchronizationContext.Current ??
|
||||
throw new InvalidOperationException("Current SynchronizationContext is null");
|
||||
var re = new Regex(pattern);
|
||||
return _persist
|
||||
.subscribe_ns(_user_ns(ns))
|
||||
.Select(update =>
|
||||
update.added
|
||||
.Where(item => re.IsMatch(item.Key))
|
||||
.Select(item => new PersistResult<T>() {
|
||||
user = _user,
|
||||
ns = ns,
|
||||
key = item.Key,
|
||||
value = ProtobufSerializationHelper.deserialize<T>(item.Value)
|
||||
}))
|
||||
.SubscribeOn(ctx);
|
||||
}
|
||||
|
||||
public void Dispose() =>
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
string _user_ns(string ns) =>
|
||||
$"{_user}#{ns}";
|
||||
|
||||
void _check_error(Result<RetrieveResponse> result, string ns, string key, out bool empty) {
|
||||
if (result.success) {
|
||||
switch (result.value.Result) {
|
||||
case RetrieveResponse.Types.Result.EmptyNs:
|
||||
case RetrieveResponse.Types.Result.NoSuchNs:
|
||||
case RetrieveResponse.Types.Result.NoSuchKey:
|
||||
empty = true;
|
||||
return;
|
||||
case RetrieveResponse.Types.Result.EmptyKey:
|
||||
case RetrieveResponse.Types.Result.DuplicateKey:
|
||||
_errors?.report_error(
|
||||
$"Invalid Key {result} '{key}'",
|
||||
"Requested Invalid Settings Key",
|
||||
MessageBoxImage.Information);
|
||||
empty = true;
|
||||
return;
|
||||
default:
|
||||
case RetrieveResponse.Types.Result.Ok:
|
||||
empty = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
_errors?.report_error(
|
||||
$"There was an error communicating with the settings server: {result.error_message}",
|
||||
"Failed to retrieve settings from the server");
|
||||
empty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Export(typeof(IPersist))]
|
||||
public class UISettings : SettingsPersistenceModel {
|
||||
[ImportingConstructor]
|
||||
public UISettings([Import("settings")] PersistenceService persist, ErrorReporter err)
|
||||
: base("all_users", persist, err) { }
|
||||
}
|
||||
|
||||
[Export(typeof(IUserPersist))]
|
||||
public class UserUISettings : SettingsPersistenceModel {
|
||||
public UserUISettings(
|
||||
uint user_id, [Import("settings")] PersistenceService persist, ErrorReporter err)
|
||||
: base($"User {user_id}", persist, err) { }
|
||||
|
||||
[ImportingConstructor]
|
||||
public UserUISettings(
|
||||
Lazy<UserTuple> user, [Import("settings")] PersistenceService persist, ErrorReporter err)
|
||||
: this(user.Value.id, persist, err) { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
#nullable enable
|
||||
namespace mbts.spark {
|
||||
using bts.utils;
|
||||
|
||||
using System;
|
||||
|
||||
interface ISettingsProfile<T> {
|
||||
uint id { get; }
|
||||
string? name { get; }
|
||||
T? value { get; }
|
||||
SecurityCriteria? security_criteria { get; }
|
||||
}
|
||||
|
||||
readonly struct SettingsProfile<T> : IEquatable<SettingsProfile<T>> where T : class, IEquatable<T> {
|
||||
public static readonly Func<SettingsProfile<T>, uint> key_fn = ns => ns.id;
|
||||
|
||||
public readonly uint id;
|
||||
public readonly string? name;
|
||||
public readonly T? value;
|
||||
public readonly SecurityCriteria? security_criteria;
|
||||
|
||||
public SettingsProfile(uint id, string? name, T? value, SecurityCriteria? security_criteria = null) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.security_criteria = security_criteria;
|
||||
}
|
||||
|
||||
public SettingsProfile<T> with(uint? id = null, string? name = null, T? value = null, SecurityCriteria? security_criteria = null) =>
|
||||
new(id ?? this.id, name ?? this.name, value ?? this.value, security_criteria ?? this.security_criteria);
|
||||
|
||||
public bool Equals(SettingsProfile<T> other) =>
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
value.safe_equals(other.value) &&
|
||||
security_criteria.safe_equals(other.security_criteria);
|
||||
|
||||
public override bool Equals(object? obj) =>
|
||||
obj is SettingsProfile<T> other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
id.GetHashCode();
|
||||
}
|
||||
}
|
||||
+73
-73
@@ -1,73 +1,73 @@
|
||||
using mbts.persist;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.tests {
|
||||
// Stub persistance store for shell unit tests
|
||||
public class TestPersist : IPersist, IUserPersist {
|
||||
public Dictionary<string, Dictionary<string, object>> Values = new Dictionary<string, Dictionary<string, object>>();
|
||||
|
||||
public Task set<T>(string ns, string key, T value) {
|
||||
TaskCompletionSource<object> source = new TaskCompletionSource<object>();
|
||||
try {
|
||||
Values[ns][key] = value;
|
||||
source.TrySetResult(null);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task clear(string ns, string key) {
|
||||
TaskCompletionSource<object> source = new TaskCompletionSource<object>();
|
||||
try {
|
||||
Values[ns].Remove(key);
|
||||
source.TrySetResult(null);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task<T> get<T>(string ns, string key) {
|
||||
TaskCompletionSource<T> source = new TaskCompletionSource<T>();
|
||||
try {
|
||||
T result = (T)Values[ns][key];
|
||||
source.TrySetResult(result);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task<T[]> get_many<T>(string ns, string key) {
|
||||
var source = new TaskCompletionSource<T[]>();
|
||||
try {
|
||||
source.TrySetResult((T[])Values[ns][key]);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Tuple<T, DateTime>>> get_history<T>(string ns, string key) {
|
||||
var res = await get<T>(ns, key);
|
||||
return new Tuple<T, DateTime>[] { Tuple.Create(res, DateTime.Today) };
|
||||
}
|
||||
|
||||
public Task<IEnumerable<PersistResult<T>>> query<T>(string ns, string pattern) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IDisposable subscribe<T>(string ns, string pattern, Action<IEnumerable<PersistResult<T>>> callback) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
using mbts.persist;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.tests {
|
||||
// Stub persistance store for shell unit tests
|
||||
public class TestPersist : IPersist, IUserPersist {
|
||||
public Dictionary<string, Dictionary<string, object>> Values = new Dictionary<string, Dictionary<string, object>>();
|
||||
|
||||
public Task set<T>(string ns, string key, T value) {
|
||||
TaskCompletionSource<object> source = new TaskCompletionSource<object>();
|
||||
try {
|
||||
Values[ns][key] = value;
|
||||
source.TrySetResult(null);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task clear(string ns, string key) {
|
||||
TaskCompletionSource<object> source = new TaskCompletionSource<object>();
|
||||
try {
|
||||
Values[ns].Remove(key);
|
||||
source.TrySetResult(null);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task<T> get<T>(string ns, string key) {
|
||||
TaskCompletionSource<T> source = new TaskCompletionSource<T>();
|
||||
try {
|
||||
T result = (T)Values[ns][key];
|
||||
source.TrySetResult(result);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public Task<T[]> get_many<T>(string ns, string key) {
|
||||
var source = new TaskCompletionSource<T[]>();
|
||||
try {
|
||||
source.TrySetResult((T[])Values[ns][key]);
|
||||
} catch (Exception e) {
|
||||
source.TrySetException(e);
|
||||
}
|
||||
return source.Task;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Tuple<T, DateTime>>> get_history<T>(string ns, string key) {
|
||||
var res = await get<T>(ns, key);
|
||||
return new Tuple<T, DateTime>[] { Tuple.Create(res, DateTime.Today) };
|
||||
}
|
||||
|
||||
public Task<IEnumerable<PersistResult<T>>> query<T>(string ns, string pattern) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IDisposable subscribe<T>(string ns, string pattern, Action<IEnumerable<PersistResult<T>>> callback) {
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void Dispose() { }
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+232
-195
@@ -1,195 +1,232 @@
|
||||
using bts.shell.pnl;
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
using mbts.ui.settings;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace mbts.spark {
|
||||
interface IDefaultableSettings {
|
||||
bool use_defaults { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The settings Mothership. All window - and any other future user based - settings should have a corresponding default member here.
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
class UserSettings {
|
||||
public static UserSettings factory_defaults =>
|
||||
new UserSettings {
|
||||
_ladder = LadderSettings.Default,
|
||||
_notification = NotificationSettings.Default,
|
||||
_market_view_grid = bts.shell.market_view.MarketViewSettings.DefaultGridSettings,
|
||||
_fills_grid = bts.shell.fills.FillsSettings.DefaultGridSettings,
|
||||
_time_and_sales_grid = bts.shell.time_and_sales.TimeAndSalesSettings.DefaultGridSettings,
|
||||
_synthetic_management_grid = bts.shell.SyntheticManagementWindowFactory.StartupData.DefaultGridSettings,
|
||||
_reconcile_report_grid = Spark.Trading.ReconcileReportSettings.Default().grid,
|
||||
_order_book_grid = bts.shell.orderbook.OrderBookStartupData.DefaultGrid
|
||||
};
|
||||
|
||||
[ProtoMember(1)]
|
||||
LadderSettings _ladder;
|
||||
[ProtoMember(11)]
|
||||
readonly LadderSettingsProfile[] _ladder_profiles;
|
||||
/// When Profiles Are Deleted, ladders that were using that profile shall copy the profile's settings to a local profile.
|
||||
/// Therefor:
|
||||
/// Deleted profile ids must never be reused.
|
||||
/// If they were reused, consider an unloaded workspace with ladders that were using the deleted profile.
|
||||
/// If such a workspace was reloaded after a new profile was saved with the deleted one's id, the ladders using that deleted profile would suddenly be using the new profile.
|
||||
/// To Prevent IDs From Being Recycled:
|
||||
/// The last profile id is stored in the protobuf (<see cref="_last_ladder_profile_id"/>).
|
||||
/// Anytime a profile is added, it shall use <see cref="next_ladder_profile_id"/>.
|
||||
[ProtoMember(12)]
|
||||
uint _last_ladder_profile_id;
|
||||
// removing NotificationSettings these from proto-serialization, since they are disabled by default for now.
|
||||
// This way, when they are enabled, there won't be any backwards compatability issues to worry about, as no clients will have persisted them yet.
|
||||
NotificationSettings _notification;
|
||||
|
||||
[ProtoMember(5)]
|
||||
GridSettings _market_view_grid;
|
||||
[ProtoMember(6)]
|
||||
GridSettings _time_and_sales_grid;
|
||||
[ProtoMember(7)]
|
||||
GridSettings _fills_grid;
|
||||
[ProtoMember(8)]
|
||||
GridSettings _synthetic_management_grid;
|
||||
[ProtoMember(14)]
|
||||
GridSettings _reconcile_report_grid;
|
||||
[ProtoMember(9)]
|
||||
bts.shell.orderbook.OrderBookGridSettings _order_book_grid;
|
||||
[ProtoMember(10)]
|
||||
PNLSettings _pnl;
|
||||
[ProtoMember(13)]
|
||||
GlobalAlertSettings _alerts;
|
||||
|
||||
public UserSettings() { }
|
||||
|
||||
public UserSettings(LadderSettingsProfile[] ladder_profiles) =>
|
||||
_ladder_profiles = ladder_profiles;
|
||||
|
||||
public LadderSettings ladder => _ladder ?? (_ladder = LadderSettings.Default);
|
||||
public IReadOnlyList<LadderSettingsProfile> ladder_profiles => _ladder_profiles ?? Array.Empty<LadderSettingsProfile>();
|
||||
public uint next_ladder_profile_id => _last_ladder_profile_id + 1;
|
||||
public NotificationSettings notification => _notification ?? (_notification = NotificationSettings.Default);
|
||||
public GridSettings market_view_grid => _market_view_grid ?? (_market_view_grid = bts.shell.market_view.MarketViewSettings.DefaultGridSettings);
|
||||
public GridSettings time_and_sales_grid => _time_and_sales_grid ?? (_time_and_sales_grid = GridSettings.Default.with(bts.shell.time_and_sales.TimeAndSalesSettings.DefaultColumns.all));
|
||||
public GridSettings fills_grid => _fills_grid ?? (_fills_grid = bts.shell.fills.FillsSettings.DefaultGridSettings);
|
||||
public GridSettings synthetic_management_grid => _synthetic_management_grid ?? (_synthetic_management_grid = bts.shell.SyntheticManagementWindowFactory.StartupData.DefaultGridSettings);
|
||||
public GridSettings reconcile_report_grid => _reconcile_report_grid ??= Spark.Trading.ReconcileReportSettings.Default().grid;
|
||||
public PNLSettings pnl => _pnl ?? (_pnl = PNLSettings.Default);
|
||||
public bts.shell.orderbook.OrderBookGridSettings order_book_grid => _order_book_grid ?? (_order_book_grid = bts.shell.orderbook.OrderBookStartupData.Default.grid_settings_wrapper());
|
||||
|
||||
public GlobalAlertSettings alerts => _alerts ?? (_alerts = new GlobalAlertSettings());
|
||||
|
||||
public UserSettings with(LadderSettings ladder = null,
|
||||
LadderSettingsProfile[] ladder_profiles = null,
|
||||
NotificationSettings notification = null,
|
||||
GridSettings provided_market_view_gridsettings = null,
|
||||
GridSettings time_and_sales = null,
|
||||
GridSettings provided_fills_gridsettings = null,
|
||||
GridSettings provided_synthetic_management_gridsettings = null,
|
||||
GridSettings reconcile_report_grid = null,
|
||||
PNLSettings pnl = null,
|
||||
bts.shell.orderbook.OrderBookGridSettings order_book_grid = null,
|
||||
GlobalAlertSettings alerts = null) {
|
||||
var us = new UserSettings(ladder_profiles ?? _ladder_profiles) {
|
||||
_ladder = ladder ?? _ladder,
|
||||
_notification = notification ?? _notification,
|
||||
_market_view_grid = provided_market_view_gridsettings ?? _market_view_grid,
|
||||
_time_and_sales_grid = time_and_sales ?? _time_and_sales_grid,
|
||||
_fills_grid = provided_fills_gridsettings ?? _fills_grid,
|
||||
_synthetic_management_grid = provided_synthetic_management_gridsettings ?? _synthetic_management_grid,
|
||||
_reconcile_report_grid = reconcile_report_grid ?? _reconcile_report_grid,
|
||||
_pnl = pnl ?? _pnl,
|
||||
_order_book_grid = order_book_grid ?? _order_book_grid,
|
||||
_alerts = alerts ?? _alerts
|
||||
};
|
||||
us._last_ladder_profile_id = Math.Max(_last_ladder_profile_id, us.ladder_profiles.Select(p => p.id).MaxOrDefault());
|
||||
return us;
|
||||
}
|
||||
|
||||
public static class FileExtensions {
|
||||
public const string
|
||||
GRID = "grid",
|
||||
LADDER = "ladder",
|
||||
PNL = "pnl";
|
||||
}
|
||||
}
|
||||
|
||||
// - currently all notification-triggers are in GridSettings
|
||||
// - the SoundNotificationSettings below are used to disable/enable SoundNotifications
|
||||
// - the ToastNotificationSettings below are used to disable/enable ToastNotifications, and adjust the flash-duration (if enabled).
|
||||
// - since this is a new feature, the ability to quickly enable/disable both types of notifications may save us the trouble of having to redeploy,
|
||||
// in the unfortunate event that a bug slipped through the cracks, or the performance impact is more significant than expected.
|
||||
// TODO: maybe globalize notification settings?
|
||||
[ProtoContract]
|
||||
class NotificationSettings {
|
||||
[ProtoMember(1)]
|
||||
readonly SoundNotificationSettings _sound_notification;
|
||||
[ProtoMember(2)]
|
||||
readonly ToastNotificationSettings _toast_notification;
|
||||
|
||||
public NotificationSettings() { }
|
||||
public NotificationSettings(SoundNotificationSettings sound_notification, ToastNotificationSettings toast_notification) {
|
||||
_sound_notification = sound_notification;
|
||||
_toast_notification = toast_notification;
|
||||
}
|
||||
|
||||
public static NotificationSettings Default => new NotificationSettings(SoundNotificationSettings.Default, ToastNotificationSettings.Default);
|
||||
|
||||
public SoundNotificationSettings sound_notification => _sound_notification;
|
||||
public ToastNotificationSettings toast_notification => _toast_notification;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
class SoundNotificationSettings {
|
||||
[ProtoMember(1)]
|
||||
readonly bool _enabled;
|
||||
|
||||
public SoundNotificationSettings() { }
|
||||
public SoundNotificationSettings(bool enabled) =>
|
||||
_enabled = enabled;
|
||||
|
||||
public static SoundNotificationSettings Default => new SoundNotificationSettings(true);
|
||||
|
||||
public bool enabled => _enabled;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
class ToastNotificationSettings {
|
||||
// though it is possible to infer such Modes from Duration values (null = Disabled, max = ManualClose, otherwise Flash)
|
||||
// this Mode enum makes the behavior very clear, and less likely to be misinterpretted down the road.
|
||||
// (without this enum, the meaning of "duration = null," and "duration = 0 seconds," is debatable)
|
||||
public enum Mode {
|
||||
Disabled,
|
||||
ManualClose,
|
||||
Flash
|
||||
}
|
||||
|
||||
public static ToastNotificationSettings Default =>
|
||||
new ToastNotificationSettings(Mode.Flash, new Duration { Seconds = 5 }, 320);
|
||||
|
||||
[ProtoMember(1)]
|
||||
readonly Mode _mode;
|
||||
[ProtoMember(2)]
|
||||
readonly Duration _duration;
|
||||
[ProtoMember(3)]
|
||||
readonly double _max_height;
|
||||
|
||||
public ToastNotificationSettings() { }
|
||||
public ToastNotificationSettings(Mode mode, Duration duration, double max_height) {
|
||||
_mode = mode;
|
||||
_duration = duration;
|
||||
_max_height = max_height;
|
||||
}
|
||||
|
||||
public Mode mode => _mode;
|
||||
public TimeSpan? duration => _mode == Mode.Flash ? _duration?.ToTimeSpan() ?? TimeSpan.FromSeconds(5) : new TimeSpan?();
|
||||
public double max_height => _max_height;
|
||||
}
|
||||
}
|
||||
#nullable enable
|
||||
namespace mbts.spark {
|
||||
using bts.shell;
|
||||
using bts.shell.fills;
|
||||
using bts.shell.market_view;
|
||||
using bts.shell.orderbook;
|
||||
using bts.shell.pnl;
|
||||
using bts.shell.time_and_sales;
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
using mbts.ui.settings;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using Spark.Trading;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
interface IDefaultableSettings {
|
||||
bool use_defaults { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The settings Mothership. All window - and any other future user based - settings should have a corresponding default member here.
|
||||
/// </summary>
|
||||
[ProtoContract]
|
||||
class UserSettings {
|
||||
public static UserSettings factory_defaults =>
|
||||
new() {
|
||||
_ladder = LadderSettings.Default,
|
||||
_notification = NotificationSettings.Default,
|
||||
_market_view_grid = MarketViewSettings.DefaultGridSettings,
|
||||
_fills_grid = FillsSettings.DefaultGridSettings,
|
||||
_time_and_sales_grid = TimeAndSalesSettings.DefaultGridSettings,
|
||||
_synthetic_management = SyntheticManagementSettings.default_grid_settings,
|
||||
_reconcile_report = ReconcileReportSettings.Default().grid,
|
||||
_order_book = OrderBookStartupData.DefaultGrid
|
||||
};
|
||||
|
||||
[ProtoMember(1)]
|
||||
LadderSettings? _ladder;
|
||||
[ProtoMember(11)]
|
||||
LadderSettingsProfile[]? _ladder_profiles;
|
||||
/// When Profiles Are Deleted, ladders that were using that profile shall copy the profile's settings to a local profile.
|
||||
/// Therefor:
|
||||
/// Deleted profile ids must never be reused.
|
||||
/// If they were reused, consider an unloaded workspace with ladders that were using the deleted profile.
|
||||
/// If such a workspace was reloaded after a new profile was saved with the deleted one's id, the ladders using that deleted profile would suddenly be using the new profile.
|
||||
/// To Prevent IDs From Being Recycled:
|
||||
/// The last profile id is stored in the protobuf (<see cref="_last_ladder_profile_id"/>).
|
||||
/// Anytime a profile is added, it shall use <see cref="next_ladder_profile_id"/>.
|
||||
[ProtoMember(12)]
|
||||
uint _last_ladder_profile_id;
|
||||
// removing NotificationSettings these from proto-serialization, since they are disabled by default for now.
|
||||
// This way, when they are enabled, there won't be any backwards compatability issues to worry about, as no clients will have persisted them yet.
|
||||
NotificationSettings? _notification;
|
||||
|
||||
[ProtoMember(5)]
|
||||
GridSettings? _market_view_grid;
|
||||
[ProtoMember(6)]
|
||||
GridSettings? _time_and_sales_grid;
|
||||
[ProtoMember(7)]
|
||||
GridSettings? _fills_grid;
|
||||
[ProtoMember(8)]
|
||||
GridSettings? _synthetic_management;
|
||||
[ProtoMember(14)]
|
||||
GridSettings? _reconcile_report;
|
||||
[ProtoMember(9)]
|
||||
OrderBookGridSettings? _order_book;
|
||||
[ProtoMember(10)]
|
||||
PNLSettings? _pnl;
|
||||
[ProtoMember(13)]
|
||||
GlobalAlertSettings? _alerts;
|
||||
|
||||
public UserSettings() { }
|
||||
|
||||
public LadderSettings ladder =>
|
||||
_ladder ??= LadderSettings.Default;
|
||||
|
||||
public IReadOnlyList<LadderSettingsProfile> ladder_profiles =>
|
||||
_ladder_profiles ?? Array.Empty<LadderSettingsProfile>();
|
||||
|
||||
public uint next_ladder_profile_id =>
|
||||
_last_ladder_profile_id + 1;
|
||||
|
||||
public NotificationSettings notification =>
|
||||
_notification ??= NotificationSettings.Default;
|
||||
|
||||
public GridSettings market_view_grid =>
|
||||
_market_view_grid ??= MarketViewSettings.DefaultGridSettings;
|
||||
|
||||
public GridSettings time_and_sales_grid =>
|
||||
_time_and_sales_grid ??= GridSettings.Default.with(
|
||||
TimeAndSalesSettings.DefaultColumns.all);
|
||||
|
||||
public GridSettings fills_grid =>
|
||||
_fills_grid ??= FillsSettings.DefaultGridSettings;
|
||||
|
||||
public GridSettings synthetic_management_grid =>
|
||||
_synthetic_management ??=
|
||||
SyntheticManagementSettings.default_grid_settings;
|
||||
|
||||
public GridSettings reconcile_report_grid =>
|
||||
_reconcile_report ??= ReconcileReportSettings.Default().grid ??
|
||||
throw new InvalidOperationException();
|
||||
|
||||
public PNLSettings pnl =>
|
||||
_pnl ??= PNLSettings.Default;
|
||||
|
||||
public OrderBookGridSettings order_book_grid =>
|
||||
_order_book ??= OrderBookStartupData.Default.grid_settings_wrapper();
|
||||
|
||||
public GlobalAlertSettings alerts =>
|
||||
_alerts ??= new GlobalAlertSettings();
|
||||
|
||||
public UserSettings with(
|
||||
LadderSettings? ladder = null,
|
||||
LadderSettingsProfile[]? ladder_profiles = null,
|
||||
NotificationSettings? notification = null,
|
||||
GridSettings? market_view = null,
|
||||
GridSettings? time_and_sales = null,
|
||||
GridSettings? fills = null,
|
||||
GridSettings? synthetic_management = null,
|
||||
GridSettings? reconcile_report = null,
|
||||
PNLSettings? pnl = null,
|
||||
OrderBookGridSettings? order_book_grid = null,
|
||||
GlobalAlertSettings? alerts = null) {
|
||||
var us = new UserSettings() {
|
||||
_ladder_profiles = ladder_profiles ?? _ladder_profiles,
|
||||
_ladder = ladder ?? _ladder,
|
||||
_notification = notification ?? _notification,
|
||||
_market_view_grid = market_view ?? _market_view_grid,
|
||||
_time_and_sales_grid = time_and_sales ?? _time_and_sales_grid,
|
||||
_fills_grid = fills ?? _fills_grid,
|
||||
_synthetic_management = synthetic_management ?? _synthetic_management,
|
||||
_reconcile_report = reconcile_report ?? _reconcile_report,
|
||||
_pnl = pnl ?? _pnl,
|
||||
_order_book = order_book_grid ?? _order_book,
|
||||
_alerts = alerts ?? _alerts
|
||||
};
|
||||
us._last_ladder_profile_id = Math.Max(_last_ladder_profile_id, us.ladder_profiles.Select(p => p.id).MaxOrDefault());
|
||||
return us;
|
||||
}
|
||||
|
||||
public static class FileExtensions {
|
||||
public const string
|
||||
GRID = "grid",
|
||||
LADDER = "ladder",
|
||||
PNL = "pnl";
|
||||
}
|
||||
}
|
||||
|
||||
// - currently all notification-triggers are in GridSettings
|
||||
// - the SoundNotificationSettings below are used to disable/enable SoundNotifications
|
||||
// - the ToastNotificationSettings below are used to disable/enable ToastNotifications, and adjust the flash-duration (if enabled).
|
||||
// - since this is a new feature, the ability to quickly enable/disable both types of notifications may save us the trouble of having to redeploy,
|
||||
// in the unfortunate event that a bug slipped through the cracks, or the performance impact is more significant than expected.
|
||||
// TODO: maybe globalize notification settings?
|
||||
[ProtoContract]
|
||||
class NotificationSettings {
|
||||
[ProtoMember(1)]
|
||||
readonly SoundNotificationSettings? _sound_notification;
|
||||
[ProtoMember(2)]
|
||||
readonly ToastNotificationSettings? _toast_notification;
|
||||
|
||||
public NotificationSettings() { }
|
||||
public NotificationSettings(SoundNotificationSettings sound_notification, ToastNotificationSettings toast_notification) {
|
||||
_sound_notification = sound_notification;
|
||||
_toast_notification = toast_notification;
|
||||
}
|
||||
|
||||
public static NotificationSettings Default => new NotificationSettings(SoundNotificationSettings.Default, ToastNotificationSettings.Default);
|
||||
|
||||
public SoundNotificationSettings? sound_notification => _sound_notification;
|
||||
public ToastNotificationSettings? toast_notification => _toast_notification;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
class SoundNotificationSettings {
|
||||
[ProtoMember(1)]
|
||||
readonly bool _enabled;
|
||||
|
||||
public SoundNotificationSettings() { }
|
||||
public SoundNotificationSettings(bool enabled) =>
|
||||
_enabled = enabled;
|
||||
|
||||
public static SoundNotificationSettings Default => new(true);
|
||||
|
||||
public bool enabled => _enabled;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
class ToastNotificationSettings {
|
||||
// though it is possible to infer such Modes from Duration values (null = Disabled, max = ManualClose, otherwise Flash)
|
||||
// this Mode enum makes the behavior very clear, and less likely to be misinterpretted down the road.
|
||||
// (without this enum, the meaning of "duration = null," and "duration = 0 seconds," is debatable)
|
||||
public enum Mode {
|
||||
Disabled,
|
||||
ManualClose,
|
||||
Flash
|
||||
}
|
||||
|
||||
public static ToastNotificationSettings Default =>
|
||||
new(Mode.Flash, new Duration { Seconds = 5 }, 320);
|
||||
|
||||
[ProtoMember(1)]
|
||||
readonly Mode _mode;
|
||||
[ProtoMember(2)]
|
||||
readonly Duration? _duration;
|
||||
[ProtoMember(3)]
|
||||
readonly double _max_height;
|
||||
|
||||
public ToastNotificationSettings() { }
|
||||
|
||||
public ToastNotificationSettings(Mode mode, Duration duration, double max_height) {
|
||||
_mode = mode;
|
||||
_duration = duration;
|
||||
_max_height = max_height;
|
||||
}
|
||||
|
||||
public Mode mode => _mode;
|
||||
public TimeSpan duration =>
|
||||
_mode switch {
|
||||
Mode.Flash => _duration?.ToTimeSpan() ?? TimeSpan.FromSeconds(5),
|
||||
_ => new()
|
||||
};
|
||||
public double max_height => _max_height;
|
||||
}
|
||||
}
|
||||
File renamed without changes.
+177
-177
@@ -1,177 +1,177 @@
|
||||
using bts;
|
||||
using bts.settings;
|
||||
using bts.shell.pnl;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark;
|
||||
using mbts.ui.settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
/// <summary>
|
||||
/// Represents the top level of the persisted settings hierarchy.
|
||||
/// One UserSettings object, which contains the defaults for every SparkWindow, can be read/written on the server by UISettingsHub.
|
||||
/// </summary>
|
||||
[Export(typeof(UserSettingsHub))]
|
||||
class UserSettingsHub {
|
||||
// do NOT CHANGE these consts, they represent a file path on the server
|
||||
const string NAME_SPACE = "settings", DEFAULT_KEY = "default";
|
||||
|
||||
static readonly IImmutableProperty<UserSettings, GridSettings>
|
||||
_fills_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.fills_grid, (us, gs) => us.with(provided_fills_gridsettings: gs)),
|
||||
_mview_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.market_view_grid, (us, gs) => us.with(provided_market_view_gridsettings: gs)),
|
||||
_synth_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.synthetic_management_grid, (us, gs) => us.with(provided_synthetic_management_gridsettings: gs)),
|
||||
_reconcile_report_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.reconcile_report_grid, (us, gs) => us.with(reconcile_report_grid: gs));
|
||||
|
||||
static readonly IImmutableProperty<UserSettings, PNLSettings>
|
||||
_pnl_propi = ImmutableProperty.create<UserSettings, PNLSettings>(us => us.pnl, (us, pnl) => us.with(pnl: pnl));
|
||||
|
||||
readonly object _default_settings_lock = new object();
|
||||
readonly BehaviorSubject<UserSettings> _default_settings_subject = new BehaviorSubject<UserSettings>(UserSettings.factory_defaults);
|
||||
readonly IEnumerable<IFillsGridSettingsMigrationRule> _fills_migration_rules;
|
||||
readonly IEnumerable<IMarketViewGridSettingsMigrationRule> _mview_migration_rules;
|
||||
readonly IEnumerable<IPNLSettingsMigrationRule> _pnl_migration_rules;
|
||||
readonly IEnumerable<ISyntheticManagementMigrationRule> _synth_migration_rules;
|
||||
readonly IEnumerable<IReconcileReportMigrationRule> _reconcile_report_migration_rules;
|
||||
readonly IUserPersist _persist;
|
||||
|
||||
UserSettings _default_settings;
|
||||
|
||||
[ImportingConstructor]
|
||||
public UserSettingsHub(
|
||||
IUserPersist persist,
|
||||
[ImportMany] IEnumerable<IFillsGridSettingsMigrationRule> fills_migration_rules,
|
||||
[ImportMany] IEnumerable<IMarketViewGridSettingsMigrationRule> mview_migration_rules,
|
||||
[ImportMany] IEnumerable<IPAndLGridSettingsMigrationRule> pandl_migration_rules,
|
||||
[ImportMany] IEnumerable<IPNLSettingsMigrationRule> pnl_migration_rules,
|
||||
[ImportMany] IEnumerable<ISyntheticManagementMigrationRule> synth_migration_rules,
|
||||
[ImportMany] IEnumerable<IReconcileReportMigrationRule> reconcile_report_migration_rules) {
|
||||
//
|
||||
_persist = persist;
|
||||
_fills_migration_rules = fills_migration_rules ?? Enumerable.Empty<IFillsGridSettingsMigrationRule>();
|
||||
_mview_migration_rules = mview_migration_rules ?? Enumerable.Empty<IMarketViewGridSettingsMigrationRule>();
|
||||
_pnl_migration_rules = pnl_migration_rules ?? Enumerable.Empty<IPNLSettingsMigrationRule>();
|
||||
_synth_migration_rules = synth_migration_rules ?? Enumerable.Empty<ISyntheticManagementMigrationRule>();
|
||||
_reconcile_report_migration_rules = reconcile_report_migration_rules.empty_if_null();
|
||||
init();
|
||||
async void init() {
|
||||
UserSettings s;
|
||||
try {
|
||||
s = await _persist.get<UserSettings>(NAME_SPACE, DEFAULT_KEY);
|
||||
if (s != null) {
|
||||
var wrapped_rules = new[] {
|
||||
_fills_migration_rules.merge().wrap(_fills_propi),
|
||||
_mview_migration_rules.merge().wrap(_mview_propi),
|
||||
_pnl_migration_rules.merge().wrap(_pnl_propi),
|
||||
_synth_migration_rules.merge().wrap(_synth_propi),
|
||||
_reconcile_report_migration_rules.merge().wrap(_reconcile_report_propi)
|
||||
};
|
||||
SettingsMigrationHelper.apply_quiet(ref s, wrapped_rules);
|
||||
// TODO: move ladder sanitization logic into ISettingsMigrationRule
|
||||
s.ladder.sanitize();
|
||||
// ensure valid named ladder set (w/ distinct, non-zero ids)
|
||||
var ladder_profile_map = new Dictionary<uint, LadderSettingsProfile>();
|
||||
var unidentified_lps = new List<LadderSettingsProfile>();
|
||||
foreach (var lp in s.ladder_profiles) {
|
||||
lp.value.sanitize();
|
||||
if (lp.id == 0) {
|
||||
unidentified_lps.Add(lp);
|
||||
} else ladder_profile_map[lp.id] = lp;
|
||||
}
|
||||
uint id = s.next_ladder_profile_id;
|
||||
foreach (var lp in unidentified_lps) {
|
||||
ladder_profile_map[id] = lp.with(id);
|
||||
id++;
|
||||
}
|
||||
var sorted_lps = ladder_profile_map.Values.ToArray();
|
||||
Array.Sort(sorted_lps, Comparer<uint>.Default.wrap<uint, LadderSettingsProfile>(lp => lp.id));
|
||||
if (!sorted_lps.SequenceEqual(s.ladder_profiles))
|
||||
await _persist.set(NAME_SPACE, DEFAULT_KEY, s = s.with(ladder_profiles: sorted_lps));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.Persist.warn($"Error loading {typeof(UserSettings)} from namespace '{NAME_SPACE}', will restore factory defaults and continue as usual: {ex}");
|
||||
await save_default(s = UserSettings.factory_defaults);
|
||||
}
|
||||
lock (_default_settings_lock) {
|
||||
initialized = true;
|
||||
if (s != null)
|
||||
_default_settings_subject.OnNext(_default_settings = s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// indicates whether or not the settings have been loaded from the server (this happens once, on startup - see the constructor for details)
|
||||
public bool initialized { get; private set; }
|
||||
|
||||
internal UserSettings current {
|
||||
get {
|
||||
lock (_default_settings_lock)
|
||||
return _default_settings ?? UserSettings.factory_defaults;
|
||||
}
|
||||
}
|
||||
|
||||
/// Subscribing via _persist.subscribe may be cleaner in theory, however using a local event allows observers to be notified immediately.
|
||||
/// Assuming there aren't any rogue agents saving UserSettings by themselves, there should never be any discrepancies.
|
||||
public IObservable<UserSettings> subscribe_default_settings() => _default_settings_subject.AsObservable();
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_fills_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_fills_migration_rules,
|
||||
_fills_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_mview_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_mview_migration_rules,
|
||||
_mview_propi);
|
||||
|
||||
public IWindowSettingsManager<PNLSettings> create_pnl_settings_manager(PNLSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_pnl_migration_rules,
|
||||
_pnl_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_synth_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_synth_migration_rules,
|
||||
_synth_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_reconcile_report_settings_manager(
|
||||
GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_reconcile_report_migration_rules,
|
||||
_reconcile_report_propi);
|
||||
|
||||
public async Task save_default(UserSettings value) {
|
||||
// notify observers before persisting so the changes are reflected immediately in the ui
|
||||
lock (_default_settings_lock) {
|
||||
_default_settings_subject.OnNext(_default_settings = value);
|
||||
}
|
||||
await _persist_async();
|
||||
}
|
||||
|
||||
IWindowSettingsManager<T> _create_settings_manager<T>(T instance_settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules, IImmutableProperty<UserSettings, T> propi) where T : class {
|
||||
if (instance_settings != null && migration_rules.merge().apply(instance_settings, out var new_settings))
|
||||
instance_settings = new_settings;
|
||||
return new WindowSettingsManager<T>(this, instance_settings, propi.get, propi.set);
|
||||
}
|
||||
|
||||
async Task _persist_async() {
|
||||
try {
|
||||
await _persist.set(NAME_SPACE, DEFAULT_KEY, _default_settings);
|
||||
} catch (Exception ex) {
|
||||
Log.Persist.warn($"Error persisting {typeof(UserSettings)} in namespace '{NAME_SPACE}': {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts;
|
||||
using bts.settings;
|
||||
using bts.shell.pnl;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark;
|
||||
using mbts.ui.settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
/// <summary>
|
||||
/// Represents the top level of the persisted settings hierarchy.
|
||||
/// One UserSettings object, which contains the defaults for every SparkWindow, can be read/written on the server by UISettingsHub.
|
||||
/// </summary>
|
||||
[Export(typeof(UserSettingsHub))]
|
||||
class UserSettingsHub {
|
||||
// do NOT CHANGE these consts, they represent a file path on the server
|
||||
const string NAME_SPACE = "settings", DEFAULT_KEY = "default";
|
||||
|
||||
static readonly IImmutableProperty<UserSettings, GridSettings>
|
||||
_fills_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.fills_grid, (us, gs) => us.with(fills: gs)),
|
||||
_mview_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.market_view_grid, (us, gs) => us.with(market_view: gs)),
|
||||
_synth_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.synthetic_management_grid, (us, gs) => us.with(synthetic_management: gs)),
|
||||
_reconcile_report_propi = ImmutableProperty.create<UserSettings, GridSettings>(us => us.reconcile_report_grid, (us, gs) => us.with(reconcile_report: gs));
|
||||
|
||||
static readonly IImmutableProperty<UserSettings, PNLSettings>
|
||||
_pnl_propi = ImmutableProperty.create<UserSettings, PNLSettings>(us => us.pnl, (us, pnl) => us.with(pnl: pnl));
|
||||
|
||||
readonly object _default_settings_lock = new object();
|
||||
readonly BehaviorSubject<UserSettings> _default_settings_subject = new BehaviorSubject<UserSettings>(UserSettings.factory_defaults);
|
||||
readonly IEnumerable<IFillsGridSettingsMigrationRule> _fills_migration_rules;
|
||||
readonly IEnumerable<IMarketViewGridSettingsMigrationRule> _mview_migration_rules;
|
||||
readonly IEnumerable<IPNLSettingsMigrationRule> _pnl_migration_rules;
|
||||
readonly IEnumerable<ISyntheticManagementMigrationRule> _synth_migration_rules;
|
||||
readonly IEnumerable<IReconcileReportMigrationRule> _reconcile_report_migration_rules;
|
||||
readonly IUserPersist _persist;
|
||||
|
||||
UserSettings _default_settings;
|
||||
|
||||
[ImportingConstructor]
|
||||
public UserSettingsHub(
|
||||
IUserPersist persist,
|
||||
[ImportMany] IEnumerable<IFillsGridSettingsMigrationRule> fills_migration_rules,
|
||||
[ImportMany] IEnumerable<IMarketViewGridSettingsMigrationRule> mview_migration_rules,
|
||||
[ImportMany] IEnumerable<IPAndLGridSettingsMigrationRule> pandl_migration_rules,
|
||||
[ImportMany] IEnumerable<IPNLSettingsMigrationRule> pnl_migration_rules,
|
||||
[ImportMany] IEnumerable<ISyntheticManagementMigrationRule> synth_migration_rules,
|
||||
[ImportMany] IEnumerable<IReconcileReportMigrationRule> reconcile_report_migration_rules) {
|
||||
//
|
||||
_persist = persist;
|
||||
_fills_migration_rules = fills_migration_rules ?? Enumerable.Empty<IFillsGridSettingsMigrationRule>();
|
||||
_mview_migration_rules = mview_migration_rules ?? Enumerable.Empty<IMarketViewGridSettingsMigrationRule>();
|
||||
_pnl_migration_rules = pnl_migration_rules ?? Enumerable.Empty<IPNLSettingsMigrationRule>();
|
||||
_synth_migration_rules = synth_migration_rules ?? Enumerable.Empty<ISyntheticManagementMigrationRule>();
|
||||
_reconcile_report_migration_rules = reconcile_report_migration_rules.empty_if_null();
|
||||
init();
|
||||
async void init() {
|
||||
UserSettings s;
|
||||
try {
|
||||
s = await _persist.get<UserSettings>(NAME_SPACE, DEFAULT_KEY);
|
||||
if (s != null) {
|
||||
var wrapped_rules = new[] {
|
||||
_fills_migration_rules.merge().wrap(_fills_propi),
|
||||
_mview_migration_rules.merge().wrap(_mview_propi),
|
||||
_pnl_migration_rules.merge().wrap(_pnl_propi),
|
||||
_synth_migration_rules.merge().wrap(_synth_propi),
|
||||
_reconcile_report_migration_rules.merge().wrap(_reconcile_report_propi)
|
||||
};
|
||||
SettingsMigrationHelper.apply_quiet(ref s, wrapped_rules);
|
||||
// TODO: move ladder sanitization logic into ISettingsMigrationRule
|
||||
s.ladder.sanitize();
|
||||
// ensure valid named ladder set (w/ distinct, non-zero ids)
|
||||
var ladder_profile_map = new Dictionary<uint, LadderSettingsProfile>();
|
||||
var unidentified_lps = new List<LadderSettingsProfile>();
|
||||
foreach (var lp in s.ladder_profiles) {
|
||||
lp.value.sanitize();
|
||||
if (lp.id == 0) {
|
||||
unidentified_lps.Add(lp);
|
||||
} else ladder_profile_map[lp.id] = lp;
|
||||
}
|
||||
uint id = s.next_ladder_profile_id;
|
||||
foreach (var lp in unidentified_lps) {
|
||||
ladder_profile_map[id] = lp.with(id);
|
||||
id++;
|
||||
}
|
||||
var sorted_lps = ladder_profile_map.Values.ToArray();
|
||||
Array.Sort(sorted_lps, Comparer<uint>.Default.wrap<uint, LadderSettingsProfile>(lp => lp.id));
|
||||
if (!sorted_lps.SequenceEqual(s.ladder_profiles))
|
||||
await _persist.set(NAME_SPACE, DEFAULT_KEY, s = s.with(ladder_profiles: sorted_lps));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.Persist.warn($"Error loading {typeof(UserSettings)} from namespace '{NAME_SPACE}', will restore factory defaults and continue as usual: {ex}");
|
||||
await save_default(s = UserSettings.factory_defaults);
|
||||
}
|
||||
lock (_default_settings_lock) {
|
||||
initialized = true;
|
||||
if (s != null)
|
||||
_default_settings_subject.OnNext(_default_settings = s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// indicates whether or not the settings have been loaded from the server (this happens once, on startup - see the constructor for details)
|
||||
public bool initialized { get; private set; }
|
||||
|
||||
internal UserSettings current {
|
||||
get {
|
||||
lock (_default_settings_lock)
|
||||
return _default_settings ?? UserSettings.factory_defaults;
|
||||
}
|
||||
}
|
||||
|
||||
/// Subscribing via _persist.subscribe may be cleaner in theory, however using a local event allows observers to be notified immediately.
|
||||
/// Assuming there aren't any rogue agents saving UserSettings by themselves, there should never be any discrepancies.
|
||||
public IObservable<UserSettings> subscribe_default_settings() => _default_settings_subject.AsObservable();
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_fills_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_fills_migration_rules,
|
||||
_fills_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_mview_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_mview_migration_rules,
|
||||
_mview_propi);
|
||||
|
||||
public IWindowSettingsManager<PNLSettings> create_pnl_settings_manager(PNLSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_pnl_migration_rules,
|
||||
_pnl_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_synth_settings_manager(GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_synth_migration_rules,
|
||||
_synth_propi);
|
||||
|
||||
public IWindowSettingsManager<GridSettings> create_reconcile_report_settings_manager(
|
||||
GridSettings instance_settings) =>
|
||||
_create_settings_manager(
|
||||
instance_settings,
|
||||
_reconcile_report_migration_rules,
|
||||
_reconcile_report_propi);
|
||||
|
||||
public async Task save_default(UserSettings value) {
|
||||
// notify observers before persisting so the changes are reflected immediately in the ui
|
||||
lock (_default_settings_lock) {
|
||||
_default_settings_subject.OnNext(_default_settings = value);
|
||||
}
|
||||
await _persist_async();
|
||||
}
|
||||
|
||||
IWindowSettingsManager<T> _create_settings_manager<T>(T instance_settings, IEnumerable<ISettingsMigrationRule<T>> migration_rules, IImmutableProperty<UserSettings, T> propi) where T : class {
|
||||
if (instance_settings != null && migration_rules.merge().apply(instance_settings, out var new_settings))
|
||||
instance_settings = new_settings;
|
||||
return new WindowSettingsManager<T>(this, instance_settings, propi.get, propi.set);
|
||||
}
|
||||
|
||||
async Task _persist_async() {
|
||||
try {
|
||||
await _persist.set(NAME_SPACE, DEFAULT_KEY, _default_settings);
|
||||
} catch (Exception ex) {
|
||||
Log.Persist.warn($"Error persisting {typeof(UserSettings)} in namespace '{NAME_SPACE}': {ex}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+77
-77
@@ -1,77 +1,77 @@
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.shell {
|
||||
public enum DockState {
|
||||
FLOATING = 1,
|
||||
TOP = 2,
|
||||
BOTTOM = 3,
|
||||
LEFT = 4,
|
||||
RIGHT = 5,
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class WindowPosition {
|
||||
[ProtoMember(3)]
|
||||
public int width;
|
||||
[ProtoMember(4)]
|
||||
public int height;
|
||||
[ProtoMember(5)]
|
||||
public int left;
|
||||
[ProtoMember(6)]
|
||||
public int top;
|
||||
[ProtoMember(7)]
|
||||
public bool is_maximized;
|
||||
[ProtoMember(8)]
|
||||
public string host_id;
|
||||
[ProtoMember(9)]
|
||||
public int tab_index;
|
||||
|
||||
[ProtoMember(100), DefaultValue(false)]
|
||||
public bool horizontal = false;
|
||||
[ProtoMember(101), DefaultValue(true)]
|
||||
public bool show_text = true;
|
||||
[ProtoMember(102), DefaultValue(true)]
|
||||
public bool always_on_top = true;
|
||||
//[ProtoMember(103)] //used
|
||||
|
||||
[ProtoMember(104)]
|
||||
public string custom_title;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class WindowState {
|
||||
[ProtoMember(1)]
|
||||
public string owner;
|
||||
[ProtoMember(2)]
|
||||
public byte[] app_data;
|
||||
|
||||
//optional bool is_open = 3 [default = true];
|
||||
//optional bool is_favorite = 4;
|
||||
//optional string title = 5;
|
||||
|
||||
//optional string id = 6;
|
||||
// optional bool is_loaded = 7 [default = false];
|
||||
[ProtoMember(8)]
|
||||
public WindowPosition position;
|
||||
|
||||
[ProtoMember(9)]
|
||||
public string title; // for debugging
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class ModuleState {
|
||||
[ProtoMember(1)]
|
||||
public string name;
|
||||
[ProtoMember(2)]
|
||||
public byte[] app_data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.shell {
|
||||
public enum DockState {
|
||||
FLOATING = 1,
|
||||
TOP = 2,
|
||||
BOTTOM = 3,
|
||||
LEFT = 4,
|
||||
RIGHT = 5,
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class WindowPosition {
|
||||
[ProtoMember(3)]
|
||||
public int width;
|
||||
[ProtoMember(4)]
|
||||
public int height;
|
||||
[ProtoMember(5)]
|
||||
public int left;
|
||||
[ProtoMember(6)]
|
||||
public int top;
|
||||
[ProtoMember(7)]
|
||||
public bool is_maximized;
|
||||
[ProtoMember(8)]
|
||||
public string host_id;
|
||||
[ProtoMember(9)]
|
||||
public int tab_index;
|
||||
|
||||
[ProtoMember(100), DefaultValue(false)]
|
||||
public bool horizontal = false;
|
||||
[ProtoMember(101), DefaultValue(true)]
|
||||
public bool show_text = true;
|
||||
[ProtoMember(102), DefaultValue(true)]
|
||||
public bool always_on_top = true;
|
||||
//[ProtoMember(103)] //used
|
||||
|
||||
[ProtoMember(104)]
|
||||
public string custom_title;
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class WindowState {
|
||||
[ProtoMember(1)]
|
||||
public string owner;
|
||||
[ProtoMember(2)]
|
||||
public byte[] app_data;
|
||||
|
||||
//optional bool is_open = 3 [default = true];
|
||||
//optional bool is_favorite = 4;
|
||||
//optional string title = 5;
|
||||
|
||||
//optional string id = 6;
|
||||
// optional bool is_loaded = 7 [default = false];
|
||||
[ProtoMember(8)]
|
||||
public WindowPosition position;
|
||||
|
||||
[ProtoMember(9)]
|
||||
public string title; // for debugging
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class ModuleState {
|
||||
[ProtoMember(1)]
|
||||
public string name;
|
||||
[ProtoMember(2)]
|
||||
public byte[] app_data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
xmlns:shell="clr-namespace:mbts.ui.shell"
|
||||
x:Name="me"
|
||||
Background="Transparent"
|
||||
Background="{u:BTSColor UI.spark_menu_background}"
|
||||
MinWidth="250"
|
||||
>
|
||||
<UserControl.Resources>
|
||||
@@ -26,8 +26,7 @@
|
||||
Padding="12,6,6,6"
|
||||
Command="{Binding DataContext.launch_cmd, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
||||
CommandParameter="{Binding key}"
|
||||
Style="{StaticResource LargeMenuButton}"
|
||||
>
|
||||
Style="{StaticResource LargeMenuButton}">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="Label"/>
|
||||
@@ -66,8 +65,8 @@
|
||||
Padding="16,6,6,6"
|
||||
IsDefault="True"
|
||||
Command="{Binding create_cmd}"
|
||||
Style="{StaticResource LargeMenuButton}"
|
||||
>
|
||||
Background="Transparent"
|
||||
Style="{StaticResource LargeMenuButton}">
|
||||
<TextBlock FontWeight="Bold" Text="{Binding type_name, StringFormat='New {0}'}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
+36
-8
@@ -25,11 +25,13 @@
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="12,12,10,12"
|
||||
MaxHeight="400"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
ItemsSource="{Binding columns}"
|
||||
SelectionMode="Extended"
|
||||
SelectedItem="{Binding selected_column}">
|
||||
SelectedItem="{Binding selected_column}"
|
||||
Style="{StaticResource ListBox.Dark}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected}" />
|
||||
@@ -90,7 +92,12 @@
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<GroupBox Grid.Column="1" Header="Data Formatting" Margin="0,8,12,12" Padding="6">
|
||||
<GroupBox
|
||||
Grid.Column="1"
|
||||
Header="Data Formatting"
|
||||
Margin="0,8,12,12"
|
||||
Padding="6"
|
||||
Foreground="{u:BTSColor UI.default_text}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -102,13 +109,34 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="label"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="Center">Tick Base</TextBlock>
|
||||
<c:TickUpDownDouble Grid.Column="1" Margin="8,0,0,0" Value="{Binding tick_base}" />
|
||||
<TextBlock Grid.Row="1" Margin="0,5,0,0" VerticalAlignment="Center">Tick Unit</TextBlock>
|
||||
<c:TickUpDownDouble Grid.Row="1" Grid.Column="1" Margin="8,5,0,0" Value="{Binding tick_unit}" />
|
||||
<TextBlock Grid.Row="2" Margin="0,5,0,0" VerticalAlignment="Center">Tick Move</TextBlock>
|
||||
|
||||
<TextBlock VerticalAlignment="Center" Style="{StaticResource TextBlock.Dark}">
|
||||
Tick Base
|
||||
</TextBlock>
|
||||
<c:TickUpDownDouble Grid.Column="1" Margin="8,0,0,0" Value="{Binding tick_base}"/>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="Tick Unit"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TickUpDownDouble Grid.Row="1" Grid.Column="1" Margin="8,5,0,0" Value="{Binding tick_unit}"/>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
Margin="0,5,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="Tick Move"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TickUpDownInt Grid.Row="2" Grid.Column="1" Margin="8,5,0,0" Value="{Binding tick_move}" />
|
||||
<TextBlock Grid.Row="3" Margin="0,5,0,0" VerticalAlignment="Center">Multiplier</TextBlock>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Margin="0,5,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="Multiplier"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TickUpDownDouble Grid.Row="3" Grid.Column="1" AllowNaN="True" NaNText="" Margin="8,5,0,0" Value="{Binding display_multiplier}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:controls="clr-namespace:mbts.ui.controls"
|
||||
xmlns:converters="clr-namespace:mbts.ui.converters">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
@@ -30,11 +31,11 @@
|
||||
<Setter
|
||||
Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<GroupBox
|
||||
Header="Cascade"
|
||||
Padding="4">
|
||||
<GroupBox Padding="4" Foreground="{u:BTSColor UI.default_text}" Header="Cascade">
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -80,7 +81,7 @@
|
||||
TickCommand="{Binding atm_shift}"
|
||||
TickUpCommandParameter="true"
|
||||
TickDownCommandParameter="false" />
|
||||
<GroupBox Header="Fit To Market">
|
||||
<GroupBox Header="Fit To Market" Foreground="{u:BTSColor UI.default_text}">
|
||||
<StackPanel>
|
||||
<ComboBox
|
||||
Margin="5"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
xmlns:shell="clr-namespace:mbts.ui.shell"
|
||||
u:WindowStyle.SizeToContent="WidthAndHeight"
|
||||
u:WindowStyle.AllowResize="True"
|
||||
TextBlock.Foreground="{u:BTSColor UI.default_text}"
|
||||
Title="Vol Surface Settings"
|
||||
Style="{StaticResource BTSDialog}">
|
||||
<Window.Resources>
|
||||
@@ -22,7 +23,18 @@
|
||||
<Setter Property="Margin" Value="16,8" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Style TargetType="GroupBox">
|
||||
<Setter Property="BorderBrush" Value="{u:BTSColor UI.default_text}" />
|
||||
<Setter Property="HeaderTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock Foreground="{u:BTSColor UI.default_text}" Text="{Binding}" />
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type TabItem}" BasedOn="{StaticResource TabItem.Dark}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
||||
@@ -30,12 +42,15 @@
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="Transparent"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock x:Name="label" Text="{TemplateBinding Header}" />
|
||||
<TextBlock
|
||||
x:Name="label"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{TemplateBinding Header}" />
|
||||
<TextBlock
|
||||
x:Name="check"
|
||||
Text="✓"
|
||||
@@ -47,12 +62,10 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="label" Property="Foreground" Value="Black" />
|
||||
<Setter TargetName="check" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="label" Property="FontWeight" Value="Bold" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="False">
|
||||
<Setter TargetName="label" Property="Foreground" Value="Gray" />
|
||||
<Setter TargetName="check" Property="Visibility" Value="Hidden" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
@@ -145,7 +158,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="Number of Put Points" />
|
||||
<TextBlock Text="Number of Put Points" Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -153,7 +166,7 @@
|
||||
Margin="12,0,0,0"
|
||||
Value="{Binding num_put_points}" />
|
||||
|
||||
<TextBlock Grid.Row="1" Text="Number of Call Points" Margin="0,5,0,0" />
|
||||
<TextBlock Grid.Row="1" Text="Number of Call Points" Margin="0,5,0,0" Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -205,7 +218,7 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="c0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Number of Put Points" />
|
||||
<TextBlock Text="Number of Put Points" Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -216,7 +229,8 @@
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Text="Number of Call Points" />
|
||||
Text="Number of Call Points"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
<!--SPACING-->
|
||||
<ColumnDefinition Width="8" />
|
||||
<!--TIME PICKER-->
|
||||
<ColumnDefinition Width="80" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<!--PAD RIGHT-->
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
@@ -91,7 +91,6 @@
|
||||
x:Name="time_picker"
|
||||
Grid.Column="3"
|
||||
Background="White"
|
||||
Width="80"
|
||||
TimeTuple="{Binding new_actual_time}"
|
||||
KeyDown="time_picker_KeyDown">
|
||||
<Validation.ErrorTemplate>
|
||||
|
||||
@@ -143,8 +143,10 @@
|
||||
</Style>
|
||||
|
||||
<Style TargetType="c:VolSurfaceCellView">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor Grid.input_cell_foreground}" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding is_dirty}" Value="{u:True}">
|
||||
<Setter Property="BorderBrush" Value="{u:BTSColor UI.input_dirty_border}" />
|
||||
@@ -211,13 +213,16 @@
|
||||
<Setter Property="HeaderContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="{Binding}" />
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ItemContainerStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="c:ComboCheckBoxItem">
|
||||
<Style TargetType="c:ComboCheckBoxItem" BasedOn="{StaticResource {x:Type c:ComboCheckBoxItem}}">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
</Style>
|
||||
@@ -409,6 +414,22 @@
|
||||
<c:DIYGrid.RowStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource DIYGridRowStyle}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected}" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||
<Setter
|
||||
Property="Background"
|
||||
Value="{u:BTSColor
|
||||
Name='Grid.default_row_background,Grid.default_column_background',
|
||||
MixtureMode=Layered}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||
<Setter
|
||||
Property="Background"
|
||||
Value="{u:BTSColor
|
||||
Name='Grid.alternate_row_background,Grid.default_column_background',
|
||||
MixtureMode=Layered}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</c:DIYGrid.RowStyle>
|
||||
<c:DIYGrid.RowTemplate>
|
||||
@@ -448,7 +469,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TabControl>
|
||||
<TabControl Style="{StaticResource TabControl.Dark}">
|
||||
<TabItem x:Name="vol_curve_tab" Header="Vol Curve" DataContext="{Binding vol_curve_vm}">
|
||||
<Grid x:Name="vol_curve_tab_content">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -514,6 +535,7 @@
|
||||
x:Name="vol_curve_plot_view"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
Model="{Binding graph_vm.plot_model}"
|
||||
MouseDoubleClick="_on_graph_mouse_double_click">
|
||||
<oxy:PlotView.ContextMenu>
|
||||
|
||||
@@ -134,7 +134,14 @@
|
||||
// don't initialize more than once
|
||||
if (_time_editor_popup != null) return;
|
||||
var adorner_layer = AdornerLayer.GetAdornerLayer(adorned_grid);
|
||||
_time_editor_popup = new PopupAdorner(adorned_grid, vol_time_popup_button, _get_time_editor_control(), HorizontalPosition.Left, VerticalPosition.Top, 0.5 * ((ToggleButton)sender).ActualWidth, 0d) { IsHitTestVisible = true };
|
||||
_time_editor_popup = new PopupAdorner(
|
||||
adorned_grid,
|
||||
vol_time_popup_button,
|
||||
_get_time_editor_control(),
|
||||
HorizontalPosition.Left,
|
||||
VerticalPosition.Top,
|
||||
44,
|
||||
0d) { IsHitTestVisible = true };
|
||||
_time_editor_popup.SetBinding(PopupAdorner.DataContextProperty, "globals");
|
||||
_time_editor_popup.SetBinding(PopupAdorner.IsOpenProperty, new Binding("vol_time_popup_open") { Mode = BindingMode.TwoWay });
|
||||
_time_editor_popup.Opened += _time_editor_popup_Opened;
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.shell {
|
||||
|
||||
public interface IBookmarks {
|
||||
void save_bookmark(IShellWindow window);
|
||||
Task save_bookmark(IShellWindow window);
|
||||
void save_bookmark(WindowState window);
|
||||
void remove(WindowState window);
|
||||
void clear();
|
||||
@@ -22,15 +23,16 @@ namespace mbts.ui.shell {
|
||||
public BookmarksModel(ISettingsCollector settings) {
|
||||
_settings_collector = settings;
|
||||
}
|
||||
public void save_bookmark(IShellWindow window) {
|
||||
var state = _settings_collector.get_window_state(window);
|
||||
|
||||
public async Task save_bookmark(IShellWindow window) {
|
||||
var state = await _settings_collector.get_window_state(window);
|
||||
if (state != null) {
|
||||
_bookmarks[state.title] = state;
|
||||
}
|
||||
}
|
||||
public void save_bookmark(WindowState window) {
|
||||
|
||||
public void save_bookmark(WindowState window) =>
|
||||
_bookmarks[window.title] = window;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
_bookmarks.Clear();
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
|
||||
public static GridSettings DefaultGridSettings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria, enable_background_color: true);
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static fills.FillsSettings DefaultAuxiliaryFills {
|
||||
get {
|
||||
@@ -86,7 +86,7 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
}
|
||||
// and enable background color upgrade
|
||||
return s.with(columns, enable_background_color: true);
|
||||
return s.with(columns);
|
||||
}
|
||||
|
||||
static class DefaultColumns {
|
||||
@@ -102,8 +102,21 @@ namespace bts.shell.market_view {
|
||||
public static GridColumnSettings bid_implied_size => _mk(Columns.BidImpliedQty, ColHeader.ImpliedQty, ColWidth.MergedQty, fg: BTSColors.MarketData.bid);
|
||||
public static GridColumnSettings bid_direct_size => _mk(Columns.BidDirectQty, ColHeader.DirectQty, ColWidth.MergedQty, fg: BTSColors.MarketData.bid);
|
||||
public static GridColumnSettings bid_merged_size => _mk(Columns.BidMergedQty, ColHeader.MergedQty, ColWidth.MergedQty, fg: BTSColors.MarketData.bid);
|
||||
public static GridColumnSettings bid => _mk(Columns.Bid, ColHeader.Bid, ColWidth.MViewPrice, fg: BTSColors.header_text, bg: BTSColors.MarketData.bid);
|
||||
public static GridColumnSettings ask => _mk(Columns.Ask, ColHeader.Ask, ColWidth.MViewPrice, fg: BTSColors.header_text, bg: BTSColors.MarketData.ask);
|
||||
|
||||
public static GridColumnSettings bid => _mk(
|
||||
Columns.Bid,
|
||||
ColHeader.Bid,
|
||||
ColWidth.MViewPrice,
|
||||
fg: BTSColors.MarketData.bid,
|
||||
bg: BTSColors.Grid.dark_column_background);
|
||||
|
||||
public static GridColumnSettings ask => _mk(
|
||||
Columns.Ask,
|
||||
ColHeader.Ask,
|
||||
ColWidth.MViewPrice,
|
||||
fg: BTSColors.MarketData.ask,
|
||||
bg: BTSColors.Grid.dark_column_background);
|
||||
|
||||
public static GridColumnSettings ask_merged_size => _mk(Columns.AskMergedQty, ColHeader.MergedQty, ColWidth.MergedQty, fg: BTSColors.MarketData.ask);
|
||||
public static GridColumnSettings ask_direct_size => _mk(Columns.AskDirectQty, ColHeader.DirectQty, ColWidth.MergedQty, fg: BTSColors.MarketData.ask);
|
||||
public static GridColumnSettings ask_implied_size => _mk(Columns.AskImpliedQty, ColHeader.ImpliedQty, ColWidth.MergedQty, fg: BTSColors.MarketData.ask);
|
||||
@@ -137,8 +150,8 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
|
||||
static GridColumnSettings _mk(Columns key, string display_name = null, double width = 80, bool is_visible = true, Color? fg = null, Color? bg = null, HorizontalAlignment h_align = HorizontalAlignment.Right) =>
|
||||
new(col_id(key), display_name, is_visible, font_color_override: fg, width: width, horizontal_alignment: h_align, background_color_override: bg);
|
||||
|
||||
@@ -47,8 +47,8 @@ namespace mbts.spark {
|
||||
/// Viewmodel class designed for <see cref="ui.spark.MarketViewView"/>
|
||||
/// </summary>
|
||||
partial class MarketViewVM : DisposableViewModelBase, IHandleRowSelection {
|
||||
static readonly IReadOnlyList<Func<MarketViewVM, IDataGridColumnFilter<Row>>> _filter_getters =
|
||||
ReflectionHelper.property_delegates_of_type<MarketViewVM, IDataGridColumnFilter<Row>>().ToReadOnlyList();
|
||||
static readonly IEnumerable<Func<MarketViewVM, IDataGridColumnFilter<Row>>> _filter_getters =
|
||||
ReflectionHelper.property_getters<MarketViewVM, IDataGridColumnFilter<Row>>().Cut2();
|
||||
|
||||
static readonly IComparer<SecurityMD> _sec_md_key_comparer = Comparer<uint>.Default.wrap(SecurityMD.key_fn);
|
||||
static readonly IComparer<Row> _row_key_comparer = _sec_md_key_comparer.wrap<SecurityMD, Row>(r => r.security_md);
|
||||
|
||||
@@ -83,18 +83,6 @@ namespace bts.shell {
|
||||
}
|
||||
}
|
||||
|
||||
[Export(typeof(IMarketViewGridSettingsMigrationRule))]
|
||||
class InitBackgroundOverrideMigrationRule : IMarketViewGridSettingsMigrationRule {
|
||||
public bool apply(GridSettings settings, out GridSettings new_settings) {
|
||||
if (!settings.enable_background_color) {
|
||||
new_settings = settings.with(enable_background_color: true);
|
||||
return true;
|
||||
}
|
||||
new_settings = default;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Export(typeof(IMarketViewGridSettingsMigrationRule))]
|
||||
class EnsureSelectionHighlightTranslucency : IMarketViewGridSettingsMigrationRule {
|
||||
public bool apply(GridSettings settings, out GridSettings new_settings) =>
|
||||
|
||||
@@ -132,8 +132,8 @@ namespace bts.shell.time_and_sales {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
|
||||
static GridColumnSettings _mk_col(
|
||||
ColKey key,
|
||||
|
||||
@@ -281,8 +281,8 @@
|
||||
}
|
||||
|
||||
IEnumerable<IDataGridColumnFilter<TimeAndSalesRowVM>> _filters =>
|
||||
ReflectionHelper.property_delegates_of_type<TimeAndSalesVM, IDataGridColumnFilter<TimeAndSalesRowVM>>()
|
||||
.Select(fn => fn(this));
|
||||
ReflectionHelper.property_getters<TimeAndSalesVM, IDataGridColumnFilter<TimeAndSalesRowVM>>()
|
||||
.Select(pg => pg.get(this));
|
||||
|
||||
public (TimeAndSalesFilterSettings filters, IReadOnlyList<SortingCriteria> sorting_criteria, GridSettings grid_settings) create() =>
|
||||
(_get_filter_states(), _sorting_criteria, grid_settings_manager.create());
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace bts.shell {
|
||||
using mbts.spark.filters;
|
||||
using mbts.ui;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
[ProtoContract]
|
||||
class SyntheticManagementFilterSettings {
|
||||
[ProtoMember(1)]
|
||||
public string description;
|
||||
[ProtoMember(2)]
|
||||
public TimeFilterTuple create_time;
|
||||
[ProtoMember(3)]
|
||||
public string name;
|
||||
[ProtoMember(4)]
|
||||
public IntMinMaxState n_legs;
|
||||
[ProtoMember(5)]
|
||||
public UIntMinMaxState n_working_orders;
|
||||
[ProtoMember(6)]
|
||||
public string security_key;
|
||||
[ProtoMember(7)]
|
||||
public uint[] user;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
namespace bts.shell {
|
||||
using mbts.ui;
|
||||
using mbts.ui.settings;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Columns = mbts.ui.spark.SyntheticManagementView.Columns;
|
||||
using ColHeaders = mbts.ui.controls.DIYGrid.DefaultColumnHeaders;
|
||||
using ColWidths = mbts.ui.controls.DIYGrid.DefaultColumnWidths;
|
||||
|
||||
[ProtoContract]
|
||||
class SyntheticManagementSettings {
|
||||
public const int Version = 1;
|
||||
|
||||
[ProtoMember(1)]
|
||||
public readonly List<SortingCriteria> sorting_criteria;
|
||||
[ProtoMember(2)]
|
||||
public readonly SyntheticManagementFilterSettings filters;
|
||||
[ProtoMember(3)]
|
||||
public readonly GridSettings grid;
|
||||
[ProtoMember(4)]
|
||||
public readonly SparkMenuDisplaySettings menu_display;
|
||||
|
||||
public SyntheticManagementSettings()
|
||||
: this(new List<SortingCriteria>(), null, null) { }
|
||||
|
||||
public SyntheticManagementSettings(
|
||||
List<SortingCriteria> sorting_criteria,
|
||||
SyntheticManagementFilterSettings filters,
|
||||
GridSettings grid = default)
|
||||
: this(sorting_criteria, filters, grid, SparkMenuDisplaySettings.Default) { }
|
||||
|
||||
public SyntheticManagementSettings(
|
||||
List<SortingCriteria> sorting_criteria,
|
||||
SyntheticManagementFilterSettings filters,
|
||||
GridSettings grid,
|
||||
SparkMenuDisplaySettings menu_display) {
|
||||
this.sorting_criteria = sorting_criteria;
|
||||
this.filters = filters;
|
||||
this.grid = grid;
|
||||
this.menu_display = menu_display;
|
||||
}
|
||||
|
||||
public SyntheticManagementSettings with(
|
||||
List<SortingCriteria> sorting_criteria = null,
|
||||
SyntheticManagementFilterSettings filters = null,
|
||||
GridSettings grid = null,
|
||||
SparkMenuDisplaySettings? menu_display = null) =>
|
||||
new(
|
||||
sorting_criteria ?? this.sorting_criteria,
|
||||
filters ?? this.filters,
|
||||
grid ?? this.grid,
|
||||
menu_display ?? this.menu_display);
|
||||
|
||||
public static GridSettings default_grid_settings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static string col_id(Columns col) =>
|
||||
col.ToString();
|
||||
|
||||
static class DefaultColumns {
|
||||
public static GridColumnSettings name =>
|
||||
new(col_id(Columns.Name), ColHeaders.Name, width: ColWidths.Security);
|
||||
|
||||
public static GridColumnSettings description =>
|
||||
new(col_id(Columns.Description), ColHeaders.Description, width: ColWidths.Description);
|
||||
|
||||
public static GridColumnSettings n_legs =>
|
||||
new(col_id(Columns.n_legs), ColHeaders.N_Legs, width: ColWidths.N_Legs);
|
||||
|
||||
public static GridColumnSettings n_working_orders => new(
|
||||
col_id(Columns.n_working_orders),
|
||||
ColHeaders.N_Working_Orders,
|
||||
width: ColWidths.N_Working_Orders);
|
||||
|
||||
public static GridColumnSettings security_key => new(
|
||||
col_id(Columns.SecurityKey),
|
||||
ColHeaders.SecurityKey,
|
||||
is_visible: false,
|
||||
width: ColWidths.SecurityKey);
|
||||
|
||||
public static GridColumnSettings user =>
|
||||
new(col_id(Columns.User), ColHeaders.User, is_visible: false, width: ColWidths.User);
|
||||
|
||||
public static IEnumerable<SortingCriteria> default_sorting_criteria {
|
||||
get {
|
||||
yield return new SortingCriteria(name.id, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all {
|
||||
get {
|
||||
yield return name;
|
||||
yield return description;
|
||||
yield return n_legs;
|
||||
yield return n_working_orders;
|
||||
yield return security_key;
|
||||
yield return user;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,13 @@ using System.Windows;
|
||||
using static bts.shell.SyntheticManagementWindowFactory;
|
||||
|
||||
namespace mbts.spark {
|
||||
class SyntheticManagementWindow : SparkWindow<StartupData>, ISharedWindow {
|
||||
class SyntheticManagementWindow : SparkWindow<SyntheticManagementSettings>, ISharedWindow {
|
||||
const string
|
||||
_window_type = "SyntheticManagement",
|
||||
_import_title = "Import Synthetics";
|
||||
static readonly TimeSpan _import_op_sec_map_timeout = TimeSpan.FromSeconds(30);
|
||||
SingleValuePump<SyntheticManagementDialogVM> _vm = new SingleValuePump<SyntheticManagementDialogVM>();
|
||||
StartupData _state;
|
||||
SyntheticManagementSettings _state;
|
||||
OrdersModel _orders_model;
|
||||
SyntheticManagementView _view;
|
||||
SparkMenuDisplayVM _menu_display_vm;
|
||||
@@ -36,7 +36,7 @@ namespace mbts.spark {
|
||||
List<SparkCommand> _commands;
|
||||
readonly IWindowSettingsManager<GridSettings> _settings_manager;
|
||||
|
||||
public SyntheticManagementWindow(SyntheticManagementWindowFactory factory, IBus bus, OrdersModel orders_model, StartupData state, IWindowSettingsManager<GridSettings> settings_manager)
|
||||
public SyntheticManagementWindow(SyntheticManagementWindowFactory factory, IBus bus, OrdersModel orders_model, SyntheticManagementSettings state, IWindowSettingsManager<GridSettings> settings_manager)
|
||||
: base("Synthetic Management", bus, factory, SparkCommands.ShowSyntheticManagement.icon) {
|
||||
_orders_model = orders_model;
|
||||
_state = state;
|
||||
@@ -56,9 +56,9 @@ namespace mbts.spark {
|
||||
public override string window_type => _window_type;
|
||||
public override UIElement Content => _view;
|
||||
public override IEnumerable<SparkCommand> Commands => _commands;
|
||||
public override StartupData SaveState => _state = _vm.value.create().with(menu_display: _menu_display_vm.safe_create());
|
||||
public override SyntheticManagementSettings SaveState => _state = _vm.value.create().with(menu_display: _menu_display_vm.safe_create());
|
||||
public override double MinWidth =>
|
||||
StartupData.DefaultGridSettings.columns.Sum(gcs => gcs.width)
|
||||
SyntheticManagementSettings.default_grid_settings.columns.Sum(gcs => gcs.width)
|
||||
+ SPARK_MENU_COLLAPSED_WIDTH
|
||||
+ LAUNCHER_BUTTON_BORDER_WIDTH
|
||||
+ EXTRA_FOR_NO_HORIZONTAL_SCROLLBAR_WIDTH;
|
||||
@@ -133,7 +133,7 @@ namespace mbts.spark {
|
||||
(SecurityImmutable, ExecutionStrategyImmutable) select_row_strategy_tuple(RowStrategy? rs) => rs.HasValue ? (rs.Value.security, rs.Value.strategy) : default;
|
||||
bool can_execute(RowModificationParams? rmp) => rmp.HasValue && !rmp.Value.has_working_orders;
|
||||
|
||||
_vm.value = new SyntheticManagementDialogVM(_bus, _orders_model, _settings_manager, _state.sorting_criteria, _state.filters ?? new FilterStates());
|
||||
_vm.value = new SyntheticManagementDialogVM(_bus, _orders_model, _settings_manager, _state.sorting_criteria, _state.filters ?? new SyntheticManagementFilterSettings());
|
||||
if (_view == null) _view = new SyntheticManagementView { DataContext = _vm.value };
|
||||
else _view.DataContext = _vm.value;
|
||||
|
||||
|
||||
@@ -3,23 +3,18 @@ using bts.settings;
|
||||
|
||||
using mbts.persist;
|
||||
using mbts.spark;
|
||||
using mbts.spark.filters;
|
||||
using mbts.ui;
|
||||
using mbts.ui.settings;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using static mbts.ui.controls.DIYGrid;
|
||||
using static mbts.ui.spark.SyntheticManagementView;
|
||||
|
||||
namespace bts.shell {
|
||||
class SyntheticManagementWindowFactory : ShellWindowFactory<SyntheticManagementWindowFactory.StartupData> {
|
||||
class SyntheticManagementWindowFactory : ShellWindowFactory<SyntheticManagementSettings> {
|
||||
readonly IBus _bus;
|
||||
readonly OrdersModel _orders_model;
|
||||
readonly UserSettingsHub _settings_hub;
|
||||
@@ -33,100 +28,20 @@ namespace bts.shell {
|
||||
|
||||
public static string col_id(Columns col) => col.ToString();
|
||||
|
||||
public override Task<IShellWindow> load(StartupData state) =>
|
||||
public override Task<IShellWindow> load(SyntheticManagementSettings state) =>
|
||||
Task.FromResult<IShellWindow>(_create(state));
|
||||
|
||||
public async void show(SparkTags.Nothing nothing) =>
|
||||
_bus.post(SparkTags.ShowWindow, await load(new StartupData()));
|
||||
_bus.post(SparkTags.ShowWindow, await load(new SyntheticManagementSettings()));
|
||||
|
||||
IShellWindow _create(StartupData state) =>
|
||||
IShellWindow _create(SyntheticManagementSettings state) =>
|
||||
new SyntheticManagementWindow(this, _bus, _orders_model, state, _settings_hub.create_synth_settings_manager(state.grid));
|
||||
|
||||
[ProtoContract]
|
||||
public class StartupData {
|
||||
public const int Version = 1;
|
||||
|
||||
[ProtoMember(1)]
|
||||
public readonly List<SortingCriteria> sorting_criteria;
|
||||
[ProtoMember(2)]
|
||||
public readonly FilterStates filters;
|
||||
[ProtoMember(3)]
|
||||
public readonly GridSettings grid;
|
||||
[ProtoMember(4)]
|
||||
public readonly SparkMenuDisplaySettings menu_display;
|
||||
|
||||
public StartupData() : this(new List<SortingCriteria>(), null, null) { }
|
||||
|
||||
public StartupData(List<SortingCriteria> sorting_criteria, FilterStates filters, GridSettings grid = default)
|
||||
: this(sorting_criteria, filters, grid, SparkMenuDisplaySettings.Default) { }
|
||||
|
||||
public StartupData(List<SortingCriteria> sorting_criteria, FilterStates filters, GridSettings grid, SparkMenuDisplaySettings menu_display) {
|
||||
this.sorting_criteria = sorting_criteria;
|
||||
this.filters = filters;
|
||||
this.grid = grid;
|
||||
this.menu_display = menu_display;
|
||||
}
|
||||
|
||||
public StartupData with(List<SortingCriteria> sorting_criteria = null, FilterStates filters = null, GridSettings grid = null, SparkMenuDisplaySettings? menu_display = null) =>
|
||||
new StartupData(
|
||||
sorting_criteria ?? this.sorting_criteria,
|
||||
filters ?? this.filters,
|
||||
grid ?? this.grid,
|
||||
menu_display ?? this.menu_display);
|
||||
|
||||
public static GridSettings DefaultGridSettings => GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
static class DefaultColumns {
|
||||
public static GridColumnSettings name => new GridColumnSettings(col_id(Columns.Name), DefaultColumnHeaders.Name, width: DefaultColumnWidths.Security);
|
||||
public static GridColumnSettings description => new GridColumnSettings(col_id(Columns.Description), DefaultColumnHeaders.Description, width: DefaultColumnWidths.Description);
|
||||
public static GridColumnSettings n_legs => new GridColumnSettings(col_id(Columns.n_legs), DefaultColumnHeaders.N_Legs, width: DefaultColumnWidths.N_Legs);
|
||||
public static GridColumnSettings n_working_orders => new GridColumnSettings(col_id(Columns.n_working_orders), DefaultColumnHeaders.N_Working_Orders, width: DefaultColumnWidths.N_Working_Orders);
|
||||
public static GridColumnSettings security_key => new GridColumnSettings(col_id(Columns.SecurityKey), DefaultColumnHeaders.SecurityKey, is_visible: false, width: DefaultColumnWidths.SecurityKey);
|
||||
public static GridColumnSettings user => new GridColumnSettings(col_id(Columns.User), DefaultColumnHeaders.User, is_visible: false, width: DefaultColumnWidths.User);
|
||||
|
||||
public static IEnumerable<SortingCriteria> default_sorting_criteria {
|
||||
get {
|
||||
yield return new SortingCriteria(name.id, true);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all {
|
||||
get {
|
||||
yield return name;
|
||||
yield return description;
|
||||
yield return n_legs;
|
||||
yield return n_working_orders;
|
||||
yield return security_key;
|
||||
yield return user;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
public class FilterStates {
|
||||
[ProtoMember(1)]
|
||||
public string description;
|
||||
[ProtoMember(2)]
|
||||
public TimeFilterTuple create_time;
|
||||
[ProtoMember(3)]
|
||||
public string name;
|
||||
[ProtoMember(4)]
|
||||
public IntMinMaxState n_legs;
|
||||
[ProtoMember(5)]
|
||||
public UIntMinMaxState n_working_orders;
|
||||
[ProtoMember(6)]
|
||||
public string security_key;
|
||||
[ProtoMember(7)]
|
||||
public uint[] user;
|
||||
}
|
||||
|
||||
// migration rules
|
||||
[Export(typeof(ISyntheticManagementMigrationRule))]
|
||||
class AddMissingColumnsMigrationRule : ISyntheticManagementMigrationRule {
|
||||
public bool apply(GridSettings settings, out GridSettings new_settings) =>
|
||||
settings.add_missing_columns(StartupData.DefaultGridSettings.columns, out new_settings);
|
||||
settings.add_missing_columns(SyntheticManagementSettings.default_grid_settings.columns, out new_settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.collections;
|
||||
using bts.shell;
|
||||
using bts.spark;
|
||||
using bts.utils;
|
||||
|
||||
@@ -18,7 +19,6 @@ using System.Reactive.Linq;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
|
||||
using static bts.shell.SyntheticManagementWindowFactory;
|
||||
using static mbts.ui.controls.DIYGrid;
|
||||
using static mbts.ui.spark.SyntheticManagementView;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace mbts.spark {
|
||||
readonly IWindowSettingsManager<GridSettings> _settings_manager;
|
||||
|
||||
public SyntheticManagementDialogVM(IBus bus, OrdersModel orders_model, IWindowSettingsManager<GridSettings> settings_manager) : this(bus, orders_model, settings_manager, null, null) { }
|
||||
public SyntheticManagementDialogVM(IBus bus, OrdersModel orders_model, IWindowSettingsManager<GridSettings> settings_manager, IReadOnlyCollection<SortingCriteria> sorting, FilterStates filters)
|
||||
public SyntheticManagementDialogVM(IBus bus, OrdersModel orders_model, IWindowSettingsManager<GridSettings> settings_manager, IReadOnlyCollection<SortingCriteria> sorting, SyntheticManagementFilterSettings filters)
|
||||
: base(orders_model.spreader.synthetic_tuples.Select(t => t.state.Values), sorting) {
|
||||
_bus = bus;
|
||||
_orders_model = orders_model;
|
||||
@@ -54,7 +54,7 @@ namespace mbts.spark {
|
||||
Columns.n_working_orders,
|
||||
n_working_orders_filter,
|
||||
DataGridFilterKnownTemplates.UIntMinMax) {
|
||||
id = col_id(Columns.n_working_orders),
|
||||
id = SyntheticManagementSettings.col_id(Columns.n_working_orders),
|
||||
CommandBinding = new Binding(nameof(Row.show_order_book)),
|
||||
TextBinding = new Binding(nameof(Row.n_working_orders)),
|
||||
Header = DefaultColumnHeaders.N_Working_Orders,
|
||||
@@ -65,7 +65,7 @@ namespace mbts.spark {
|
||||
//
|
||||
void add_col(Columns col_key, string header, Func<Row, string> get_text, string prop, IDataGridColumnFilter filter, string filter_template, double width) =>
|
||||
columns.Add(new RenderTextColumn<Row, Columns>(col_key, get_text, filter, filter_template) {
|
||||
id = col_id(col_key),
|
||||
id = SyntheticManagementSettings.col_id(col_key),
|
||||
Header = header,
|
||||
sort_member_path = prop,
|
||||
Width = width
|
||||
@@ -96,8 +96,8 @@ namespace mbts.spark {
|
||||
public GridSettings get_grid_save_state() =>
|
||||
_settings_manager.instance_settings == null ? null : grid_settings_manager.create();
|
||||
|
||||
public StartupData create() =>
|
||||
new StartupData(rows_view.get_sorting_criteria(columns), _get_filter_states(), get_grid_save_state());
|
||||
public SyntheticManagementSettings create() =>
|
||||
new SyntheticManagementSettings(rows_view.get_sorting_criteria(columns), _get_filter_states(), get_grid_save_state());
|
||||
|
||||
protected override Row row_factory(SyntheticTuple row_model) =>
|
||||
new Row(_bus, row_model, _orders_model);
|
||||
@@ -105,8 +105,8 @@ namespace mbts.spark {
|
||||
protected override void on_row_removed(Row row) =>
|
||||
row.Dispose();
|
||||
|
||||
FilterStates _get_filter_states() =>
|
||||
new FilterStates {
|
||||
SyntheticManagementFilterSettings _get_filter_states() =>
|
||||
new SyntheticManagementFilterSettings {
|
||||
description = description_filter.get_state(),
|
||||
create_time = create_time_filter.get_state(),
|
||||
name = name_filter.get_state(),
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ namespace mbts.ui.spark {
|
||||
if (pvm is IAlgoParamVM<QuantityMeasureImmutable?>) return QuantityMeasureTemplate;
|
||||
if (pvm is IAlgoParamVM<ExecutionStrategy>) return ExecutionStrategyTemplate;
|
||||
if (pvm is IAlgoParamVM<Google.Protobuf.WellKnownTypes.Timestamp>) return TimestampTemplate;
|
||||
var targ = ReflectionHelper.GetGenericTypeArgs(pvm.GetType(), generic_algo_param_itype).FirstOrDefault();
|
||||
var targ = ReflectionHelper.get_generic_type_args(pvm.GetType(), generic_algo_param_itype).FirstOrDefault();
|
||||
if (targ != null) {
|
||||
if (targ.IsEnum)
|
||||
return EnumTemplate;
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace mbts.spark {
|
||||
using mbts.ui.controls;
|
||||
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
|
||||
using ColKey = ui.spark.FillsView.Columns;
|
||||
|
||||
@@ -42,8 +43,16 @@ namespace mbts.spark {
|
||||
IDataGridColumnPersistentFilter<FillTuple, TColFilter> filter_model,
|
||||
Func<FillsFilterStates, TColFilter> get_col_filter,
|
||||
Action<FillsFilterStates, TColFilter> set_col_filter,
|
||||
string? filter_template = null)
|
||||
: base(key, get_text, filter_model, filter_template) {
|
||||
string? filter_template = null,
|
||||
Func<FillsRowVM, Brush>? get_background = null,
|
||||
Func<FillsRowVM, Brush>? get_foreground = null)
|
||||
: base(
|
||||
key,
|
||||
get_text,
|
||||
filter_model,
|
||||
filter_template,
|
||||
get_background: get_background,
|
||||
get_foreground: get_foreground) {
|
||||
id = key.ToString();
|
||||
_get_col_filter = get_col_filter;
|
||||
_set_col_filter = set_col_filter;
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace mbts.spark {
|
||||
using mbts.ui.controls;
|
||||
using mbts.ui.spark;
|
||||
|
||||
class FillsSideColumn : DIYGrid.SideColumn<FillTuple, FillsView.Columns>, IFillsColumn {
|
||||
class FillsSideColumn : DIYGrid.SideColumn<FillsRowVM, FillsView.Columns>, IFillsColumn {
|
||||
public FillsSideColumn(
|
||||
IDataGridColumnPersistentFilter<FillTuple, Side[]> filter_model)
|
||||
: base(FillsView.Columns.Side, r => r.fill.Side, filter_model) {
|
||||
: base(FillsView.Columns.Side, r => r.side, filter_model) {
|
||||
this.filter_model = filter_model;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,9 @@ namespace mbts.spark {
|
||||
|
||||
public new IDataGridColumnPersistentFilter<FillTuple, Side[]> filter_model { get; }
|
||||
|
||||
IDataGridColumnFilter<FillTuple> IFilterableDIYGridColumn<FillTuple, FillsView.Columns>.filter_model => filter_model;
|
||||
IDataGridColumnFilter IFilterableDIYGridColumn.filter_model => filter_model;
|
||||
IDataGridColumnFilter<FillTuple> IFilterableDIYGridColumn<FillTuple, FillsView.Columns>.filter_model =>
|
||||
filter_model;
|
||||
|
||||
FillsView.Columns IDIYGridColumn<FillsView.Columns>.id => key;
|
||||
|
||||
public FillsFilterStates assign_filter_settings(FillsFilterStates filter_settings) {
|
||||
|
||||
@@ -228,7 +228,8 @@ namespace mbts.spark {
|
||||
DataGridFilterKnownTemplates.UIntMinMax,
|
||||
fs => fs.size,
|
||||
(fs, cf) => fs.size = cf,
|
||||
DefaultColumnWidths.Qty);
|
||||
DefaultColumnWidths.Qty,
|
||||
get_fg: r => r.side == Side.Buy ? BTSColors.MarketData.bid : BTSColors.MarketData.ask);
|
||||
|
||||
add_col(
|
||||
Columns.Price,
|
||||
@@ -238,7 +239,8 @@ namespace mbts.spark {
|
||||
DataGridFilterKnownTemplates.DoubleMinMax,
|
||||
fs => fs.price,
|
||||
(fs, cf) => fs.price = cf,
|
||||
DefaultColumnWidths.Price);
|
||||
DefaultColumnWidths.Price,
|
||||
get_fg: r => r.side == Side.Buy ? BTSColors.MarketData.bid : BTSColors.MarketData.ask);
|
||||
|
||||
add_col(
|
||||
Columns.FillKind,
|
||||
@@ -378,14 +380,18 @@ namespace mbts.spark {
|
||||
string filter_template,
|
||||
Func<FillsFilterStates, TFilter> get_col_filter,
|
||||
Action<FillsFilterStates, TFilter> set_col_filter,
|
||||
double width) =>
|
||||
double width,
|
||||
Func<FillsRowVM, Brush>? get_fg = null,
|
||||
Func<FillsRowVM, Brush>? get_bg = null) =>
|
||||
_columns.Add(new FillsColumn<TFilter>(
|
||||
col_key,
|
||||
r => get_text(r.fill_tuple),
|
||||
filter_model,
|
||||
get_col_filter,
|
||||
set_col_filter,
|
||||
filter_template) {
|
||||
filter_template,
|
||||
get_background: get_bg,
|
||||
get_foreground: get_fg) {
|
||||
Header = header,
|
||||
Width = width
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</c:DIYGrid.RowStyle>
|
||||
<c:DIYGrid.RowTemplate>
|
||||
<DataTemplate>
|
||||
<usp:FillsRowView Background="{Binding side, Converter={StaticResource SideToBrushConverter}}"/>
|
||||
<usp:FillsRowView />
|
||||
</DataTemplate>
|
||||
</c:DIYGrid.RowTemplate>
|
||||
</c:DIYGrid>
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace bts.shell {
|
||||
var settings_manager = new WindowSettingsManager<GridSettings>(_settings_hub,
|
||||
state.grid,
|
||||
get: us => us.fills_grid,
|
||||
set: (us, gs) => us.with(provided_fills_gridsettings: gs));
|
||||
set: (us, gs) => us.with(fills: gs));
|
||||
return new FillsWindow(this, _bus, _orders_model, state, settings_manager);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,24 +40,43 @@ namespace mbts.spark {
|
||||
width = 50,
|
||||
font_family = "Segoe UI",
|
||||
font_size = 10,
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight()
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight(),
|
||||
background = BTSColors.Ladder.default_column_background,
|
||||
};
|
||||
|
||||
public static LadderColumnSettings DefaultOrderColumnSettings => new LadderColumnSettings {
|
||||
show = true,
|
||||
width = 70,
|
||||
font_family = "Segoe UI",
|
||||
font_size = 10,
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight()
|
||||
};
|
||||
public static LadderColumnSettings default_bid =>
|
||||
Default.with(
|
||||
foreground: BTSColors.Ladder.bid_column_foreground,
|
||||
background: BTSColors.Ladder.bid_column_background);
|
||||
|
||||
public static LadderColumnSettings DefaultPiqColumnSettings => new LadderColumnSettings {
|
||||
show = false,
|
||||
width = 50,
|
||||
font_family = "Segoe UI",
|
||||
font_size = 10,
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight()
|
||||
};
|
||||
public static LadderColumnSettings default_orders =>
|
||||
Default.with(
|
||||
width: 70,
|
||||
foreground: BTSColors.Ladder.orders_column_foreground,
|
||||
background: BTSColors.Ladder.orders_column_background);
|
||||
|
||||
public static LadderColumnSettings default_last =>
|
||||
Default.with(
|
||||
foreground: BTSColors.Ladder.last_column_foreground,
|
||||
background: BTSColors.Ladder.last_column_background);
|
||||
|
||||
public static LadderColumnSettings default_volume =>
|
||||
Default.with(
|
||||
foreground: BTSColors.Ladder.volume_column_foreground,
|
||||
background: BTSColors.Ladder.volume_column_background);
|
||||
|
||||
public static LadderColumnSettings default_ask =>
|
||||
Default.with(
|
||||
foreground: BTSColors.Ladder.ask_column_foreground,
|
||||
background: BTSColors.Ladder.ask_column_background);
|
||||
|
||||
public static LadderColumnSettings default_price =>
|
||||
Default.with(
|
||||
foreground: BTSColors.Ladder.price_column_foreground,
|
||||
background: BTSColors.Ladder.price_column_background);
|
||||
|
||||
public static LadderColumnSettings default_piq =>
|
||||
Default.with(show: false);
|
||||
|
||||
[ProtoMember(1)]
|
||||
public bool show { get; set; }
|
||||
@@ -75,6 +94,24 @@ namespace mbts.spark {
|
||||
[ProtoMember(7)]
|
||||
public int font_weight { get; set; }
|
||||
|
||||
public LadderColumnSettings with(
|
||||
bool? show = null,
|
||||
uint? width = null,
|
||||
uint? background = null,
|
||||
uint? foreground = null,
|
||||
string font_family = null,
|
||||
double? font_size = null,
|
||||
int? font_weight = null) =>
|
||||
new() {
|
||||
show = show ?? this.show,
|
||||
width = width ?? this.width,
|
||||
background = background ?? this.background,
|
||||
foreground = foreground ?? this.foreground,
|
||||
font_family = font_family ?? this.font_family,
|
||||
font_size = font_size ?? this.font_size,
|
||||
font_weight = font_weight ?? this.font_weight
|
||||
};
|
||||
|
||||
public bool Equals(LadderColumnSettings other) =>
|
||||
other != null &&
|
||||
other.width == width &&
|
||||
@@ -131,13 +168,13 @@ namespace mbts.spark {
|
||||
get {
|
||||
var gen = LadderColumnSettings.Default;
|
||||
gen.show = false;
|
||||
gen.background = BTSColors.LadderSpecial.default_column_background;
|
||||
gen.background = BTSColors.Ladder.volume_column_background;
|
||||
return new VolumeColumnSettings {
|
||||
general = gen,
|
||||
buy = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.MarketData.bid, false) },
|
||||
sell = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.MarketData.ask, false) },
|
||||
passive = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.LadderSpecial.passive_volume_bar, false) },
|
||||
total = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.LadderSpecial.total_volume_bar), show_numbers = true },
|
||||
passive = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.Ladder.passive_volume_bar, false) },
|
||||
total = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.Ladder.total_volume_bar), show_numbers = true },
|
||||
show_ltq = false
|
||||
};
|
||||
}
|
||||
@@ -418,7 +455,7 @@ namespace mbts.spark {
|
||||
|
||||
static FontParamsProto _default_font =>
|
||||
new FontParamsProto {
|
||||
font_color = Colors.Black.rgb_color(),
|
||||
font_color = BTSColors.UI.default_text,
|
||||
font_size = FontSizes.Regular,
|
||||
typeface = new TypefaceProto(TextUtils.StandardFontFamilyName, FontWeights.Bold.ToOpenTypeWeight())
|
||||
};
|
||||
@@ -554,20 +591,12 @@ namespace mbts.spark {
|
||||
public static LadderSettings historic_default {
|
||||
get {
|
||||
LadderColumnSettings
|
||||
orders_column = LadderColumnSettings.DefaultOrderColumnSettings,
|
||||
bid_column = LadderColumnSettings.Default,
|
||||
ask_column = LadderColumnSettings.Default,
|
||||
price_column = LadderColumnSettings.Default,
|
||||
last_column = LadderColumnSettings.Default,
|
||||
piq_column = LadderColumnSettings.DefaultPiqColumnSettings;
|
||||
orders_column.background = BTSColors.LadderSpecial.default_column_background;
|
||||
bid_column.foreground = 0xFFFFFFFF;
|
||||
bid_column.background = BTSColors.MarketData.bid;
|
||||
ask_column.foreground = 0xFFFFFFFF;
|
||||
ask_column.background = BTSColors.MarketData.ask;
|
||||
price_column.background = BTSColors.LadderSpecial.default_column_background;
|
||||
last_column.background = 0xFFFFFFFF;
|
||||
piq_column.background = BTSColors.LadderSpecial.default_column_background;
|
||||
orders_column = LadderColumnSettings.default_orders,
|
||||
bid_column = LadderColumnSettings.default_bid,
|
||||
ask_column = LadderColumnSettings.default_ask,
|
||||
price_column = LadderColumnSettings.default_price,
|
||||
last_column = LadderColumnSettings.default_last,
|
||||
piq_column = LadderColumnSettings.default_piq;
|
||||
var rv = new LadderSettings {
|
||||
row_height = 22,
|
||||
grid_line_color = 0x535353,
|
||||
@@ -624,24 +653,7 @@ namespace mbts.spark {
|
||||
}
|
||||
}
|
||||
|
||||
public static LadderSettings tt_default {
|
||||
get {
|
||||
var rv = historic_default;
|
||||
rv.orders_column.background = Color.FromRgb(223, 223, 223).rgb_color();
|
||||
// Since the price column sits atop the session range fill in tt
|
||||
// mode (normally it is the other way around), the former is made
|
||||
// partially translucent while the latter is fully opaque (obv the
|
||||
// top layer cannot be opaque, since it would completely hide the
|
||||
// layer beneath it).
|
||||
rv.session_range_fill.color = rv.session_range_fill.color.rgb_color().with(255).rgb_color();
|
||||
rv.price_column.background = Color.FromArgb(226, 166, 166, 166).rgb_color();
|
||||
rv.price_column.foreground = Colors.White.rgb_color();
|
||||
rv.bid_column.background = Color.FromRgb(0, 30, 160).rgb_color();
|
||||
rv.ask_column.background = Color.FromRgb(160, 0, 0).rgb_color();
|
||||
rv.ask_column.foreground = Colors.Black.rgb_color();
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
public static LadderSettings tt_default => historic_default;
|
||||
|
||||
public static LadderSettings Default => mimic_tt ?
|
||||
tt_default : historic_default;
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
#nullable enable
|
||||
namespace mbts.spark {
|
||||
using bts.utils;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
|
||||
[ProtoContract]
|
||||
class LadderSettingsProfile : ISettingsProfile<LadderSettings>, IEquatable<LadderSettingsProfile> {
|
||||
public LadderSettingsProfile() { }
|
||||
|
||||
public LadderSettingsProfile(
|
||||
uint id, string? name, LadderSettings? value, SecurityCriteria? security_criteria = null) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.security_criteria = security_criteria;
|
||||
}
|
||||
|
||||
[ProtoMember(1)]
|
||||
public uint id { get; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public string? name { get; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public LadderSettings? value { get; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public SecurityCriteria? security_criteria { get; }
|
||||
|
||||
public LadderSettingsProfile with(uint? id = null, LadderSettings? value = null) =>
|
||||
new(id ?? this.id, name, value ?? this.value, security_criteria);
|
||||
|
||||
public bool Equals(LadderSettingsProfile? other) =>
|
||||
other != null &&
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
value.safe_equals(other.value) &&
|
||||
security_criteria.safe_equals(other.security_criteria);
|
||||
|
||||
public override bool Equals(object? obj) =>
|
||||
Equals(obj as LadderSettingsProfile);
|
||||
|
||||
public override int GetHashCode() => id.GetHashCode();
|
||||
}
|
||||
}
|
||||
@@ -108,9 +108,9 @@ namespace mbts.spark {
|
||||
// range of colors can still be expressed, as zero is merely one of
|
||||
// 2^24 possible representations of 'transparent.'
|
||||
if (knobs.bid_market_cell_background != 0)
|
||||
_bid_market_cell_background = knobs.bid_market_cell_background.argb_color();
|
||||
_bid_market_cell_background = BTSColors.Ladder.bid_column_background;
|
||||
if (knobs.ask_market_cell_background != 0)
|
||||
_ask_market_cell_background = knobs.ask_market_cell_background.argb_color();
|
||||
_ask_market_cell_background = BTSColors.Ladder.ask_column_background;
|
||||
}
|
||||
|
||||
public LadderGridHost() {
|
||||
|
||||
@@ -223,7 +223,9 @@ namespace mbts.spark {
|
||||
if (market_cell_background.HasValue) {
|
||||
market_cell_background_brush = new SolidColorBrush(market_cell_background.Value);
|
||||
} else if (lighten_market_cells) {
|
||||
market_cell_background_brush = settings.background.rgb_color().blend_with(Colors.White).to_brush();
|
||||
market_cell_background_brush = settings.background.rgb_color()
|
||||
.blend((BTSColor)0x40ffffff)
|
||||
.to_brush();
|
||||
} else {
|
||||
market_cell_background_brush = null;
|
||||
}
|
||||
|
||||
@@ -715,9 +715,9 @@
|
||||
</u:TemplateSelectorKeyValue>
|
||||
</u:KeyedTemplateSelector>
|
||||
</UserControl.Resources>
|
||||
<TabControl>
|
||||
<TabControl Style="{StaticResource TabControl.Dark}">
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}">
|
||||
<Style TargetType="TabItem" BasedOn="{StaticResource TabItem.Dark}">
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Top"/>
|
||||
</Style>
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style x:Key="LadderMenuButton" TargetType="Button">
|
||||
<Style x:Key="LadderMenuButton" TargetType="Button" BasedOn="{StaticResource Button.Dark}">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Margin" Value="2,0,2,5"/>
|
||||
@@ -307,6 +307,7 @@
|
||||
<Style x:Key="LeftPanelPricePointLabel" TargetType="TextBlock">
|
||||
<Setter Property="Margin" Value="0,1,0,4"/>
|
||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||
<Setter Property="Foreground" Value="{mbts:BTSColor UI.default_text}"/>
|
||||
</Style>
|
||||
<Style x:Key="LeftPanelPricePointBorder" TargetType="Border">
|
||||
<Setter Property="Grid.Column" Value="2"/>
|
||||
@@ -679,7 +680,12 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Margin="2" Command="{Binding Path=DataContext.size_calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}" Content="{Binding}" Focusable="False">
|
||||
<Button
|
||||
Margin="2"
|
||||
Command="{Binding Path=DataContext.size_calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
|
||||
Content="{Binding}"
|
||||
Focusable="False"
|
||||
Foreground="{mbts:BTSColor UI.Button.normal_foreground}">
|
||||
<Button.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:DynamicDoubleMultiplierConverter.Instance}">
|
||||
<Binding/>
|
||||
@@ -691,8 +697,13 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<!-- Clear button -->
|
||||
<Button Margin="2" HorizontalAlignment="Stretch" Command="{Binding size_calculator.clear}"
|
||||
Visibility="{Binding show_clear, Converter={StaticResource BooleanToVisibilityConverter}}">Clear</Button>
|
||||
<Button
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding size_calculator.clear}"
|
||||
Visibility="{Binding show_clear, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Content="Clear"
|
||||
Style="{StaticResource CommonButton}" />
|
||||
<!-- Auto Clear button - reset to defaults after order -->
|
||||
<CheckBox Margin="2" IsChecked="{Binding auto_clear}"
|
||||
Visibility="{Binding show_auto_clear, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
@@ -801,7 +812,11 @@
|
||||
HorizontalAlignment="Left" Command="{Binding status_click_cmd}" Visibility="{Binding show_status_message, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Button.Template>
|
||||
<ControlTemplate>
|
||||
<TextBlock Text="{Binding status_message}" Background="{Binding status_background}" Padding="5,0" />
|
||||
<TextBlock
|
||||
Text="{Binding status_message}"
|
||||
Background="{Binding status_background}"
|
||||
Foreground="Black"
|
||||
Padding="5,0" />
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
</Button>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
VerticalAlignment="Stretch"
|
||||
CloseOnCancel="True"
|
||||
CloseOnOK="True"
|
||||
Header="{Binding security}"
|
||||
Header="{Binding security, Converter={StaticResource SelectedSecurityTextConverter}}"
|
||||
IsEditMode="False"
|
||||
IsLazy="True"
|
||||
SecurityMap="{DynamicResource ResourceKey={x:Static u:ResourceKeys.Securities}}"
|
||||
@@ -67,7 +67,13 @@
|
||||
ShowDialogSkirt="True"
|
||||
ToolTip="{Binding SelectedCriteria, RelativeSource={RelativeSource Self}, Converter={x:Static c:ContractPickerPopup.SecurityCriteriaTextConverter}, Mode=OneWay}"
|
||||
OKClick="{x:Static c:ContractPickerPopup.FlushSelectedSecurityHandler}"
|
||||
/>
|
||||
>
|
||||
<c:ContractPickerPopup.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Style="{StaticResource TextBlock.Dark}" />
|
||||
</DataTemplate>
|
||||
</c:ContractPickerPopup.HeaderTemplate>
|
||||
</c:ContractPickerPopup>
|
||||
<ComboBox Grid.Row="2" Grid.Column="2" ItemsSource="{DynamicResource ResourceKey={x:Static u:ResourceKeys.Accounts}}" SelectedItem="{Binding account}"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="4" ItemsSource="{DynamicResource ResourceKey={x:Static u:ResourceKeys.Users}}" SelectedItem="{Binding user}"/>
|
||||
<ComboBox Grid.Row="2" Grid.Column="6" ItemsSource="{DynamicResource ResourceKey={x:Static u:ResourceKeys.Sides}}" SelectedItem="{Binding side}" Width="48"/>
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
xmlns:usp="clr-namespace:mbts.ui.spark"
|
||||
>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary Source="/view/Controls/DataGridEx/DataGridExResources.xaml" />
|
||||
</UserControl.Resources>
|
||||
<AdornerDecorator>
|
||||
<Grid>
|
||||
<DataGrid
|
||||
|
||||
@@ -62,9 +62,9 @@ namespace mbts.ui.spark {
|
||||
data_grid, data_grid,
|
||||
new Border {
|
||||
Child = row_editor,
|
||||
Background = BTSColors.common_background_brush,
|
||||
Background = BTSColors.UI.spark_menu_background.to_brush(),
|
||||
BorderBrush = Brushes.Black,
|
||||
BorderThickness = new Thickness(1),
|
||||
BorderThickness = new Thickness(0),
|
||||
Padding = new Thickness(0, 6, 0, 0),
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
VerticalAlignment = VerticalAlignment.Top
|
||||
|
||||
@@ -588,8 +588,18 @@ namespace mbts.spark {
|
||||
: base(key, header, get_text, width, filter, filter_template, comparer) { }
|
||||
|
||||
public void draw(OrderBookRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(dc, _get_glyph_context(row), font_size, _get_text(row), position, row_height,
|
||||
RenderUtils.get_foreground(row, font_brush), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
CellRender.draw_text(
|
||||
dc,
|
||||
_get_glyph_context(row),
|
||||
font_size,
|
||||
_get_text(row),
|
||||
position,
|
||||
row_height,
|
||||
RenderUtils.get_foreground(row, font_brush),
|
||||
background_brush,
|
||||
horizontal_alignment,
|
||||
VerticalAlignment.Center,
|
||||
DefaultCellPadding);
|
||||
}
|
||||
|
||||
#region Explicit Column Defs
|
||||
@@ -598,8 +608,18 @@ namespace mbts.spark {
|
||||
: base(Columns.Side, "B/S", r => r.side.ToString(), DefaultColumnWidths.Side, filter, DataGridFilterKnownTemplates.EnumValues, _wrap_comparer(r => r.side)) { }
|
||||
|
||||
public void draw(OrderBookRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(dc, _get_glyph_context(row), font_size, row.side.ToString(), position, row_height,
|
||||
RenderUtils.get_side_brush(row), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
CellRender.draw_text(
|
||||
dc,
|
||||
_get_glyph_context(row),
|
||||
font_size,
|
||||
row.side.ToString(),
|
||||
position,
|
||||
row_height,
|
||||
RenderUtils.get_side_brush(row),
|
||||
background_brush,
|
||||
horizontal_alignment,
|
||||
VerticalAlignment.Center,
|
||||
DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class SizeColumn : OrderbookColumnBase<DoubleMinMaxState>, IRenderColumn<OrderBookRowVM> {
|
||||
@@ -607,8 +627,18 @@ namespace mbts.spark {
|
||||
: base(Columns.Size, "Qty", r => r.display_quantity_text, DefaultColumnWidths.Qty, filter, DataGridFilterKnownTemplates.UIntMinMax, _wrap_comparer(r => r.quantity)) { }
|
||||
|
||||
public void draw(OrderBookRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(dc, _get_glyph_context(row), font_size, row.display_quantity_text, position, row_height,
|
||||
RenderUtils.get_side_brush(row), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
CellRender.draw_text(
|
||||
dc,
|
||||
_get_glyph_context(row),
|
||||
font_size,
|
||||
row.display_quantity_text,
|
||||
position,
|
||||
row_height,
|
||||
RenderUtils.get_side_brush(row),
|
||||
background_brush,
|
||||
horizontal_alignment,
|
||||
VerticalAlignment.Center,
|
||||
DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class FilledColumn : OrderbookColumnBase<DoubleMinMaxState>, IRenderColumn<OrderBookRowVM> {
|
||||
@@ -616,8 +646,18 @@ namespace mbts.spark {
|
||||
: base(Columns.Filled, "Filled Qty", r => r.display_filled_quantity.ToString(), DefaultColumnWidths.Qty, filter, DataGridFilterKnownTemplates.DoubleMinMax, _wrap_comparer(r => r.filled_quantity)) { }
|
||||
|
||||
public void draw(OrderBookRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(dc, _get_glyph_context(row), font_size, row.display_filled_quantity_text, position, row_height,
|
||||
RenderUtils.get_side_brush(row), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
CellRender.draw_text(
|
||||
dc,
|
||||
_get_glyph_context(row),
|
||||
font_size,
|
||||
row.display_filled_quantity_text,
|
||||
position,
|
||||
row_height,
|
||||
RenderUtils.get_side_brush(row),
|
||||
background_brush,
|
||||
horizontal_alignment,
|
||||
VerticalAlignment.Center,
|
||||
DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class OrderBookOrderTypeColumn : OrderTypeColumn<Columns>, ICVOrderBookColumn {
|
||||
@@ -683,8 +723,18 @@ namespace mbts.spark {
|
||||
: base(Columns.Piq, "PIQ", r => r.piq_text, DefaultColumnWidths.Qty, filter, DataGridFilterKnownTemplates.UIntMinMax, _wrap_comparer(r => r.piq)) { }
|
||||
|
||||
public void draw(OrderBookRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(dc, _get_glyph_context(row), font_size, row.piq_text, position, row_height,
|
||||
RenderUtils.get_foreground(row, font_brush), null, HorizontalAlignment.Right, VerticalAlignment.Center, DefaultCellPadding);
|
||||
CellRender.draw_text(
|
||||
dc,
|
||||
_get_glyph_context(row),
|
||||
font_size,
|
||||
row.piq_text,
|
||||
position,
|
||||
row_height,
|
||||
RenderUtils.get_foreground(row, font_brush),
|
||||
background_brush,
|
||||
HorizontalAlignment.Right,
|
||||
VerticalAlignment.Center,
|
||||
DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class SecurityColumn : FrameworkElementColumnBase<Columns>, ICVOrderBookColumn, IFilterableColumn {
|
||||
@@ -735,7 +785,10 @@ namespace mbts.spark {
|
||||
grid.Children.Add(toggle_button);
|
||||
grid.Children.Add(security_view);
|
||||
//
|
||||
return new Border { Child = grid, Margin = new Thickness(10, 0, 0, 0) };
|
||||
var root_bd = new Border { Child = grid, Padding = new Thickness(10, 0, 0, 0) };
|
||||
root_bd.SetBinding(
|
||||
Border.BackgroundProperty, new Binding(nameof(background_brush)) { Source = this });
|
||||
return root_bd;
|
||||
}
|
||||
|
||||
protected override void OnSortDirectionChanged(ListSortDirection? new_value) {
|
||||
@@ -762,16 +815,21 @@ namespace mbts.spark {
|
||||
}
|
||||
|
||||
public override FrameworkElement view_factory() {
|
||||
var grid = new Grid() {
|
||||
var cb = new CheckBox {
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
var cb = new CheckBox();
|
||||
cb.Name = "check_col";
|
||||
cb.SetBinding(CheckBox.IsCheckedProperty, _checked_binding);
|
||||
|
||||
grid.Children.Add(cb);
|
||||
return grid;
|
||||
var root_bd = new Border {
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch,
|
||||
Child = cb
|
||||
};
|
||||
root_bd.SetBinding(
|
||||
Border.BackgroundProperty, new Binding(nameof(background_brush)) { Source = this });
|
||||
return root_bd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -820,6 +878,14 @@ namespace mbts.spark {
|
||||
};
|
||||
|
||||
button.SetBinding(Button.CommandProperty, _command_binding);
|
||||
|
||||
var root_bd = new Border {
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch,
|
||||
Child = button
|
||||
};
|
||||
root_bd.SetBinding(
|
||||
Border.BackgroundProperty, new Binding(nameof(background_brush)) { Source = this });
|
||||
return button;
|
||||
}
|
||||
}
|
||||
@@ -922,12 +988,19 @@ namespace mbts.spark {
|
||||
|
||||
#endregion
|
||||
|
||||
var the_whole_thing = new Grid();
|
||||
the_whole_thing.Children.Add(attach_grid);
|
||||
the_whole_thing.Children.Add(detach_grid);
|
||||
the_whole_thing.Children.Add(popup);
|
||||
var grid = new Grid();
|
||||
grid.Children.Add(attach_grid);
|
||||
grid.Children.Add(detach_grid);
|
||||
grid.Children.Add(popup);
|
||||
|
||||
return the_whole_thing;
|
||||
var root_bd = new Border {
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch,
|
||||
Child = grid
|
||||
};
|
||||
root_bd.SetBinding(
|
||||
Border.BackgroundProperty, new Binding(nameof(background_brush)) { Source = this });
|
||||
return root_bd;
|
||||
|
||||
UIElement create_popup_child() {
|
||||
#region OrderParamsPanel
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
<Color x:Key="ControlDarkColor">#FFAAAAAA</Color>
|
||||
<Color x:Key="ControlMouseOverColor">#200080FF</Color>
|
||||
<Color x:Key="ControlPressedColor">#800080FF</Color>
|
||||
<Color x:Key="TabLightColor">#FFE5E5E5</Color>
|
||||
<Color x:Key="TabMediumColor">#FFF0F0F0</Color>
|
||||
|
||||
<!--Border colors-->
|
||||
<Color x:Key="BorderMediumColor">#FF888888</Color>
|
||||
@@ -46,11 +44,7 @@
|
||||
<Color x:Key="TabMouseOverBackgroundLightColor">#FFECF4FC</Color>
|
||||
<Color x:Key="TabMouseOverBackgroundMediumColor">#FFDCECFC</Color>
|
||||
|
||||
<LinearGradientBrush x:Key="MenuPopupBrush" EndPoint="0.5,1" StartPoint="0.5,0">
|
||||
<GradientStop Color="{DynamicResource ControlLightColor}" Offset="0"/>
|
||||
<GradientStop Color="{DynamicResource ControlMediumColor}" Offset="0.5"/>
|
||||
<GradientStop Color="{DynamicResource ControlLightColor}" Offset="1"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="MenuPopupBrush" Color="{DynamicResource ControlMediumColor}" />
|
||||
|
||||
<!--Converters-->
|
||||
<cv:CastConverter x:Key="CastConverter"/>
|
||||
@@ -191,7 +185,7 @@
|
||||
<VisualState Name="StackPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<!--Tab-->
|
||||
@@ -235,7 +229,7 @@
|
||||
<!--CheckMark Opacity-->
|
||||
<DoubleAnimation Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<!--Background Opacity-->
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="0"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0"/>
|
||||
<!--Border Thickness/Opacity/Color-->
|
||||
<ThicknessAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderThickness)" BeginTime="0" Duration="0" To="1,1,1,0"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
@@ -245,9 +239,8 @@
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="TabMouseOverStoryboard">
|
||||
<!--Background Opacity/Color-->
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" BeginTime="0" Duration="0" To="{StaticResource TabMouseOverBackgroundLightColor}"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" BeginTime="0" Duration="0" To="{StaticResource TabMouseOverBackgroundMediumColor}"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="{StaticResource TabMouseOverBackgroundMediumColor}"/>
|
||||
<!--Border Thickness/Opacity/Color-->
|
||||
<ThicknessAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderThickness)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5625"/>
|
||||
@@ -258,7 +251,9 @@
|
||||
|
||||
<Style x:Key="RightPanel.MenuItem" TargetType="MenuItem">
|
||||
<Setter Property="c:MenuItemEx.ClickMode" Value="Press"/>
|
||||
<Setter Property="BorderThickness" Value="1,0"/>
|
||||
<Setter Property="Background" Value="{StaticResource TabItem.Background}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource TabItem.Foreground}" />
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="IsCheckable" Value="True"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
@@ -297,10 +292,7 @@
|
||||
<SolidColorBrush Color="#006CD9" Opacity="0"/>
|
||||
</Border.BorderBrush>
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1" Opacity="0">
|
||||
<GradientStop Color="#400080FF" Offset="0.0"/>
|
||||
<GradientStop Color="#400080FF" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush Color="#400080FF" />
|
||||
</Border.Background>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
@@ -309,46 +301,43 @@
|
||||
<VisualState Name="StackUncheckedMouseOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5625"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState Name="StackUncheckedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState Name="StackCheckedNormal">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState Name="StackCheckedMouseOver">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5625"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState Name="StackCheckedPressed">
|
||||
<Storyboard>
|
||||
<DoubleAnimation Storyboard.TargetName="CheckMark" Storyboard.TargetProperty="(UIElement.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<!--Tab-->
|
||||
<VisualState Name="TabUncheckedNormal">
|
||||
<Storyboard>
|
||||
<!--Background Opacity/Color-->
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" BeginTime="0" Duration="0" To="{StaticResource TabMediumColor}"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" BeginTime="0" Duration="0" To="{StaticResource TabLightColor}"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<ColorAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="{StaticResource TabMediumColor}"/>
|
||||
<!--Border Thickness/Opacity/Color-->
|
||||
<ThicknessAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Border.BorderThickness)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.BorderBrush).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
@@ -373,7 +362,10 @@
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing Brush="Black" Geometry="{Binding Source={StaticResource {x:Static u:Icons.CheckMarkGeometryKey}}}"/>
|
||||
<GeometryDrawing
|
||||
Brush="{StaticResource TextBox.ForegroundBrush}"
|
||||
Geometry="{Binding Source={
|
||||
StaticResource {x:Static u:Icons.CheckMarkGeometryKey}}}" />
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
|
||||
@@ -254,7 +254,11 @@
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
<Grid x:Name="right_panel_content_root" Grid.Column="1" Visibility="Collapsed">
|
||||
<Grid
|
||||
x:Name="right_panel_content_root"
|
||||
Grid.Column="1"
|
||||
Background="{u:BTSColor UI.spark_menu_background}"
|
||||
Visibility="Collapsed">
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager Target="{Binding Source={u:DirectReference right_panel_content_root}}">
|
||||
<u:StateDefinitionCollection>
|
||||
@@ -387,9 +391,7 @@
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
ItemContainerStyle="{StaticResource RightPanel.MenuItem}"
|
||||
BorderBrush="DarkGray"
|
||||
BorderThickness="1"
|
||||
>
|
||||
BorderThickness="0">
|
||||
<ToolBar.Background>
|
||||
<SolidColorBrush Color="LightGray" Opacity="1"/>
|
||||
</ToolBar.Background>
|
||||
@@ -468,16 +470,21 @@
|
||||
<ItemsControl ItemsSource="{Binding DataContext.selected_rows, Source={u:DirectReference right_panel_content_root}}" ItemTemplate="{StaticResource OrderDescriptionTemplate}"/>
|
||||
</StackPanel.ToolTip>
|
||||
<ContentControl x:Name="current_row_description_content_control" Content="{Binding current_row}" ContentTemplate="{StaticResource OrderDescriptionTemplate}" IsTabStop="False" Visibility="Visible"/>
|
||||
<TextBlock x:Name="no_rows_selected_text_block" Visibility="Collapsed">
|
||||
(No orders are selected)
|
||||
</TextBlock>
|
||||
|
||||
<TextBlock
|
||||
x:Name="no_rows_selected_text_block"
|
||||
Visibility="Collapsed"
|
||||
Text="(No orders are selected)"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
|
||||
<TextBlock
|
||||
Margin="3,0,0,0"
|
||||
FontStyle="Italic"
|
||||
Visibility="{Binding selected_rows.Count, Converter={StaticResource SelectedOrdersAndOthersSuffixVisibilityConverter}}"
|
||||
VerticalAlignment="Top"
|
||||
Text="{Binding selected_rows.Count, Converter={StaticResource MinusOneConverter}, Mode=OneWay, StringFormat='and {0} others...'}"
|
||||
/>
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ScrollViewer x:Name="order_params_root" Grid.Column="1" Grid.Row="2" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
|
||||
|
||||
@@ -473,18 +473,6 @@ namespace bts.shell {
|
||||
}
|
||||
}
|
||||
|
||||
[Export(typeof(IPNLSettingsMigrationRule))]
|
||||
class EnableGridBackgroundColorMigrationRule : IPNLSettingsMigrationRule {
|
||||
public bool apply(PNLSettings settings, out PNLSettings new_settings) {
|
||||
if (settings != null && !settings.grid.enable_background_color) {
|
||||
new_settings = settings.with(grid: settings.grid.with(enable_background_color: true));
|
||||
return true;
|
||||
}
|
||||
new_settings = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Export(typeof(IPNLSettingsMigrationRule))]
|
||||
class InitializeDataFormattingMigrationRule : IPNLSettingsMigrationRule {
|
||||
public bool apply(PNLSettings settings, out PNLSettings new_settings) {
|
||||
|
||||
@@ -157,10 +157,7 @@ namespace bts.shell.pnl {
|
||||
};
|
||||
|
||||
public static GridSettings DefaultGridSettings =>
|
||||
GridSettings.Default.with(
|
||||
DefaultColumns.all,
|
||||
DefaultColumns.default_sorting_criteria,
|
||||
enable_background_color: true);
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static fills.FillsSettings DefaultAuxiliaryFills {
|
||||
get {
|
||||
|
||||
@@ -39,8 +39,9 @@
|
||||
using SecurityType = api.Security.ContractOneofCase;
|
||||
|
||||
class PNLVM : DisposableViewModelBase, IHandleRowSelection {
|
||||
static readonly IReadOnlyList<Func<PNLVM, IDataGridColumnFilter<PNLRowData>>> _filter_getters =
|
||||
ReflectionHelper.property_delegates_of_type<PNLVM, IDataGridColumnFilter<PNLRowData>>().ToReadOnlyList();
|
||||
static readonly IEnumerable<Func<PNLVM, IDataGridColumnFilter<PNLRowData>>> _filter_getters =
|
||||
ReflectionHelper.property_getters<PNLVM, IDataGridColumnFilter<PNLRowData>>().Cut2();
|
||||
|
||||
static readonly TimeSpan _auxiliary_grid_update_throttle = TimeSpan.FromSeconds(0.2);
|
||||
// delegates
|
||||
static readonly Func<OrderSecurityRootPair, PNLKey> _order_pnl_key_fn = o => new PNLKey(o.order.order.account_id(), o.order.order.security_key());
|
||||
|
||||
@@ -2,10 +2,13 @@
|
||||
namespace Spark.Trading {
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.domain;
|
||||
using bts.api.orderman;
|
||||
using bts.api.position;
|
||||
using bts.utils;
|
||||
|
||||
using mbts;
|
||||
using mbts.spark;
|
||||
using mbts.utils;
|
||||
|
||||
using Spark.Api.Position;
|
||||
@@ -139,17 +142,26 @@ namespace Spark.Trading {
|
||||
/// positions are undefined (i.e., the quantity is finite positive), then the position is
|
||||
/// considered a proper match, and both the 'price' and 'quantity' flags are returned.
|
||||
/// </summary>
|
||||
public static ReconcileReportMatchType match_type(this ReconcileReportRowData rd) {
|
||||
public static ReconcileReportMatchType match_type(
|
||||
this ReconcileReportRowData rd, TickFactorsImmutable? qty_tick_factors = null) {
|
||||
if (!rd.has_exch_position() && !rd.has_sys_position()) {
|
||||
return ReconcileReportMatchType.Price | ReconcileReportMatchType.Quantity;
|
||||
}
|
||||
|
||||
// allow for rounding errors
|
||||
var mt = ReconcileReportMatchType.None;
|
||||
// allow for rounding error
|
||||
if (rd.sys_quantity().epsilon_equals(rd.exch_quantity())) {
|
||||
|
||||
// qty
|
||||
var qty_comp = qty_tick_factors?.to_tick_factors()?.tick_equality_comparer()
|
||||
?? MathUtils.epsilon_eq_comparer;
|
||||
if (qty_comp.Equals(rd.sys_quantity(), rd.exch_quantity())) {
|
||||
mt |= ReconcileReportMatchType.Quantity;
|
||||
}
|
||||
if (rd.sys_price().epsilon_equals(rd.exch_price())) {
|
||||
|
||||
// price
|
||||
var price_comp = (rd.security?.ContractSpec)?.tick_equality_comparer()
|
||||
?? MathUtils.epsilon_eq_comparer;
|
||||
if (price_comp.Equals(rd.sys_price(), rd.exch_price())) {
|
||||
mt |= ReconcileReportMatchType.Price;
|
||||
}
|
||||
return mt;
|
||||
|
||||
@@ -119,8 +119,8 @@ namespace Spark.Trading {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
|
||||
static GridColumnSettings _mk(
|
||||
ColKey key,
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace mbts.ui {
|
||||
break;
|
||||
case ToastNotificationSettings.Mode.Flash:
|
||||
_toast_notifications_enabled = true;
|
||||
_toast_controller.flash_duration = s.notification.toast_notification.duration ?? _fallback_flash_duration;
|
||||
_toast_controller.flash_duration = s.notification.toast_notification.duration;
|
||||
break;
|
||||
case ToastNotificationSettings.Mode.ManualClose:
|
||||
_toast_notifications_enabled = true;
|
||||
|
||||
@@ -73,7 +73,10 @@
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="{Binding security, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<Run
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding security, Mode=OneWay}" />
|
||||
<Run Foreground="{u:BTSColor MarketData.bid}" FontSize="10" Text="{Binding bid_size, Mode=OneWay, StringFormat='{}({0})'}"/>
|
||||
<Run Foreground="{u:BTSColor MarketData.bid}" FontWeight="Bold">
|
||||
<Run.Text>
|
||||
|
||||
@@ -123,9 +123,9 @@
|
||||
</Grid>
|
||||
<u:WindowStyle.TitleContentTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<TextBlock Style="{StaticResource TextBlock.Dark}">
|
||||
<TextBlock.Inlines>
|
||||
<Run Text="{Binding security, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<Run FontWeight="Bold" Text="{Binding security, Mode=OneWay}" />
|
||||
<Run Foreground="{u:BTSColor MarketData.bid}" FontSize="10">
|
||||
<MultiBinding Converter="{x:Static cv:DynamicDoubleDivisorConverter.Instance}" Mode="OneWay" StringFormat="({0})">
|
||||
<Binding Path="bid_size" Mode="OneWay"/>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<sys:Double x:Key="ParameterVPadding">12</sys:Double>
|
||||
<sys:Double x:Key="ParameterHPadding">12</sys:Double>
|
||||
|
||||
<Style x:Key="ParameterLabel" TargetType="TextBlock">
|
||||
<Style x:Key="ParameterLabel" TargetType="TextBlock" BasedOn="{StaticResource TextBlock.Dark}">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
@@ -90,6 +90,8 @@
|
||||
<TextBox
|
||||
x:Name="PART_Name"
|
||||
Grid.Column="1"
|
||||
Background="{u:BTSColor UI.input_background}"
|
||||
Foreground="{u:BTSColor UI.input_text}"
|
||||
Text="{Binding name}"
|
||||
Style="{StaticResource ParameterValue}">
|
||||
<TextBox.Margin>
|
||||
@@ -132,6 +134,8 @@
|
||||
<ComboBox
|
||||
x:Name="PART_RiskTerms"
|
||||
Grid.Column="1"
|
||||
Background="{u:BTSColor UI.input_background}"
|
||||
Foreground="{u:BTSColor UI.input_text}"
|
||||
ItemsSource="{Binding risk_terms_choices}"
|
||||
SelectedItem="{Binding risk_terms}"
|
||||
ItemTemplate="{StaticResource SecurityTemplate}"
|
||||
@@ -253,7 +257,8 @@
|
||||
<TextBox
|
||||
x:Name="PART_Handles"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
Text="{Binding handles, Converter={x:Static cv:EnumerableDoubleStringConverter.Instance}}" />
|
||||
Text="{Binding handles, Converter={x:Static cv:EnumerableDoubleStringConverter.Instance}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/view/Resources/CursorsEx.xaml"/>
|
||||
<ResourceDictionary Source="/view/Resources/DataTemplates.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DragDropListBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
@@ -26,11 +27,12 @@
|
||||
ItemsSource="{Binding greek_views}"
|
||||
SelectionMode="Extended"
|
||||
SelectedValuePath="value"
|
||||
SelectedValue="{Binding top_selected_greek}">
|
||||
SelectedValue="{Binding top_selected_greek}"
|
||||
>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style
|
||||
TargetType="c:DraggableListBoxItem"
|
||||
BasedOn="{StaticResource {x:Type c:DraggableListBoxItem}}">
|
||||
BasedOn="{StaticResource ListBoxItem.Dark}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
|
||||
@@ -68,7 +68,12 @@
|
||||
<c:HelpButton ToolTip="If unchecked, Price will only be displayed in the "All" section." />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Grid.Row="1" Margin="0,5,0,0" Text="Tick Unit" VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,5,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="Tick Unit" />
|
||||
<c:TickUpDownDouble
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -76,7 +81,12 @@
|
||||
Margin="8,5,0,0"
|
||||
Value="{Binding price_tick_unit}" />
|
||||
|
||||
<TextBlock Grid.Row="2" Text="Tick Base" Margin="0,5,0,0" VerticalAlignment="Center" />
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,5,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="Tick Base" />
|
||||
<c:TickUpDownDouble
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -8,13 +8,11 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.tests {
|
||||
class TestSettingsCollector : ISettingsCollector {
|
||||
public IEnumerable<shell.WindowState> get_window_state() {
|
||||
yield return new shell.WindowState();
|
||||
}
|
||||
public Task<List<shell.WindowState>> get_window_state() =>
|
||||
Task.FromResult(new List<shell.WindowState> { new() });
|
||||
|
||||
public shell.WindowState get_window_state(IShellWindow window) {
|
||||
return new shell.WindowState();
|
||||
}
|
||||
public Task<shell.WindowState> get_window_state(IShellWindow window) =>
|
||||
Task.FromResult(new shell.WindowState());
|
||||
|
||||
public IEnumerable<shell.ModuleState> get_module_state() {
|
||||
yield return new shell.ModuleState();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:mbts="clr-namespace:mbts.ui"
|
||||
xmlns:control="clr-namespace:mbts.ui.controls"
|
||||
xmlns:shell="clr-namespace:mbts.ui.shell"
|
||||
@@ -20,7 +21,6 @@
|
||||
<ResourceDictionary Source="/view/Controls/Buttons/ExpanderToggleButton.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DragDropItemsControl.xaml" />
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DraggableContentControl.xaml" />
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DragDropListBox.xaml" />
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DraggableListBoxItem.xaml" />
|
||||
<ResourceDictionary Source="/view/Controls/DialogSkirts/DialogSkirt.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/DialogSkirts/DialogSkirtOKCancel.xaml" />
|
||||
@@ -69,10 +69,33 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBlock.Dark" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#DDDDDD" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBox.Dark" TargetType="TextBox">
|
||||
<Setter Property="Background" Value="{StaticResource TextBox.BackgroundBrush}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource TextBox.ForegroundBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxItem.Dark" TargetType="ListBoxItem">
|
||||
<Setter Property="Background" Value="{StaticResource ListBoxItem.Background}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBoxItem.Foreground}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBox.Dark" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="{StaticResource ListBox.Background}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItem.Dark}" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ComboBox.Static.Border}"/>
|
||||
<Setter Property="Background" Value="{StaticResource ComboBox.Static.Background}"/>
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter Property="Focusable" Value="false"/>
|
||||
<Setter Property="ClickMode" Value="Press"/>
|
||||
@@ -96,6 +119,7 @@
|
||||
Data="F1 M 0,0 L 2.667,2.66665 L 5.3334,0 L 5.3334,-1.78168 L 2.6667,0.88501 L0,-1.78168 L0,0 Z"/>
|
||||
</Border>
|
||||
</Border>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<MultiDataTrigger>
|
||||
<MultiDataTrigger.Conditions>
|
||||
@@ -189,7 +213,8 @@
|
||||
PopupAnimation="None"
|
||||
>
|
||||
<Border
|
||||
x:Name="dropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
|
||||
x:Name="dropDownBorder"
|
||||
Background="{u:BTSColor UI.ComboBox.dropdown_background}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
|
||||
>
|
||||
@@ -276,8 +301,9 @@
|
||||
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
|
||||
>
|
||||
<Border
|
||||
x:Name="dropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
|
||||
BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
|
||||
x:Name="dropDownBorder"
|
||||
BorderThickness="0"
|
||||
Background="{u:BTSColor UI.ComboBox.dropdown_background}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
|
||||
>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer">
|
||||
@@ -304,12 +330,16 @@
|
||||
Background="{TemplateBinding Background}" Style="{StaticResource ComboBoxToggleButton}"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
/>
|
||||
<Border x:Name="border" Background="{StaticResource TextBox.Static.Background}" Margin="{TemplateBinding BorderThickness}">
|
||||
<Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
|
||||
<TextBox
|
||||
x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}"
|
||||
Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
/>
|
||||
x:Name="PART_EditableTextBox"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Background="Transparent"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Style="{StaticResource ComboBoxEditableTextBox}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -336,12 +366,17 @@
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type ComboBox}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="{StaticResource ComboBox.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{StaticResource ComboBox.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource ComboBox.Static.Foreground}"/>
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Padding" Value="6,3,1,3"/>
|
||||
@@ -349,6 +384,7 @@
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource {x:Type ComboBoxItem}}" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsEditable" Value="true">
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
@@ -358,12 +394,16 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ComboBox.Dark" TargetType="ComboBox" BasedOn="{StaticResource {x:Type ComboBox}}" />
|
||||
|
||||
<Style x:Key="ComboBoxItem.Dark" TargetType="ComboBoxItem" BasedOn="{StaticResource {x:Type ComboBoxItem}}" />
|
||||
|
||||
<Style TargetType="{x:Type CheckBox}">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
|
||||
<Setter Property="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="BorderBrush" Value="#FF707070"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="{StaticResource CheckBox.Static.BackgroundBrush}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource TextBox.ForegroundBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type CheckBox}">
|
||||
@@ -451,6 +491,17 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CheckBox.Dark" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}" />
|
||||
|
||||
<Style TargetType="ListBox">
|
||||
<Setter Property="Background" Value="{StaticResource ListBox.Background}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource ListBox.Foreground}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="SelectableTabsTemplate" TargetType="TabItem">
|
||||
<Border>
|
||||
<Grid>
|
||||
@@ -481,6 +532,42 @@
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="TabItem.Dark" TargetType="TabItem">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
<Setter Property="Padding" Value="3" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter ContentSource="Header" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{u:BTSColor UI.Button.mouseover_background}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{u:BTSColor UI.ListBox.selected_background}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TabControl.Dark" TargetType="TabControl">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource TabItem.Dark}" />
|
||||
</Style>
|
||||
|
||||
<HierarchicalDataTemplate x:Key="ShellLaunchWithDeleteItemTemplate" DataType="control:LaunchItemWithDelete">
|
||||
<Button
|
||||
Height="32" MinWidth="190" Padding="4"
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace mbts.ui.utility {
|
||||
|
||||
public class ObservableAutoWrapper<View, Model> : ObservableCollection<View> {
|
||||
private static Func<Model, View> _get_default_converter() {
|
||||
var constructor = ReflectionHelper.FindApplicableConstructor(typeof(View), typeof(Model));
|
||||
var constructor = ReflectionHelper.get_constructor(typeof(View), typeof(Model));
|
||||
if (constructor == null)
|
||||
throw new InvalidOperationException("[{0}] {1} type does not have a public constructor({0})".fmt(typeof(ObservableAutoWrapper<View, Model>), typeof(View), typeof(Model)));
|
||||
return model => (View)constructor.Invoke(new object[] { model });
|
||||
|
||||
@@ -6,8 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui {
|
||||
class ColorNotFoundException : Exception {
|
||||
public ColorNotFoundException() : base("The color is not defined in BTSColors") { }
|
||||
public ColorNotFoundException(String message) : base(message) { }
|
||||
public ColorNotFoundException(String message, Exception inner) : base(message, inner) { }
|
||||
public ColorNotFoundException(string name = null, Exception inner = null)
|
||||
: base($"The color '{name}' is not defined in BTSColors", inner) { }
|
||||
}
|
||||
}
|
||||
@@ -150,6 +150,9 @@
|
||||
public static implicit operator BTSColor(uint x) =>
|
||||
new(x);
|
||||
|
||||
public static implicit operator OxyPlot.OxyColor(BTSColor x) =>
|
||||
OxyPlot.OxyColor.FromArgb(x.a, x.r, x.g, x.b);
|
||||
|
||||
public BTSColor clone() =>
|
||||
new(a, r, g, b);
|
||||
|
||||
|
||||
@@ -1,118 +1,105 @@
|
||||
using bts;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Media;
|
||||
|
||||
#nullable enable
|
||||
namespace mbts.ui {
|
||||
[MarkupExtensionReturnType(typeof(object))]
|
||||
public class BTSColorExtension : MarkupExtension {
|
||||
using Spark.Core.Reflection;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Windows.Media;
|
||||
|
||||
[MarkupExtensionReturnType]
|
||||
class BTSColorExtension : MarkupExtension {
|
||||
static readonly Dictionary<string, Func<BTSColor>>
|
||||
_color_map = _normalized_color_props(typeof(BTSColors), null).ToDictionary();
|
||||
|
||||
public BTSColorExtension() { }
|
||||
|
||||
public BTSColorExtension(string name) {
|
||||
public BTSColorExtension(string? name) =>
|
||||
Name = name;
|
||||
|
||||
public BTSColorExtension(string? name, string? mixture) {
|
||||
Name = name;
|
||||
Mixture = mixture;
|
||||
}
|
||||
|
||||
// The color_dictionary needs to be populated once
|
||||
static BTSColorExtension() {
|
||||
// get all the colors in the nested types
|
||||
foreach (Type t in typeof(BTSColors).GetNestedTypes(BindingFlags.Public | BindingFlags.Static)) {
|
||||
foreach (PropertyInfo p in t.GetProperties(BindingFlags.Public | BindingFlags.Static)) {
|
||||
if (p.PropertyType == typeof(BTSColor))
|
||||
color_dictionary.Add("{0}.{1}".fmt(t.Name, p.Name), (BTSColor)p.GetValue(null));
|
||||
else if (p.PropertyType == typeof(Color))
|
||||
color_dictionary.Add("{0}.{1}".fmt(t.Name, p.Name), (Color)p.GetValue(null));
|
||||
}
|
||||
|
||||
// get the colors defined in types nested within nested types
|
||||
foreach (Type st in t.GetNestedTypes(BindingFlags.Public | BindingFlags.Static)) {
|
||||
foreach (PropertyInfo np in st.GetProperties(BindingFlags.Public | BindingFlags.Static)) {
|
||||
if (np.PropertyType == typeof(BTSColor))
|
||||
color_dictionary.Add("{0}.{1}.{2}".fmt(t.Name, st.Name, np.Name), (BTSColor)np.GetValue(null));
|
||||
}
|
||||
}
|
||||
}
|
||||
// get the colors defined in the base class
|
||||
foreach (PropertyInfo p in typeof(BTSColors).GetProperties(BindingFlags.Public | BindingFlags.Static)) {
|
||||
if (p.PropertyType == typeof(BTSColor))
|
||||
color_dictionary.Add(p.Name, (BTSColor)p.GetValue(null));
|
||||
else if (p.PropertyType == typeof(Color))
|
||||
color_dictionary.Add(p.Name, (Color)p.GetValue(null));
|
||||
}
|
||||
}
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider) {
|
||||
if (serviceProvider == null) { return null; }
|
||||
|
||||
// get the target of the extension from the IServiceProvider interface
|
||||
IProvideValueTarget _ipvt = (IProvideValueTarget)serviceProvider.GetService(typeof(IProvideValueTarget));
|
||||
|
||||
// Get the Name of the attribute
|
||||
String property_name = "";
|
||||
|
||||
Type property_type = null;
|
||||
|
||||
//if property is not part of the VisualTree (Style defined in Resources, or ControlTemplate Triggers etc.)
|
||||
if (_ipvt.TargetProperty == null)
|
||||
property_type = typeof(Color);
|
||||
|
||||
else if (_ipvt.TargetProperty is DependencyProperty) {
|
||||
DependencyProperty target_property = _ipvt.TargetProperty as DependencyProperty;
|
||||
property_name = target_property.Name;
|
||||
property_type = target_property.PropertyType;
|
||||
} else { // else it must be PropertyInfo
|
||||
PropertyInfo target_property = _ipvt.TargetProperty as PropertyInfo;
|
||||
property_name = target_property.Name;
|
||||
}
|
||||
|
||||
|
||||
// if the color name exists in the dictionary then return the color/brush
|
||||
BTSColor out_color = null;
|
||||
|
||||
if (color_dictionary.TryGetValue(Name, out out_color)) {
|
||||
if (Lighten != 0) {
|
||||
out_color = out_color.lighten(Lighten);
|
||||
}
|
||||
|
||||
if (Darken != 0) {
|
||||
out_color = out_color.darken(Darken);
|
||||
}
|
||||
|
||||
if (Alpha != 0) {
|
||||
out_color = new BTSColor((Byte)Alpha, out_color.r, out_color.g, out_color.b);
|
||||
}
|
||||
|
||||
// if the property type is a Color then return a Color
|
||||
// else return a brush
|
||||
if (property_type != null && property_type == typeof(Color)) {
|
||||
return (Color)out_color;
|
||||
} else {
|
||||
return (Brush)out_color;
|
||||
}
|
||||
} else { // if the color is not in the dictionary then throw an exception
|
||||
Log.assert_d(false, "The color '{0}' could not be found".fmt(Name));
|
||||
throw new ColorNotFoundException();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Create dictionary of colors
|
||||
public static readonly Dictionary<String, BTSColor> color_dictionary = new Dictionary<string, BTSColor>();
|
||||
|
||||
[ConstructorArgument("name")]
|
||||
public string Name { get; set; }
|
||||
public string? Name { get; set; }
|
||||
|
||||
public int Lighten { get; set; }
|
||||
public int Darken { get; set; }
|
||||
public int Alpha { get; set; }
|
||||
[ConstructorArgument("mixture")]
|
||||
public string? Mixture { get; set; }
|
||||
|
||||
public ColorMixtureMode MixtureMode { get; set; } = ColorMixtureMode.Default;
|
||||
|
||||
public Type? Type { get; set; }
|
||||
|
||||
public override object? ProvideValue(IServiceProvider service_provider) {
|
||||
if (service_provider is null) {
|
||||
return null;
|
||||
}
|
||||
if (Name is null) {
|
||||
throw new InvalidOperationException("Name is null");
|
||||
}
|
||||
|
||||
var pvt = service_provider.GetValueTargetProvider() ??
|
||||
throw new InvalidOperationException("IProvideValueTarget is null");
|
||||
var tgt_type = Type ?? _deduce_target_type(pvt);
|
||||
var names = Name.Split(',');
|
||||
var mixtures = Mixture?.Split(',');
|
||||
var color = _get_color_blend(names, mixtures, MixtureMode);
|
||||
return tgt_type == typeof(Color) ? (Color)color : (Brush)color;
|
||||
}
|
||||
|
||||
static Type _deduce_target_type(IProvideValueTarget pvt) {
|
||||
if (pvt.TargetProperty is null) {
|
||||
return typeof(Color);
|
||||
}
|
||||
if (pvt.TargetProperty is DependencyProperty dp) {
|
||||
return dp.PropertyType ?? throw new InvalidOperationException();
|
||||
}
|
||||
if (pvt.TargetObject is Setter setter) {
|
||||
return setter.Property?.PropertyType ?? typeof(Brush);
|
||||
}
|
||||
return typeof(Brush);
|
||||
}
|
||||
|
||||
static BTSColor _get_color(string name) =>
|
||||
_color_map.TryGetValue(name, out var color) ?
|
||||
color() : throw new ColorNotFoundException(name);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a (potentially weighted) blend of colors
|
||||
/// </summary>
|
||||
static BTSColor _get_color_blend(string[] names, string[]? mixture, ColorMixtureMode mode) {
|
||||
if (mixture is null || mixture.Length == 0) {
|
||||
// create a uniform blend
|
||||
return names.Select(_get_color).blend(mode);
|
||||
}
|
||||
if (names.Length != mixture.Length) {
|
||||
throw new InvalidOperationException(
|
||||
"Names and Mixture must provide same number of elements");
|
||||
}
|
||||
return names.Select(_get_color).Zip(mixture.Select(double.Parse)).blend();
|
||||
}
|
||||
|
||||
static IEnumerable<(string, Func<BTSColor>)> _normalized_color_props(
|
||||
Type type, string? prefix) {
|
||||
var bts_colors = ReflectionHelper.static_property_getters<BTSColor>(type)
|
||||
.Select(tup => (full_name(tup.name), tup.get));
|
||||
var media_colors = ReflectionHelper.static_property_getters<Color>(type)
|
||||
.Select(tup => (full_name(tup.name), new Func<BTSColor>(() => tup.get())));
|
||||
var nested_types = type.GetNestedTypes(BindingFlags.Public | BindingFlags.Static);
|
||||
var nested_colors = nested_types.SelectMany(
|
||||
t => _normalized_color_props(t, full_name(t.Name))).ToList();
|
||||
|
||||
return bts_colors
|
||||
.Concat(media_colors)
|
||||
.Concat(nested_colors);
|
||||
|
||||
string full_name(string prop) =>
|
||||
prefix is null ? prop : $"{prefix}.{prop}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,80 @@
|
||||
|
||||
namespace mbts.ui {
|
||||
using bts;
|
||||
using bts.utils;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
|
||||
enum ColorMixtureMode {
|
||||
Alpha,
|
||||
Layered,
|
||||
Default
|
||||
}
|
||||
|
||||
static class BTSColorExtensions {
|
||||
public static System.Windows.Media.SolidColorBrush to_brush(this BTSColor color) =>
|
||||
new(color);
|
||||
public static BTSColor blend(
|
||||
this IEnumerable<BTSColor> recipe, ColorMixtureMode mode = ColorMixtureMode.Alpha) {
|
||||
return mode switch {
|
||||
ColorMixtureMode.Alpha or ColorMixtureMode.Default => recipe
|
||||
.Select(c => (c.with(byte.MaxValue), (double)c.a))
|
||||
.blend()
|
||||
.with(recipe.Max(c => c.a, (byte)0)),
|
||||
ColorMixtureMode.Layered => layered_impl(),
|
||||
_ => throw new ArgumentException($"Invalid ColorMixtureMode '{mode}'", nameof(mode))
|
||||
};
|
||||
|
||||
BTSColor layered_impl() {
|
||||
var recipe_list = recipe.AsOrToList();
|
||||
var mixture = new (BTSColor color, double weight)[recipe_list.Count];
|
||||
double rem_weight = byte.MaxValue;
|
||||
// Set the result color alpha to the max alpha in the layers
|
||||
var norm_alpha = recipe.Aggregate(
|
||||
(byte)0, (a, c) => (byte)(a + c.a * ((byte.MaxValue - a) / (double)byte.MaxValue)));
|
||||
// Each layer's weight is multiplied by (1 - sum of above layers' weight pcts).
|
||||
// With this behavior, an opaque layer completely masks the layers beneath it.
|
||||
for (int i = recipe_list.Count - 1; i >= 0 && rem_weight > 0; i--) {
|
||||
var layer_color = recipe_list[i];
|
||||
var layer_weight = layer_color.a * (rem_weight / byte.MaxValue);
|
||||
rem_weight -= layer_weight;
|
||||
mixture[i] = (layer_color.with(norm_alpha), layer_weight);
|
||||
}
|
||||
return mixture.Where(c => (c.color?.a ?? 0) != 0).blend();
|
||||
}
|
||||
}
|
||||
|
||||
public static BTSColor blend(this IEnumerable<(BTSColor color, double weight)> recipe) {
|
||||
var recipe_list = recipe.AsOrToList();
|
||||
if (recipe_list.Any(tup => !tup.weight.is_real_non_negative())) {
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
if (recipe_list.Count == 0 || recipe_list.All(tup => tup.weight == 0)) {
|
||||
return Colors.Transparent;
|
||||
}
|
||||
var r = recipe_list.weighted_average(c => c.color.r, c => c.weight);
|
||||
var g = recipe_list.weighted_average(c => c.color.g, c => c.weight);
|
||||
var b = recipe_list.weighted_average(c => c.color.b, c => c.weight);
|
||||
Log.assert(!r.is_nan() && !g.is_nan() && !b.is_nan());
|
||||
var a = recipe_list.Max(c => c.color.a, (byte)0);
|
||||
return new(a, (byte)r, (byte)g, (byte)b);
|
||||
}
|
||||
|
||||
public static System.Windows.Media.SolidColorBrush to_brush(
|
||||
this BTSColor color) {
|
||||
var brush = new System.Windows.Media.SolidColorBrush(color);
|
||||
return brush;
|
||||
}
|
||||
|
||||
public static System.Windows.Media.SolidColorBrush to_brush(
|
||||
this BTSColor color, bool freeze) {
|
||||
var brush = new System.Windows.Media.SolidColorBrush(color);
|
||||
if (freeze) {
|
||||
brush.Freeze();
|
||||
}
|
||||
return brush;
|
||||
}
|
||||
|
||||
public static System.Windows.Media.Color to_media_color(this BTSColor color) =>
|
||||
System.Windows.Media.Color.FromArgb(color.a, color.r, color.g, color.b);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace mbts.ui {
|
||||
}
|
||||
|
||||
[DisplayInfo(name = "Default Header")]
|
||||
public static BTSColor header { get { return BTSCoreColors.base_blue; } }
|
||||
public static BTSColor header => 0xff17223b;
|
||||
public static Color header_color => header;
|
||||
public static Brush header_brush { get { return _header_brush; } }
|
||||
public static BTSColor header_text { get { return BTSCoreColors.white; } }
|
||||
@@ -79,8 +79,8 @@ namespace mbts.ui {
|
||||
static MarketData() {
|
||||
// null BTSColors are implicitly gray media colors/brushes (this behavior is problematic and should be changed),
|
||||
// therefore need to ensure that _bid/_ask are not null before instantiating bid_brush/ask_brush
|
||||
bid = new BTSColor(0x16, 0x7e, 0xd3);
|
||||
ask = BTSCoreColors.red_darker;
|
||||
bid = 0xff76b7fa;
|
||||
ask = 0xffff6666;
|
||||
_bid_brush = bid;
|
||||
_ask_brush = ask;
|
||||
}
|
||||
@@ -94,9 +94,9 @@ namespace mbts.ui {
|
||||
public static BTSColor bid_text { get { return BTSCoreColors.blue; } }
|
||||
//Another bid color option: 40,70,200
|
||||
public static BTSColor bid { get; }
|
||||
public static BTSColor bid_alt { get { return BTSCoreColors.blue_light; } }
|
||||
public static BTSColor bid_alt => BTSCoreColors.blue_light.with(0x70);
|
||||
public static BTSColor ask { get; }
|
||||
public static BTSColor ask_alt { get { return new BTSColor(255, 180, 180); } }
|
||||
public static BTSColor ask_alt => 0x70ffb4b4;
|
||||
public static BTSColor last { get { return BTSCoreColors.black; } }
|
||||
public static BTSColor bid_ask_alt_blend => BTSCoreColors.purple_light;
|
||||
|
||||
@@ -326,7 +326,7 @@ namespace mbts.ui {
|
||||
public static BTSColor grid_line_lightest { get { return BTSCoreColors.gray_lightest; } }
|
||||
public static BTSColor grid_line_lightest_light { get { return BTSCoreColors.gray_lightest_light; } }
|
||||
public static BTSColor grid_selection_background_overlay { get { return BTSCoreColors.gray; } }
|
||||
public static BTSColor grid_selection_background { get { return BTSCoreColors.gray_lighter; } }
|
||||
public static BTSColor grid_selection_background => Colors.DarkSlateBlue.with(0x63);
|
||||
public static BTSColor grid_selection_border { get { return BTSCoreColors.blue_bright; } }
|
||||
|
||||
public static BTSColor grid_vertical_group_separator { get { return grid_line_dark; } }
|
||||
@@ -334,12 +334,16 @@ namespace mbts.ui {
|
||||
public static BTSColor expiration_seperator { get { return grid_line_dark; } }
|
||||
|
||||
[DisplayInfo(name = "Grid Default Background")]
|
||||
public static BTSColor default_column_background { get { return BTSCoreColors.blue_light; } }
|
||||
public static BTSColor light_column_background { get { return BTSCoreColors.white; } }
|
||||
public static BTSColor default_row_background => BTSCoreColors.white;
|
||||
public static BTSColor default_column_background => 0xc2141420;
|
||||
public static BTSColor default_column_foreground => UI.default_text;
|
||||
public static BTSColor dark_column_background => 0xd2000007;
|
||||
public static BTSColor light_column_background => 0xc280808a;
|
||||
|
||||
// input grid
|
||||
public static BTSColor input_grid_line { get { return BTSCoreColors.black; } }
|
||||
public static BTSColor input_cell_background { get { return BTSCoreColors.white; } }
|
||||
public static BTSColor input_cell_background => default_column_background;
|
||||
public static BTSColor input_cell_foreground => default_column_foreground;
|
||||
public static BTSColor input_grid_line_focused { get { return BTSCoreColors.blue_bright; } }
|
||||
public static BTSColor input_cell_background_focused { get { return BTSCoreColors.gray_lightest_light; } }
|
||||
public static BTSColor wacky_strike_atm_color { get { return new BTSColor(0x82, 0x93, 0xaf); } }
|
||||
@@ -349,28 +353,37 @@ namespace mbts.ui {
|
||||
}
|
||||
|
||||
public static class Graph {
|
||||
public static BTSColor grid_line { get { return new BTSColor(64, 0, 0, 0); } }
|
||||
public static BTSColor default_foreground => UI.default_text;
|
||||
public static BTSColor default_border => default_foreground.with(0x68);
|
||||
public static BTSColor grid_line => default_foreground.with(0x68);
|
||||
public static BTSColor tick_line => default_foreground.with(0x68);
|
||||
public static BTSColor axis_line => default_foreground.with(0x68);
|
||||
}
|
||||
|
||||
public static class UI {
|
||||
[DisplayInfo(name = "Shell Background")]
|
||||
public static BTSColor default_background { get { return new BTSColor(0xf6, 0xf6, 0xf6); } }
|
||||
// public static BTSColor default_background => 0xff242424;
|
||||
public static BTSColor default_background => 0xff242431;
|
||||
[DisplayInfo(name = "Shell Text")]
|
||||
public static BTSColor default_text { get { return new BTSColor(0x22); } }
|
||||
public static BTSColor default_text => default_foreground;
|
||||
public static BTSColor default_foreground => 0xffdddded;
|
||||
public static BTSColor default_foreground_dark => 0xffa4a4a4;
|
||||
public static BTSColor icon_foreground => 0xffa4a4a4;
|
||||
public static BTSColor alternate_text { get { return BTSCoreColors.white; } }
|
||||
|
||||
public static BTSColor menu_expander_mouseover { get { return BTSCoreColors.blue_bright; } }
|
||||
public static BTSColor spark_menu_background { get { return new BTSColor(0xe9); } }
|
||||
public static BTSColor spark_menu_background => 0xff363636;
|
||||
public static BTSColor spark_menu_foreground => 0xffc6c6c6;
|
||||
public static Color spark_menu_background_color => spark_menu_background;
|
||||
public static Brush spark_menu_background_brush => spark_menu_background;
|
||||
|
||||
public static BTSColor input_background { get { return new BTSColor(0xff); } }
|
||||
public static BTSColor input_background => 0xff404040;
|
||||
public static BTSColor input_text { get { return default_text; } }
|
||||
public static BTSColor input_border { get { return new BTSColor(0xAB, 0xAD, 0xB3); } }
|
||||
public static BTSColor input_mouseover_border { get { return new BTSColor(0x7E, 0xB4, 0xEA); } }
|
||||
public static BTSColor input_mouseover_background { get { return new BTSColor(0xAB, 0xAD, 0xB3); } }
|
||||
public static BTSColor input_selected_border { get { return new BTSColor(0x7E, 0xB4, 0xEA); } }
|
||||
public static BTSColor input_selected_background { get { return new BTSColor(0xAB, 0xAD, 0xB3); } }
|
||||
public static BTSColor input_mouseover_background => 0x50ffffff;
|
||||
public static BTSColor input_selected_border => 0x803506f;
|
||||
public static BTSColor input_selected_background => 0x8003506f;
|
||||
public static BTSColor text_prompt_foreground_color => 0x99999999;
|
||||
|
||||
public static BTSColor input_disabled_text => new BTSColor(0x87);
|
||||
@@ -382,16 +395,18 @@ namespace mbts.ui {
|
||||
public static BTSColor input_invalid_background { get { return new BTSColor(0xAB, 0xAD, 0xB3); } }
|
||||
|
||||
public static BTSColor input_dirty_border => warning;
|
||||
public static BTSColor input_dirty_foreground => BTSCoreColors.very_light_malachite_green;
|
||||
|
||||
public static Brush text_prompt_foreground_brush { get; } = text_prompt_foreground_color.to_brush().frozen();
|
||||
public static Brush input_disabled_text_brush { get; } = input_disabled_text.to_brush().frozen();
|
||||
|
||||
public static class ComboBox {
|
||||
// Normal
|
||||
public static BTSColor normal_background { get { return UI.input_background; } }
|
||||
public static BTSColor normal_background => 0x32ffffff;
|
||||
public static BTSColor normal_background_opaque => 0xff323232;
|
||||
public static BTSColor normal_border { get { return UI.input_border; } }
|
||||
public static BTSColor normal_text { get { return UI.default_text; } }
|
||||
public static BTSColor normal_glyph { get { return normal_text; } }
|
||||
public static BTSColor normal_glyph => 0xffa6a6a6;
|
||||
public static BTSColor normal_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor normal_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -399,7 +414,7 @@ namespace mbts.ui {
|
||||
public static BTSColor mouseover_border { get { return UI.input_mouseover_border; } }
|
||||
public static BTSColor mouseover_background { get { return UI.input_mouseover_background; } }
|
||||
public static BTSColor mouseover_text { get { return normal_text; } }
|
||||
public static BTSColor mouseover_glyph { get { return normal_text; } }
|
||||
public static BTSColor mouseover_glyph => normal_glyph;
|
||||
public static BTSColor mouseover_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor mouseover_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -407,7 +422,7 @@ namespace mbts.ui {
|
||||
public static BTSColor focused_border { get { return UI.input_selected_border; } }
|
||||
public static BTSColor focused_background { get { return input_selected_background; } }
|
||||
public static BTSColor focused_text { get { return normal_text; } }
|
||||
public static BTSColor focused_glyph { get { return normal_text; } }
|
||||
public static BTSColor focused_glyph => normal_glyph;
|
||||
public static BTSColor focused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor focused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -415,7 +430,7 @@ namespace mbts.ui {
|
||||
public static BTSColor focused_dropdown_border { get { return UI.input_selected_border; } }
|
||||
public static BTSColor focused_dropdown_background { get { return input_selected_background; } }
|
||||
public static BTSColor focused_dropdown_text { get { return normal_text; } }
|
||||
public static BTSColor focused_dropdown_glyph { get { return normal_text; } }
|
||||
public static BTSColor focused_dropdown_glyph => normal_glyph;
|
||||
public static BTSColor focused_dropdown_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor focused_dropdown_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -423,7 +438,7 @@ namespace mbts.ui {
|
||||
public static BTSColor unfocused_border { get { return normal_border; } }
|
||||
public static BTSColor unfocused_background { get { return normal_background; } }
|
||||
public static BTSColor unfocused_text { get { return normal_text; } }
|
||||
public static BTSColor unfocused_glyph { get { return normal_text; } }
|
||||
public static BTSColor unfocused_glyph => normal_glyph;
|
||||
public static BTSColor unfocused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor unfocused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -431,7 +446,7 @@ namespace mbts.ui {
|
||||
public static BTSColor selected_border { get { return UI.input_selected_border; } }
|
||||
public static BTSColor selected_background { get { return input_selected_background; } }
|
||||
public static BTSColor selected_text { get { return normal_text; } }
|
||||
public static BTSColor selected_glyph { get { return normal_text; } }
|
||||
public static BTSColor selected_glyph => normal_glyph;
|
||||
public static BTSColor selected_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor selected_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -439,7 +454,7 @@ namespace mbts.ui {
|
||||
public static BTSColor disabled_border { get { return UI.input_disabled_border; } }
|
||||
public static BTSColor disabled_background { get { return UI.input_disabled_background; } }
|
||||
public static BTSColor disabled_text { get { return normal_text; } }
|
||||
public static BTSColor disabled_glyph { get { return normal_text; } }
|
||||
public static BTSColor disabled_glyph => normal_glyph;
|
||||
public static BTSColor disabled_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor disabled_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -447,7 +462,7 @@ namespace mbts.ui {
|
||||
public static BTSColor valid_background { get { return normal_background; } }
|
||||
public static BTSColor valid_border { get { return normal_border; } }
|
||||
public static BTSColor valid_text { get { return normal_text; } }
|
||||
public static BTSColor valid_glyph { get { return normal_text; } }
|
||||
public static BTSColor valid_glyph => normal_glyph;
|
||||
public static BTSColor valid_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor valid_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -455,7 +470,7 @@ namespace mbts.ui {
|
||||
public static BTSColor invalid_focused_border { get { return UI.input_invalid_border; } }
|
||||
public static BTSColor invalid_focused_background { get { return UI.input_invalid_background; } }
|
||||
public static BTSColor invalid_focused_text { get { return normal_text; } }
|
||||
public static BTSColor invalid_focused_glyph { get { return normal_text; } }
|
||||
public static BTSColor invalid_focused_glyph => normal_glyph;
|
||||
public static BTSColor invalid_focused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor invalid_focused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -463,7 +478,7 @@ namespace mbts.ui {
|
||||
public static BTSColor invalid_unfocused_border { get { return UI.input_invalid_border; } }
|
||||
public static BTSColor invalid_unfocused_background { get { return UI.input_invalid_background; } }
|
||||
public static BTSColor invalid_unfocused_text { get { return normal_text; } }
|
||||
public static BTSColor invalid_unfocused_glyph { get { return normal_text; } }
|
||||
public static BTSColor invalid_unfocused_glyph => normal_glyph;
|
||||
public static BTSColor invalid_unfocused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor invalid_unfocused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -471,7 +486,7 @@ namespace mbts.ui {
|
||||
public static BTSColor editable_background { get { return normal_background; } }
|
||||
public static BTSColor editable_border { get { return normal_border; } }
|
||||
public static BTSColor editable_text { get { return normal_text; } }
|
||||
public static BTSColor editable_glyph { get { return normal_text; } }
|
||||
public static BTSColor editable_glyph => normal_glyph;
|
||||
public static BTSColor editable_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor editable_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -479,36 +494,66 @@ namespace mbts.ui {
|
||||
public static BTSColor uneditable_background { get { return normal_background; } }
|
||||
public static BTSColor uneditable_border { get { return normal_border; } }
|
||||
public static BTSColor uneditable_text { get { return normal_text; } }
|
||||
public static BTSColor uneditable_glyph { get { return normal_text; } }
|
||||
public static BTSColor uneditable_glyph => normal_glyph;
|
||||
public static BTSColor uneditable_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor uneditable_button_background { get { return UI.transparent; } }
|
||||
|
||||
//public static BTSColor uncommitted_edit_background => new BTSColor
|
||||
public static BTSColor dropdown_background => 0xff323232;
|
||||
}
|
||||
|
||||
public static class ListBox {
|
||||
// Normal
|
||||
public static BTSColor normal_background => 0xff404046;
|
||||
public static BTSColor normal_border { get { return UI.input_border; } }
|
||||
public static BTSColor normal_text { get { return UI.default_text; } }
|
||||
|
||||
// MouseOver
|
||||
public static BTSColor mouseover_border { get { return UI.input_mouseover_border; } }
|
||||
public static BTSColor mouseover_background { get { return UI.input_mouseover_background; } }
|
||||
public static BTSColor mouseover_text { get { return normal_text; } }
|
||||
|
||||
// Pressed
|
||||
public static BTSColor pressed_background { get { return UI.input_mouseover_background; } }
|
||||
public static BTSColor pressed_border { get { return UI.input_mouseover_border; } }
|
||||
public static BTSColor pressed_text { get { return normal_text; } }
|
||||
|
||||
// Selected
|
||||
public static BTSColor selected_border { get { return UI.input_selected_border; } }
|
||||
public static BTSColor selected_background { get { return input_selected_background; } }
|
||||
public static BTSColor selected_text { get { return normal_text; } }
|
||||
|
||||
// Inactive
|
||||
public static BTSColor inactive_background_overlay => 0x28ffffff;
|
||||
|
||||
// Disabled
|
||||
public static BTSColor disabled_border { get { return UI.input_disabled_border; } }
|
||||
public static BTSColor disabled_background { get { return UI.input_disabled_background; } }
|
||||
public static BTSColor disabled_text { get { return normal_text; } }
|
||||
}
|
||||
|
||||
public static class Button {
|
||||
//Note that the launcher menus use buttons with some custom styles
|
||||
|
||||
// Normal
|
||||
public static BTSColor normal_background { get { return new BTSColor(0xe1); } }
|
||||
public static BTSColor normal_border { get { return new BTSColor(0xAC); } }
|
||||
public static BTSColor normal_background => 0x32ffffff;
|
||||
public static BTSColor normal_border => 0x00ffffff;
|
||||
public static BTSColor normal_foreground { get { return UI.default_text; } }
|
||||
|
||||
// MouseOver
|
||||
public static BTSColor mouseover_background { get { return new BTSColor(0xcb, 0xdc, 0xec); } }
|
||||
public static BTSColor mouseover_border { get { return new BTSColor(0x7E, 0xB4, 0xEA); } }
|
||||
public static BTSColor mouseover_background => 0x50ffffff;
|
||||
public static BTSColor mouseover_border => 0x00ffffff;
|
||||
public static BTSColor mouseover_foreground { get { return normal_foreground; } }
|
||||
|
||||
// Pressed
|
||||
public static BTSColor pressed_background { get { return new BTSColor(0xaa); } }
|
||||
public static BTSColor pressed_border { get { return mouseover_border; } }
|
||||
public static BTSColor pressed_foreground { get { return mouseover_foreground; } }
|
||||
public static BTSColor pressed_background => 0xff707070;
|
||||
public static BTSColor pressed_border => 0xff707070;
|
||||
public static BTSColor pressed_foreground => normal_foreground;
|
||||
|
||||
|
||||
// Disabled
|
||||
public static BTSColor disabled_background { get { return normal_background; } }
|
||||
public static BTSColor disabled_border { get { return normal_border; } }
|
||||
public static BTSColor disabled_foreground { get { return new BTSColor(0x87); } }
|
||||
public static BTSColor disabled_foreground => 0xffa1a1a1;
|
||||
public static Color disabled_foreground_color => disabled_foreground;
|
||||
public static Brush disabled_foreground_brush => disabled_foreground;
|
||||
|
||||
@@ -542,12 +587,23 @@ namespace mbts.ui {
|
||||
|
||||
|
||||
// IsDefault
|
||||
public static BTSColor IsDefault_background { get { return accent1; } }
|
||||
public static BTSColor IsDefault_border { get { return new BTSColor(0); } }
|
||||
public static BTSColor IsDefault_background => 0x8003506f;
|
||||
public static BTSColor IsDefault_border => 0x00ffffff;
|
||||
public static BTSColor IsDefault_foreground { get { return normal_foreground; } }
|
||||
|
||||
}
|
||||
|
||||
public static class ContextMenu {
|
||||
public static BTSColor normal_background => 0xff425272;
|
||||
public static BTSColor normal_foreground => default_text;
|
||||
|
||||
public static BTSColor mouseover_background => ListBox.mouseover_background;
|
||||
public static BTSColor mouseover_foreground => ListBox.mouseover_text;
|
||||
|
||||
public static BTSColor pressed_background => ListBox.mouseover_background;
|
||||
public static BTSColor pressed_foreground => ListBox.mouseover_text;
|
||||
}
|
||||
|
||||
public static BTSColor freeze { get { return gray; } }
|
||||
|
||||
[DisplayInfo(name = "Shell Accent Dark")]
|
||||
@@ -556,10 +612,10 @@ namespace mbts.ui {
|
||||
public static BTSColor accent_light { get { return new BTSColor(0x8f, 0xa9, 0xbe); } }
|
||||
|
||||
public static BTSColor form_border { get { return new BTSColor(80, 80, 90); } }
|
||||
public static BTSColor form_content_border { get { return new BTSColor(0xcc, 0xcc, 0xcc); } }
|
||||
public static BTSColor form_content_border => 0xff919191;
|
||||
|
||||
[DisplayInfo(name = "Shell Dialog Skirt")]
|
||||
public static BTSColor dialog_skirt { get { return new BTSColor(0xe1, 0xe7, 0xeb); } }
|
||||
public static BTSColor dialog_skirt => 0xff363636;
|
||||
|
||||
[DisplayInfo(name = "BTS Success")]
|
||||
public static BTSColor success { get { return new BTSColor(67, 172, 106); } }
|
||||
@@ -637,6 +693,10 @@ namespace mbts.ui {
|
||||
public static BTSColor vol_path { get { return BTSCoreColors.cyan_green_dark; } }
|
||||
}
|
||||
|
||||
public static class VolSurfaceGrid {
|
||||
public static BTSColor readonly_column_foreground => BTSCoreColors.jordy_blue;
|
||||
}
|
||||
|
||||
public static class Heatmap {
|
||||
//public static BTSColor negative_diff { get { return Colors.CornflowerBlue; } }
|
||||
//public static BTSColor no_diff { get { return Colors.White; } }
|
||||
@@ -647,10 +707,39 @@ namespace mbts.ui {
|
||||
public static BTSColor positive_diff { get { return Color.FromRgb(0, 90, 50); } }
|
||||
}
|
||||
|
||||
public static class LadderSpecial {
|
||||
public static class Ladder {
|
||||
public static BTSColor default_column_background => 0xff28283b;
|
||||
public static BTSColor alternate_column_background => 0xff494957;
|
||||
|
||||
public static BTSColor default_column_foreground => UI.default_foreground;
|
||||
|
||||
public static BTSColor passive_volume_bar { get; } = Colors.SlateBlue;
|
||||
public static BTSColor total_volume_bar { get; } = 0x009B69;
|
||||
public static BTSColor default_column_background { get; } = 0xBABABA;
|
||||
|
||||
public static BTSColor orders_column_foreground => default_column_foreground;
|
||||
public static BTSColor orders_column_background => get_column_background(0);
|
||||
|
||||
public static BTSColor bid_column_foreground => MarketData.bid;
|
||||
public static BTSColor bid_column_background => get_column_background(1);
|
||||
public static BTSColor bid_column_market_background => 0xff48484e;
|
||||
public static BTSColor bid_column_market_foreground => bid_column_foreground;
|
||||
|
||||
public static BTSColor price_column_foreground => default_column_foreground;
|
||||
public static BTSColor price_column_background => get_column_background(2);
|
||||
|
||||
public static BTSColor ask_column_foreground => MarketData.ask;
|
||||
public static BTSColor ask_column_background => get_column_background(3);
|
||||
public static BTSColor ask_column_market_background => 0xff48484e;
|
||||
public static BTSColor ask_column_market_foreground => ask_column_foreground;
|
||||
|
||||
public static BTSColor last_column_foreground => default_column_foreground;
|
||||
public static BTSColor last_column_background => get_column_background(4);
|
||||
|
||||
public static BTSColor volume_column_foreground => default_column_foreground;
|
||||
public static BTSColor volume_column_background => get_column_background(5);
|
||||
|
||||
public static BTSColor get_column_background(int index) =>
|
||||
index % 2 == 0 ? default_column_background : alternate_column_background;
|
||||
}
|
||||
|
||||
// Style Guide Colors
|
||||
|
||||
@@ -59,7 +59,11 @@ namespace mbts.ui {
|
||||
public static BTSColor blue_grey_lighter = new BTSColor(0xd1, 0xd7, 0xe0); //d1d7e0
|
||||
public static BTSColor blue_grey_lightest = new BTSColor(0xde, 0xde, 0xe8); //dedee8
|
||||
|
||||
public static BTSColor jordy_blue = 0xff90b8f8;
|
||||
|
||||
// Lavender
|
||||
public static BTSColor mauve => 0xffe5a5ff;
|
||||
public static BTSColor lavender_magenta => 0xffe488f5;
|
||||
|
||||
// Cyan
|
||||
public static BTSColor cyan_green_darker = new BTSColor(0x0a, 0x79, 0x66); //0A7966
|
||||
@@ -93,6 +97,8 @@ namespace mbts.ui {
|
||||
public static BTSColor green_p_light = new BTSColor(0x99, 0xee, 0x90); //99ee90
|
||||
|
||||
public static BTSColor green_dark_light = new BTSColor(0x25, 0x5d, 0x25); //255d25
|
||||
public static BTSColor light_sea_green = 0xff17b794;
|
||||
public static BTSColor very_light_malachite_green = 0xff52e887;
|
||||
|
||||
//Red
|
||||
public static BTSColor red_lighter = new BTSColor(0xff, 0xd9, 0xd9); //ffd9d9
|
||||
@@ -107,6 +113,8 @@ namespace mbts.ui {
|
||||
public static BTSColor red_light_dark = new BTSColor(0xd6, 0x9a, 0x9a); //d69a9a
|
||||
public static BTSColor red_light_dark_saturated = new BTSColor(0xd6, 0x7e, 0x7e); //d67e7e
|
||||
|
||||
public static BTSColor tulip => 0xffff878d;
|
||||
|
||||
// Yellow
|
||||
public static BTSColor yellow_bright = new BTSColor(0xee, 0xff, 0x00); //eeff00
|
||||
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace mbts.spark {
|
||||
static class ShellKeybindings {
|
||||
// public static class Namespaces {
|
||||
// public const string ladder
|
||||
// }
|
||||
|
||||
public const string ladder_scroll_down = "ladder.scroll_down";
|
||||
public const string ladder_scroll_up = "ladder.scroll_up";
|
||||
public const string ladder_half_page_down = "ladder.half_page_down";
|
||||
public const string ladder_half_page_up = "ladder.half_page_up";
|
||||
}
|
||||
|
||||
public interface IKeybindingProvider : IObservable<IReadOnlyDictionary<string, IReadOnlyList<KeyGesture>>> {
|
||||
IReadOnlyDictionary<string, IReadOnlyList<KeyGesture>> value { get; }
|
||||
}
|
||||
|
||||
[Export(typeof(IKeybindingProvider))]
|
||||
public class KeybindingProvider : IKeybindingProvider {
|
||||
Dictionary<string, List<KeyGesture>> _keybindings = new Dictionary<string, List<KeyGesture>>();
|
||||
|
||||
public KeybindingProvider() {
|
||||
_keybindings[ShellKeybindings.ladder_scroll_down] = new List<KeyGesture> { new KeyGesture(Key.E, ModifierKeys.Control) };
|
||||
_keybindings[ShellKeybindings.ladder_scroll_up] = new List<KeyGesture> { new KeyGesture(Key.Y, ModifierKeys.Control) };
|
||||
}
|
||||
|
||||
public IReadOnlyDictionary<string, IReadOnlyList<KeyGesture>> value =>
|
||||
new CovariantWrapper(_keybindings);
|
||||
|
||||
public IDisposable Subscribe(IObserver<IReadOnlyDictionary<string, IReadOnlyList<KeyGesture>>> observer) {
|
||||
observer.OnNext(new CovariantWrapper(_keybindings));
|
||||
return Disposable.empty;
|
||||
}
|
||||
|
||||
class CovariantWrapper : IReadOnlyDictionary<string, IReadOnlyList<KeyGesture>> {
|
||||
Dictionary<string, List<KeyGesture>> _keybindings = new Dictionary<string, List<KeyGesture>>();
|
||||
|
||||
public CovariantWrapper(Dictionary<string, List<KeyGesture>> keybindings) =>
|
||||
_keybindings = keybindings;
|
||||
|
||||
public IReadOnlyList<KeyGesture> this[string key] => _keybindings[key];
|
||||
|
||||
public IEnumerable<string> Keys => _keybindings.Keys;
|
||||
|
||||
public IEnumerable<IReadOnlyList<KeyGesture>> Values => _keybindings.Select(kv => kv.Value);
|
||||
|
||||
public int Count => _keybindings.Count;
|
||||
|
||||
public bool ContainsKey(string key) => _keybindings.ContainsKey(key);
|
||||
|
||||
public IEnumerator<KeyValuePair<string, IReadOnlyList<KeyGesture>>> GetEnumerator() =>
|
||||
_keybindings.Select(kv => new KeyValuePair<string, IReadOnlyList<KeyGesture>>(kv.Key, kv.Value)).GetEnumerator();
|
||||
|
||||
|
||||
public bool TryGetValue(string key, [MaybeNullWhen(false)] out IReadOnlyList<KeyGesture> value) {
|
||||
if (_keybindings.TryGetValue(key, out var res)) {
|
||||
value = res;
|
||||
return true;
|
||||
}
|
||||
value = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() =>
|
||||
GetEnumerator();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
using bts.api.core;
|
||||
using bts.api.persistence;
|
||||
using bts.api.user;
|
||||
|
||||
using mbts.config;
|
||||
using mbts.persist;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui.settings {
|
||||
//
|
||||
// This class is used for tools like SettingsManager.exe
|
||||
//
|
||||
[Export(typeof(IUserPersistFactory))]
|
||||
class UISettingsFactory : IUserPersistFactory {
|
||||
Task<User[]> _users;
|
||||
readonly PersistenceService _persist;
|
||||
|
||||
[ImportingConstructor]
|
||||
public UISettingsFactory(AuthService login, [Import("settings")] PersistenceService persist) {
|
||||
_persist = persist;
|
||||
_users = get_users(login);
|
||||
}
|
||||
|
||||
async Task<User[]> get_users(AuthService login) {
|
||||
var users = await login.get_users_async(null);
|
||||
if (users.success) return users.value.Users.ToArray();
|
||||
else return new User[0];
|
||||
}
|
||||
|
||||
public IEnumerable<string> users() { return _users.Result.Select(u => u.Login); }
|
||||
|
||||
public IUserPersist get_persist_for(string name) {
|
||||
var user = _users.Result.FirstOrDefault(u => u.Login == name);
|
||||
return new UserUISettings(user.Id, _persist, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui {
|
||||
public interface ICloseable {
|
||||
event EventHandler CloseRequested;
|
||||
void OnClose();
|
||||
}
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
using bts;
|
||||
using bts.api.core;
|
||||
using bts.api.persistence;
|
||||
using bts.spark;
|
||||
|
||||
using Spark.Core.Protobuf;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
public abstract class UISettingsBase : IPersist, IUserPersist, IDisposable {
|
||||
protected abstract string user();
|
||||
string uns(string ns) { return $"{user()}#{ns}"; }
|
||||
PersistenceService _persist;
|
||||
ErrorReporter _errors;
|
||||
|
||||
private const string _settings_change_base = "/ui/settingschange/";
|
||||
|
||||
public UISettingsBase(PersistenceService persist, ErrorReporter errors) {
|
||||
_persist = persist;
|
||||
_errors = errors;
|
||||
}
|
||||
|
||||
|
||||
public Task set<T>(string ns, string key, T value) {
|
||||
return _persist.store_async(new StoreRequest() {
|
||||
Ns = uns(ns),
|
||||
Record = {
|
||||
new Record() {
|
||||
Key = key,
|
||||
Value = serialize(value)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Task clear(string ns, string key) {
|
||||
return _persist.remove_async(new RemoveRequest() {
|
||||
Ns = uns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<T> get<T>(string ns, string key) {
|
||||
var ret = await _persist.retrieve_async(new RetrieveRequest() {
|
||||
Ns = uns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
check_error(ret, ns, key, out bool empty);
|
||||
if (empty) return default(T);
|
||||
return deserialize<T>(ret.value.Record.Single().Value);
|
||||
}
|
||||
|
||||
public async Task<T[]> get_many<T>(string ns, string key) {
|
||||
var ret = await _persist.retrieve_async(new RetrieveRequest() {
|
||||
Ns = uns(ns),
|
||||
Key = { key }
|
||||
});
|
||||
check_error(ret, ns, key, out bool empty);
|
||||
if (empty) {
|
||||
return Array.Empty<T>();
|
||||
}
|
||||
return ProtobufSerializationHelper.deserialize_many<T>(
|
||||
ret.value.Record.Single().Value.ToByteArray());
|
||||
}
|
||||
|
||||
private Google.Protobuf.ByteString serialize<T>(T obj) {
|
||||
var buffer = new MemoryStream();
|
||||
ProtoBuf.Serializer.SerializeWithLengthPrefix(buffer, obj, ProtoBuf.PrefixStyle.Fixed32);
|
||||
buffer.Seek(0, SeekOrigin.Begin);
|
||||
return Google.Protobuf.ByteString.FromStream(buffer);
|
||||
}
|
||||
|
||||
private T deserialize<T>(Google.Protobuf.ByteString buffer) {
|
||||
var stream = new MemoryStream(buffer.ToByteArray());
|
||||
try {
|
||||
var rv = ProtoBuf.Serializer.DeserializeWithLengthPrefix<T>(stream, ProtoBuf.PrefixStyle.Fixed32);
|
||||
return rv;
|
||||
} catch (Exception ex) {
|
||||
Log.Gen.warn($"Error deserializing protobuf of type {typeof(T)}: {ex}");
|
||||
}
|
||||
return default;
|
||||
}
|
||||
|
||||
private void check_error(Result<RetrieveResponse> result, string ns, string key, out bool empty) {
|
||||
if (result.success) {
|
||||
switch (result.value.Result) {
|
||||
case RetrieveResponse.Types.Result.EmptyNs:
|
||||
case RetrieveResponse.Types.Result.NoSuchNs:
|
||||
case RetrieveResponse.Types.Result.NoSuchKey:
|
||||
empty = true;
|
||||
return;
|
||||
case RetrieveResponse.Types.Result.EmptyKey:
|
||||
case RetrieveResponse.Types.Result.DuplicateKey:
|
||||
_errors?.report_error($"Invalid Key {result} '{key}'", "Requested Invalid Settings Key", System.Windows.MessageBoxImage.Information);
|
||||
empty = true;
|
||||
return;
|
||||
default:
|
||||
case RetrieveResponse.Types.Result.Ok:
|
||||
empty = false;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
_errors?.report_error($"There was an error communicating with the settings server: '{result.error_message}'", "Failed to retrieve settings from the server");
|
||||
empty = true;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<PersistResult<T>>> query<T>(string ns, string pattern) {
|
||||
var re = new Regex(pattern);
|
||||
var results = await _persist.retrieve_all_async(
|
||||
new RetrieveAllRequest() {
|
||||
Ns = uns(ns)
|
||||
});
|
||||
check_error(results, ns, "", out bool empty);
|
||||
if (empty) return Enumerable.Empty<PersistResult<T>>();
|
||||
return results.value.Record
|
||||
.Where(r => re.IsMatch(r.Key))
|
||||
.Select(r => new PersistResult<T>() {
|
||||
user = user(),
|
||||
ns = ns,
|
||||
key = r.Key,
|
||||
value = deserialize<T>(r.Value)
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public IDisposable subscribe<T>(string ns, string pattern, Action<IEnumerable<PersistResult<T>>> callback) {
|
||||
return subscribe<T>(ns, pattern).Subscribe(callback);
|
||||
}
|
||||
|
||||
public IObservable<IEnumerable<PersistResult<T>>> subscribe<T>(string ns, string pattern) {
|
||||
var re = new Regex(pattern);
|
||||
return _persist
|
||||
.subscribe_ns(uns(ns))
|
||||
.Select(update =>
|
||||
update.added
|
||||
.Where(item => re.IsMatch(item.Key))
|
||||
.Select(item => new PersistResult<T>() {
|
||||
user = user(),
|
||||
ns = ns,
|
||||
key = item.Key,
|
||||
value = deserialize<T>(item.Value)
|
||||
}))
|
||||
.SubscribeOn(SynchronizationContext.Current);
|
||||
}
|
||||
|
||||
public void Dispose() {/*UISettings does not own Persistence*/}
|
||||
}
|
||||
|
||||
[Export(typeof(IPersist))]
|
||||
public class UISettings : UISettingsBase {
|
||||
protected override string user() { return "all_users"; }
|
||||
|
||||
[ImportingConstructor]
|
||||
public UISettings([Import("settings")] PersistenceService p, ErrorReporter err) : base(p, err) { }
|
||||
}
|
||||
|
||||
[Export(typeof(IUserPersist))]
|
||||
public class UserUISettings : UISettingsBase {
|
||||
string _user;
|
||||
|
||||
public UserUISettings(uint user_id, [Import("settings")] PersistenceService persist, ErrorReporter err)
|
||||
: base(persist, err) {
|
||||
_user = $"User {user_id}";
|
||||
}
|
||||
|
||||
[ImportingConstructor]
|
||||
public UserUISettings(Lazy<UserTuple> user, [Import("settings")] PersistenceService persist, ErrorReporter err)
|
||||
: this(user.Value.id, persist, err) { }
|
||||
|
||||
protected override string user() { return _user; }
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
namespace mbts.spark {
|
||||
using bts.utils;
|
||||
|
||||
using ProtoBuf;
|
||||
|
||||
using System;
|
||||
|
||||
interface ISettingsProfile<T> {
|
||||
uint id { get; }
|
||||
string name { get; }
|
||||
T value { get; }
|
||||
SecurityCriteria security_criteria { get; }
|
||||
}
|
||||
|
||||
struct SettingsProfile<T> : IEquatable<SettingsProfile<T>> where T : class, IEquatable<T> {
|
||||
public static readonly Func<SettingsProfile<T>, uint> key_fn = ns => ns.id;
|
||||
|
||||
public readonly uint id;
|
||||
public readonly string name;
|
||||
public readonly T value;
|
||||
public readonly SecurityCriteria security_criteria;
|
||||
|
||||
public SettingsProfile(uint id, string name, T value, SecurityCriteria security_criteria = null) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.security_criteria = security_criteria;
|
||||
}
|
||||
|
||||
public SettingsProfile<T> with(uint? id = null, string name = null, T value = null, SecurityCriteria security_criteria = null) =>
|
||||
new SettingsProfile<T>(id ?? this.id, name ?? this.name, value ?? this.value, security_criteria ?? this.security_criteria);
|
||||
|
||||
public bool Equals(SettingsProfile<T> other) =>
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
value.safe_equals(other.value) &&
|
||||
security_criteria.safe_equals(other.security_criteria);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is SettingsProfile<T> other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
id.GetHashCode();
|
||||
}
|
||||
|
||||
[ProtoContract]
|
||||
class LadderSettingsProfile : ISettingsProfile<LadderSettings>, IEquatable<LadderSettingsProfile> {
|
||||
public LadderSettingsProfile() { }
|
||||
|
||||
public LadderSettingsProfile(uint id, string name, LadderSettings value, SecurityCriteria security_criteria = null) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.security_criteria = security_criteria;
|
||||
}
|
||||
|
||||
[ProtoMember(1)]
|
||||
public uint id { get; }
|
||||
|
||||
[ProtoMember(2)]
|
||||
public string name { get; }
|
||||
|
||||
[ProtoMember(3)]
|
||||
public LadderSettings value { get; }
|
||||
|
||||
[ProtoMember(4)]
|
||||
public SecurityCriteria security_criteria { get; }
|
||||
|
||||
public LadderSettingsProfile with(uint? id = null, LadderSettings value = null) =>
|
||||
new LadderSettingsProfile(id ?? this.id, name, value ?? this.value, security_criteria);
|
||||
|
||||
public bool Equals(LadderSettingsProfile other) =>
|
||||
other != null &&
|
||||
id == other.id &&
|
||||
name == other.name &&
|
||||
value.safe_equals(other.value) &&
|
||||
security_criteria.safe_equals(other.security_criteria);
|
||||
|
||||
public override bool Equals(object obj) => Equals(obj as LadderSettingsProfile);
|
||||
public override int GetHashCode() => id.GetHashCode();
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
// convert to a hashset for quicker lookups
|
||||
var exclude = new HashSet<string>(except_props);
|
||||
return new PropertyChangeDetector<T>(
|
||||
ReflectionHelper.get_props<T>()
|
||||
ReflectionHelper.properties<T>()
|
||||
.Where(p => !exclude.Contains(p.Name))
|
||||
.Select(p => p.Name)
|
||||
.ToArray());
|
||||
@@ -52,9 +52,10 @@
|
||||
readonly (string name, Action<T> initialize, Func<T, bool> refresh)[] _property_monitors;
|
||||
|
||||
public PropertyChangeDetector() {
|
||||
_property_monitors = new (string name, Action<T> initialize, Func<T, bool> refresh)[ReflectionHelper.get_props<T>().Count];
|
||||
var num_props = ReflectionHelper.properties<T>().Count;
|
||||
_property_monitors = new (string, Action<T>, Func<T, bool>)[num_props];
|
||||
int i = 0;
|
||||
foreach (var pad in ReflectionHelper.prop_accessors<T>().Values) {
|
||||
foreach (var pad in ReflectionHelper.property_accessors<T>().Values) {
|
||||
var (initialize, refresh) = pad.create_snapshot();
|
||||
_property_monitors[i++] = (pad.prop_info.Name, initialize, refresh);
|
||||
}
|
||||
@@ -64,7 +65,7 @@
|
||||
_property_monitors = new (string name, Action<T> initialize, Func<T, bool> refresh)[props.Length];
|
||||
int ppos = 0, pm_pos = 0;
|
||||
while (ppos < props.Length) {
|
||||
if (ReflectionHelper.prop_accessors<T>().TryGetValue(props[ppos++], out var pad)) {
|
||||
if (ReflectionHelper.property_accessors<T>().TryGetValue(props[ppos++], out var pad)) {
|
||||
var (initialize, refresh) = pad.create_snapshot();
|
||||
_property_monitors[pm_pos++] = (pad.prop_info.Name, initialize, refresh);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mbts="clr-namespace:mbts.ui"
|
||||
xmlns:ui="clr-namespace:mbts.ui"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
>
|
||||
<!--Control Base Colors-->
|
||||
<Color x:Key="Control.SuperLightGrayColor">#F6F6F6</Color>
|
||||
@@ -16,13 +17,26 @@
|
||||
<Color x:Key="Control.AlphaMediumGrayColor2">#FF0000</Color>
|
||||
<Color x:Key="Control.DarkMediumGrayColor">#FF959595</Color>
|
||||
<Color x:Key="Control.DarkGrayColor">#707070</Color>
|
||||
<Color x:Key="Text.Prompt.Foreground.Color">#FF999999</Color>
|
||||
<Color x:Key="Control.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="Control.MouseOver.BackgroundColor">#606060</Color>
|
||||
<Color x:Key="Text.BackgroundColor">#404040</Color>
|
||||
<Color x:Key="Text.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="TextBox.BackgroundColor">#404040</Color>
|
||||
<Color x:Key="TextBox.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="Text.Prompt.ForegroundColor">#B9B9B9</Color>
|
||||
|
||||
<SolidColorBrush x:Key="Text.BackgroundBrush" Color="{StaticResource TextBox.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="Text.ForegroundBrush" Color="{StaticResource TextBox.ForegroundColor}" />
|
||||
<SolidColorBrush x:Key="TextBox.BackgroundBrush" Color="{StaticResource TextBox.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="TextBox.ForegroundBrush" Color="{StaticResource TextBox.ForegroundColor}" />
|
||||
<SolidColorBrush x:Key="Text.Prompt.ForegroundBrush" Color="{StaticResource Text.Prompt.ForegroundColor}" />
|
||||
|
||||
<SolidColorBrush x:Key="Control.AlphaLightGrayBrush" Color="{StaticResource Control.AlphaLightGrayColor}"/>
|
||||
<SolidColorBrush x:Key="Control.AlphaLightMediumGrayBrush" Color="{StaticResource Control.AlphaLightMediumGrayColor}"/>
|
||||
<SolidColorBrush x:Key="Control.LightGrayBrush" Color="{StaticResource Control.LightGrayColor}"/>
|
||||
<SolidColorBrush x:Key="Control.LightMediumGrayBrush" Color="{StaticResource Control.LightMediumGrayColor}"/>
|
||||
<SolidColorBrush x:Key="Control.MediumGrayBrush" Color="{StaticResource Control.MediumGrayColor}"/>
|
||||
<SolidColorBrush x:Key="Control.ForegroundBrush" Color="{StaticResource Control.ForegroundColor}"/>
|
||||
<SolidColorBrush x:Key="CommonBackground" Color="{ui:BTSColor common_background}" />
|
||||
<SolidColorBrush x:Key="ControlBackground" Color="{x:Static mbts:BTSColors.common_background}" />
|
||||
<SolidColorBrush x:Key="AccentColor1" Color="{x:Static mbts:BTSColors.accent1}" />
|
||||
@@ -42,29 +56,28 @@
|
||||
<SolidColorBrush x:Key="dialog_skirt" Color="{mbts:BTSColor Name=UI.dialog_skirt}" />
|
||||
|
||||
<!---TextBox-->
|
||||
<Color x:Key="TextBox.Static.Background.Color">#FFFFFFFF</Color>
|
||||
<Color x:Key="TextBox.Static.Border.Color">#FFABADB3</Color>
|
||||
<Color x:Key="TextBox.MouseOver.Border.Color">#FF7EB4EA</Color>
|
||||
<Color x:Key="TextBox.Static.Background.Color">#404040</Color>
|
||||
<Color x:Key="TextBox.Static.Border.Color">#00FFFFFF</Color>
|
||||
<Color x:Key="TextBox.MouseOver.Border.Color">#80FFFFFF</Color>
|
||||
|
||||
<SolidColorBrush x:Key="TextBox.Static.Border.Brush" Color="{StaticResource TextBox.Static.Border.Color}"/>
|
||||
<SolidColorBrush x:Key="TextBox.Static.Background.Brush" Color="{StaticResource TextBox.Static.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TextBox.MouseOver.Border.Brush" Color="{StaticResource TextBox.MouseOver.Border.Color}"/>
|
||||
|
||||
<!--Menu-->
|
||||
<Color x:Key="MenuItem.MouseOver.Background.Color">#3D26A0DA</Color>
|
||||
<Color x:Key="MenuItem.MouseOver.Border.Color">#FF26A0DA</Color>
|
||||
<Color x:Key="Menu.Background.Color">#FFF5F5F5</Color>
|
||||
<Color x:Key="Menu.DarkBackground.Color">#FFF1F1F1</Color>
|
||||
<Color x:Key="Menu.Border.Color">#FFE2E3E3</Color>
|
||||
<Color x:Key="MenuItem.MouseOver.Background.Color">#404040</Color>
|
||||
<Color x:Key="MenuItem.MouseOver.Border.Color">#80FFFFFF</Color>
|
||||
<Color x:Key="Menu.Background.Color">#202020</Color>
|
||||
<Color x:Key="Menu.Border.Color">#00FFFFFF</Color>
|
||||
|
||||
<!--CheckBox-->
|
||||
<Color x:Key="CheckBox.Static.ForegroundColor">#FF212121</Color>
|
||||
<Color x:Key="CheckBox.Static.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="CheckBox.Static.BackgroundColor">#FFFFFFFF</Color>
|
||||
<Color x:Key="CheckBox.Static.BorderColor">#FF707070</Color>
|
||||
<Color x:Key="CheckBox.MouseOver.BackgroundColor">#FFF3F9FF</Color>
|
||||
<Color x:Key="CheckBox.MouseOver.BorderColor">#FF5593FF</Color>
|
||||
<Color x:Key="CheckBox.Pressed.BackgroundColor">#FFD9ECFF</Color>
|
||||
<Color x:Key="CheckBox.Pressed.BorderColor">#FF3C77DD</Color>
|
||||
<Color x:Key="CheckBox.Static.BorderColor">#00FFFFFF</Color>
|
||||
<Color x:Key="CheckBox.MouseOver.BackgroundColor">#404040</Color>
|
||||
<Color x:Key="CheckBox.MouseOver.BorderColor">#80FFFFFF</Color>
|
||||
<Color x:Key="CheckBox.Pressed.BackgroundColor">#303030</Color>
|
||||
<Color x:Key="CheckBox.Pressed.BorderColor">#00FFFFFF</Color>
|
||||
|
||||
<SolidColorBrush x:Key="CheckBox.Static.ForegroundBrush" Color="{StaticResource CheckBox.Static.ForegroundColor}"/>
|
||||
<SolidColorBrush x:Key="CheckBox.Static.BackgroundBrush" Color="{StaticResource CheckBox.Static.BackgroundColor}"/>
|
||||
@@ -83,54 +96,59 @@
|
||||
<Color x:Key="ComboBoxBorderDarkColor">#FF569DE5</Color>
|
||||
<Color x:Key="ComboBoxDisabledBorderColor">#FFD9D9D9</Color>
|
||||
|
||||
<LinearGradientBrush x:Key="ComboBox.Static.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundLightColor}" Offset="0.0"/>
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundMediumColor}" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="{StaticResource ComboBoxBorderLightColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="#FFABADB3"/>
|
||||
<Color x:Key="ComboBox.Static.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="ComboBox.Static.BackgroundColor">#32FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Static.BorderColor">#00FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.MouseOver.BackgroundColor">#50FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Pressed.BackgroundColor">#707070</Color>
|
||||
|
||||
<Color x:Key="ComboBox.MouseOver.Editable.BackgroundColor">#50FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Pressed.Editable.BackgroundColor">#707070</Color>
|
||||
<Color x:Key="ComboBox.Pressed.Editable.Button.BackgroundColor">#FFC4E0FC</Color>
|
||||
<Color x:Key="ComboBox.Disabled.Editable.ForegroundColor">#FF888888</Color>
|
||||
<Color x:Key="ComboBox.Disabled.Editable.BackgroundColor">#24FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Disabled.Editable.BorderColor">#00FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Disabled.Editable.Button.BackgroundColor">#24FFFFFF</Color>
|
||||
<Color x:Key="ComboBox.Disabled.Editable.Button.BorderColor">#00FFFFFF</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Background" Color="{StaticResource ComboBox.Static.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Foreground" Color="{StaticResource ComboBox.Static.ForegroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Border" Color="{StaticResource ComboBox.Static.BorderColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Background" Color="#606060"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Border" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Background" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Editable.Button.Border" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#FF000000"/>
|
||||
<LinearGradientBrush x:Key="ComboBox.MouseOver.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FFECF4FC" Offset="0.0"/>
|
||||
<GradientStop Color="#FFDCECFC" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Glyph" Color="#DDDDDD"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Background" Color="{StaticResource ComboBox.MouseOver.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Border" Color="{StaticResource ComboBoxBorderMediumColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="{StaticResource ComboBox.MouseOver.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
|
||||
<LinearGradientBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FFEBF4FC" Offset="0.0"/>
|
||||
<GradientStop Color="#FFDCECFC" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#FF7EB4EA"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#FF000000"/>
|
||||
<LinearGradientBrush x:Key="ComboBox.Pressed.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FFDAECFC" Offset="0.0"/>
|
||||
<GradientStop Color="#FFC4E0FC" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Background" Color="Transparent" />
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Button.Border" Color="#7EB4EA"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Glyph" Color="#DDDDDD"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Background" Color="{StaticResource ComboBox.Pressed.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Border" Color="{StaticResource ComboBoxBorderDarkColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="{StaticResource ComboBox.Pressed.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
|
||||
<LinearGradientBrush x:Key="ComboBox.Pressed.Editable.Button.Background" EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="#FFDAEBFC" Offset="0.0"/>
|
||||
<GradientStop Color="#FFC4E0FC" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Background" Color="{StaticResource ComboBox.Pressed.Editable.Button.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Border" Color="#FF569DE5"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Glyph" Color="#FFBFBFBF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="{StaticResource ComboBoxBackgroundMediumColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Border" Color="{StaticResource ComboBoxDisabledBorderColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="#FFBFBFBF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="Transparent"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Background" Color="{StaticResource ComboBox.Disabled.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Border" Color="{StaticResource ComboBox.Disabled.Editable.BorderColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Background" Color="{StaticResource ComboBox.Disabled.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Disabled.Editable.Button.Border" Color="{StaticResource ComboBox.Disabled.Editable.Button.BorderColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Static.Glyph" Color="#FF606060"/>
|
||||
|
||||
<!--Toggle Switch-->
|
||||
<Color x:Key="ToggleSwitchOnColor">#FF4182F6</Color>
|
||||
|
||||
<!--ListBox-->
|
||||
<Color x:Key="ListBox.Background.Color">#404040</Color>
|
||||
<Color x:Key="ListBox.Foreground.Color">#DDDDDD</Color>
|
||||
<Color x:Key="ListBoxItem.Background.Color">#00FFFFFF</Color>
|
||||
<Color x:Key="ListBoxItem.Foreground.Color">#DDDDDD</Color>
|
||||
<Color x:Key="ListBoxItem.Selected.Active.Background.Color">#3D25A0DA</Color>
|
||||
<Color x:Key="ListBoxItem.Selected.Active.Border.Color">#FF26A0DA</Color>
|
||||
<Color x:Key="ListBoxItem.Selected.Inactive.Background.Color">#3DDADADA</Color>
|
||||
@@ -138,10 +156,42 @@
|
||||
<Color x:Key="ListBoxItem.MouseOver.Background.Color">#1F26A0DA</Color>
|
||||
<Color x:Key="ListBoxItem.MouseOver.Border.Color">#A826A0DA</Color>
|
||||
|
||||
<SolidColorBrush x:Key="ListBox.Background" Color="{u:BTSColor UI.ListBox.normal_background}" />
|
||||
<SolidColorBrush x:Key="ListBox.Foreground" Color="{StaticResource ListBox.Foreground.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Background" Color="{StaticResource ListBoxItem.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Foreground" Color="{StaticResource ListBoxItem.Foreground.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Selected.Active.Background" Color="{StaticResource ListBoxItem.Selected.Active.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Selected.Active.Border" Color="{StaticResource ListBoxItem.Selected.Active.Border.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Selected.Inactive.Background" Color="{StaticResource ListBoxItem.Selected.Inactive.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.Selected.Inactive.Border" Color="{StaticResource ListBoxItem.Selected.Inactive.Border.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.MouseOver.Background" Color="{StaticResource ListBoxItem.MouseOver.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="ListBoxItem.MouseOver.Border" Color="{StaticResource ListBoxItem.MouseOver.Border.Color}"/>
|
||||
|
||||
<!--TabControl-->
|
||||
<Color x:Key="TabControl.Background.Color">#404040</Color>
|
||||
<Color x:Key="TabControl.Foreground.Color">#DDDDDD</Color>
|
||||
<Color x:Key="TabItem.Background.Color">#404040</Color>
|
||||
<Color x:Key="TabItem.Foreground.Color">#DDDDDD</Color>
|
||||
<Color x:Key="TabItem.Selected.Active.Foreground.Color">#FFFFFF</Color>
|
||||
<Color x:Key="TabItem.Selected.Active.Background.Color">#3D25A0DA</Color>
|
||||
<Color x:Key="TabItem.Selected.Active.Border.Color">#FF26A0DA</Color>
|
||||
<Color x:Key="TabItem.Selected.Inactive.Background.Color">#3DDADADA</Color>
|
||||
<Color x:Key="TabItem.Selected.Inactive.Border.Color">#FFDADADA</Color>
|
||||
<Color x:Key="TabItem.MouseOver.Background.Color">#1F26A0DA</Color>
|
||||
<Color x:Key="TabItem.MouseOver.Border.Color">#A826A0DA</Color>
|
||||
|
||||
<Color x:Key="TabLightColor">#FF919191</Color>
|
||||
<Color x:Key="TabMediumColor">#FF646464</Color>
|
||||
|
||||
<SolidColorBrush x:Key="TabControl.Background" Color="{StaticResource TabControl.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TabControl.Foreground" Color="{StaticResource TabControl.Foreground.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Background" Color="{StaticResource TabItem.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Foreground" Color="{StaticResource TabItem.Foreground.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Selected.Active.Background" Color="{StaticResource TabItem.Selected.Active.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Selected.Active.Foreground" Color="{StaticResource TabItem.Selected.Active.Foreground.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Selected.Active.Border" Color="{StaticResource TabItem.Selected.Active.Border.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Selected.Inactive.Background" Color="{StaticResource TabItem.Selected.Inactive.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.Selected.Inactive.Border" Color="{StaticResource TabItem.Selected.Inactive.Border.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.MouseOver.Background" Color="{StaticResource TabItem.MouseOver.Background.Color}"/>
|
||||
<SolidColorBrush x:Key="TabItem.MouseOver.Border" Color="{StaticResource TabItem.MouseOver.Border.Color}"/>
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +1,7 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
>
|
||||
@@ -10,7 +11,7 @@
|
||||
<SolidColorBrush x:Key="Ellipse.Disabled.Brush" Color="Gray"/>
|
||||
<Style TargetType="c:ExpanderToggleButton" BasedOn="{StaticResource {x:Type ToggleButton}}">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderBrush" Value="{u:BTSColor UI.ComboBox.normal_glyph}" />
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="3,0,0,0"/>
|
||||
<Setter Property="Template">
|
||||
@@ -75,4 +76,11 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style
|
||||
x:Key="ExpanderToggleButton.Dark"
|
||||
TargetType="c:ExpanderToggleButton"
|
||||
BasedOn="{StaticResource {x:Type c:ExpanderToggleButton}}">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -211,15 +211,27 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,4,0,0" Text="RGBA (Red, Green, Blue, Alpha)"/>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,4,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="RGBA (Red, Green, Blue, Alpha)" />
|
||||
<c:ActionMenu
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
ItemsSource="{Binding action_menu_items}"
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<!--R-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="0,2,0,0" Text="R"/>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="R" />
|
||||
|
||||
<Slider Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding red, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -229,8 +241,14 @@
|
||||
Height="20"
|
||||
Text="{Binding red, Mode=TwoWay}"
|
||||
/>
|
||||
|
||||
<!--G-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Margin="0,2,0,0" Text="G"/>
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="G" />
|
||||
<Slider Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding green, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -240,8 +258,14 @@
|
||||
Height="20"
|
||||
Text="{Binding green, Mode=TwoWay}"
|
||||
/>
|
||||
|
||||
<!--B-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Margin="0,2,0,0" Text="B"/>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Text="B"
|
||||
Foreground="{u:BTSColor UI.default_text}" />
|
||||
<Slider Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding blue, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -249,10 +273,15 @@
|
||||
u:TextBoxBehavior.InputFilter="{u:RegexInputFilter Regex={StaticResource ArgbRegex}}"
|
||||
VerticalAlignment="Center"
|
||||
Height="20"
|
||||
Text="{Binding blue, Mode=TwoWay}"
|
||||
/>
|
||||
Text="{Binding blue, Mode=TwoWay}" />
|
||||
|
||||
<!--A-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Margin="0,2,0,0" Text="A"/>
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="A" />
|
||||
<Slider Grid.Column="1" Grid.Row="4" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding alpha, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -263,9 +292,17 @@
|
||||
Text="{Binding alpha, Mode=TwoWay}"
|
||||
/>
|
||||
<!--HSL-->
|
||||
<TextBlock Grid.Row="5" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,4,0,0" Text="HSL (Hue, Saturation, Lightness)"/>
|
||||
<TextBlock
|
||||
Grid.Row="5"
|
||||
Grid.ColumnSpan="3"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,4,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="HSL (Hue, Saturation, Lightness)" />
|
||||
<!--H-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="6" Margin="0,2,0,0" Text="H"/>
|
||||
<TextBlock
|
||||
Grid.Row="6" Margin="0,2,0,0" Foreground="{u:BTSColor UI.default_text}" Text="H" />
|
||||
<Slider Grid.Column="1" Grid.Row="6" HorizontalAlignment="Stretch" Minimum="1" Maximum="359" TickFrequency="1" Value="{Binding hue, Mode=TwoWay}" ToolTip="{Binding hue_tool_tip}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -275,8 +312,14 @@
|
||||
Height="20"
|
||||
Text="{Binding hue, Mode=TwoWay, StringFormat='0.###'}"
|
||||
/>
|
||||
|
||||
<!--S-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="7" VerticalAlignment="Center" Margin="0,2,0,0" Text="S"/>
|
||||
<TextBlock
|
||||
Grid.Row="7"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="S" />
|
||||
<Slider Grid.Column="1" Grid.Row="7" HorizontalAlignment="Stretch" Minimum="0.01" Maximum="0.99" TickFrequency="0.01" Value="{Binding saturation, Mode=TwoWay}" ToolTip="{Binding saturation_tool_tip}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -286,8 +329,15 @@
|
||||
Height="20"
|
||||
Text="{Binding saturation, Mode=TwoWay, StringFormat='0.###'}"
|
||||
/>
|
||||
|
||||
<!--L-->
|
||||
<TextBlock Grid.Column="0" Grid.Row="8" VerticalAlignment="Center" Margin="0,2,0,0" Text="L"/>
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Grid.Row="8"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="L" />
|
||||
<Slider Grid.Column="1" Grid.Row="8" HorizontalAlignment="Stretch" Minimum="0.01" Maximum="0.99" TickFrequency="0.01" Value="{Binding light, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
|
||||
@@ -8,16 +8,12 @@
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
xmlns:cp="clr-namespace:mbts.ui.controls.color_picker"
|
||||
Header="{Binding SelectedColor, RelativeSource={RelativeSource Self}, Mode=OneWay}"
|
||||
ShowExpanderArrow="False"
|
||||
>
|
||||
ShowExpanderArrow="False">
|
||||
<c:PopupControl.Background>
|
||||
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundLightColor}" Offset="0.0"/>
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundMediumColor}" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush Color="{StaticResource ComboBox.Static.BackgroundColor}" />
|
||||
</c:PopupControl.Background>
|
||||
<c:PopupControl.BorderBrush>
|
||||
<SolidColorBrush Color="{StaticResource ComboBoxBorderLightColor}"/>
|
||||
<SolidColorBrush Color="{StaticResource ComboBox.Static.BorderColor}"/>
|
||||
</c:PopupControl.BorderBrush>
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager AttachToMembers="True">
|
||||
@@ -37,8 +33,7 @@
|
||||
<VisualState Name="Enabled"/>
|
||||
<VisualState Name="Disabled">
|
||||
<Storyboard>
|
||||
<ColorAnimation Storyboard.TargetProperty="(c:PopupControl.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" Duration="0" To="{StaticResource ComboBoxBackgroundMediumColor}"/>
|
||||
<ColorAnimation Storyboard.TargetProperty="(c:PopupControl.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" Duration="0" To="{StaticResource ComboBoxBackgroundMediumColor}"/>
|
||||
<ColorAnimation Storyboard.TargetProperty="(c:PopupControl.Background).(SolidColorBrush.Color)" Duration="0" To="{StaticResource ComboBox.MouseOver.BackgroundColor}"/>
|
||||
<ColorAnimation Storyboard.TargetProperty="(c:PopupControl.BorderBrush).(SolidColorBrush.Color)" Duration="0" To="{StaticResource ComboBoxDisabledBorderColor}"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(c:PopupControl.Opacity)" Duration="0" To="0.5"/>
|
||||
</Storyboard>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls">
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/view/Colors.xaml"/>
|
||||
<ResourceDictionary Source="/view/Resources/Converters.xaml" />
|
||||
@@ -60,19 +62,36 @@
|
||||
ContentTemplateSelector="{Binding HeaderContentTemplateSelector, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Template="{StaticResource MultiSelectToggleButton}"
|
||||
/>
|
||||
<Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" AllowsTransparency="True">
|
||||
<Grid x:Name="DropDown" MinWidth="{TemplateBinding ActualWidth}" MaxHeight="{TemplateBinding MaxDropDownHeight}" Background="White">
|
||||
<Border x:Name="DropDownBorder" BorderThickness="1" BorderBrush="LightGray" CornerRadius="4" Margin="0,2,0,0">
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True">
|
||||
<Popup
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
Placement="Bottom"
|
||||
PopupAnimation="{DynamicResource
|
||||
{x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
|
||||
AllowsTransparency="True">
|
||||
<Grid
|
||||
x:Name="DropDown"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Border x:Name="DropDownBorder" Padding="4,6,4,6">
|
||||
<ScrollViewer SnapsToDevicePixels="True">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Border BorderBrush="Black" BorderThickness="0,0,0,1" Margin="0,0,0,2" Visibility="{TemplateBinding ShowSelectAll, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<CheckBox Content="All" IsChecked="{Binding IsAllSelected, RelativeSource={RelativeSource TemplatedParent}}" VerticalContentAlignment="Center" />
|
||||
<CheckBox
|
||||
Content="All"
|
||||
IsChecked="{Binding IsAllSelected, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
VerticalContentAlignment="Center"
|
||||
Style="{DynamicResource CheckBox.Dark}" />
|
||||
</Border>
|
||||
<StackPanel Grid.Row="1" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
IsItemsHost="True"
|
||||
KeyboardNavigation.DirectionalNavigation="Contained"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
@@ -89,7 +108,7 @@
|
||||
|
||||
<Style TargetType="c:ComboCheckBoxItem">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="4,1" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
@@ -115,8 +134,8 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.MouseOver.Background}" />
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}" />
|
||||
<Setter Property="Background" TargetName="Bd" Value="{u:BTSColor UI.ComboBox.mouseover_background}" />
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{u:BTSColor UI.ComboBox.mouseover_border}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -128,9 +147,10 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MinHeight" Value="20" />
|
||||
<Setter Property="IsEditable" Value="False" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBox.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBox.Static.Border}"/>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.ComboBox.normal_text}" />
|
||||
<Setter Property="Background" Value="{u:BTSColor UI.ComboBox.normal_background_opaque}" />
|
||||
<Setter Property="BorderBrush" Value="{u:BTSColor UI.ComboBox.normal_border}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Template" Value="{StaticResource MultiSelectTemplate}" />
|
||||
|
||||
+4
-2
@@ -23,7 +23,8 @@ namespace mbts.ui.controls {
|
||||
public override FrameworkElement view_factory() {
|
||||
var v = new OrderTypeItem {
|
||||
FontFamily = font_family,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch,
|
||||
VerticalContentAlignment = VerticalAlignment.Center
|
||||
};
|
||||
v.SetBinding(OrderTypeItem.BadgeFillProperty, _badge_fill_binding);
|
||||
@@ -36,7 +37,8 @@ namespace mbts.ui.controls {
|
||||
bind(FontFamilyProperty, nameof(font_family));
|
||||
bind(FontSizeProperty, nameof(font_size));
|
||||
bind(ForegroundProperty, nameof(font_brush));
|
||||
bind(HorizontalAlignmentProperty, nameof(horizontal_alignment));
|
||||
bind(BackgroundProperty, nameof(background_brush));
|
||||
bind(HorizontalContentAlignmentProperty, nameof(horizontal_alignment));
|
||||
bind(OrderTypeItem.WidthProperty, nameof(ActualWidth));
|
||||
return v;
|
||||
//
|
||||
|
||||
+1
-2
@@ -23,7 +23,6 @@ namespace mbts.ui.controls {
|
||||
public TColKey key { get; }
|
||||
public IDataGridColumnFilter filter_model { get; }
|
||||
public string filter_template => DataGridFilterKnownTemplates.DiscreteValues;
|
||||
public Brush background { get; set; }
|
||||
public VerticalAlignment vertical_alignment { get; set; } = VerticalAlignment.Center;
|
||||
public Thickness padding { get; set; } = DefaultCellPadding;
|
||||
public GlyphContext glyph_context { get; set; } = TextUtils.StandardGlyphContext;
|
||||
@@ -32,7 +31,7 @@ namespace mbts.ui.controls {
|
||||
Side side = _get_side(row);
|
||||
CellRender.draw_text(
|
||||
dc, glyph_context, font_size, side.ToString(), position, row_height,
|
||||
_get_foreground(side), background, horizontal_alignment, vertical_alignment, padding);
|
||||
_get_foreground(side), background_brush, horizontal_alignment, vertical_alignment, padding);
|
||||
}
|
||||
|
||||
static Brush _get_foreground(Side side) {
|
||||
|
||||
@@ -23,16 +23,39 @@ namespace mbts.ui.controls {
|
||||
public class RenderTextColumn<TRowVM> : RenderColumnBase<TRowVM>, IRenderColumn<TRowVM>, IFilterableColumn {
|
||||
protected readonly Func<TRowVM, string> _get_text;
|
||||
protected readonly Func<TRowVM, Brush> _get_background_brush;
|
||||
protected readonly Func<TRowVM, Brush> _get_foreground_brush;
|
||||
|
||||
public RenderTextColumn(
|
||||
Func<TRowVM, string> get_text,
|
||||
IDataGridColumnFilter filter = null,
|
||||
string filter_template = null,
|
||||
Func<TRowVM, Brush> get_brush = null)
|
||||
Func<TRowVM, Brush> get_background = null,
|
||||
Func<TRowVM, Brush> get_foreground = null)
|
||||
: base() {
|
||||
_get_text = get_text;
|
||||
Func<TRowVM, Brush> get_default_background_brush = (TRowVM _) => this.background_brush;
|
||||
_get_background_brush = get_brush ?? get_default_background_brush;
|
||||
if (get_background is not null) {
|
||||
var get_row_brush = get_background;
|
||||
get_background = r => {
|
||||
var row_brush = get_row_brush(r);
|
||||
if (row_brush is null) {
|
||||
return background_brush;
|
||||
}
|
||||
if (row_brush is not SolidColorBrush row_sbrush ||
|
||||
background_brush is not SolidColorBrush col_sbrush) {
|
||||
return row_brush;
|
||||
}
|
||||
var row_color = row_sbrush.Color.with(
|
||||
(byte)(row_sbrush.Opacity * row_sbrush.Color.A));
|
||||
var col_color = col_sbrush.Color.with(
|
||||
(byte)(col_sbrush.Opacity * col_sbrush.Color.A));
|
||||
return row_color.blend(col_color).to_brush();
|
||||
};
|
||||
}
|
||||
_get_background_brush = get_background ?? new Func<TRowVM, Brush>(_ => {
|
||||
return background_brush;
|
||||
});
|
||||
_get_foreground_brush = get_foreground
|
||||
?? (_ => font_brush);
|
||||
this.filter_model = filter;
|
||||
this.filter_template = filter_template;
|
||||
font_params_changed += refresh_glyph_context;
|
||||
@@ -49,16 +72,37 @@ namespace mbts.ui.controls {
|
||||
|
||||
public override void draw(TRowVM row, DrawingContext dc, ColumnGeometry position, double row_height) =>
|
||||
CellRender.draw_text(
|
||||
dc, glyph_context, font_size, _get_text(row), position, row_height,
|
||||
font_brush, _get_background_brush(row), horizontal_alignment, vertical_alignment, padding);
|
||||
dc,
|
||||
glyph_context,
|
||||
font_size,
|
||||
_get_text(row),
|
||||
position,
|
||||
row_height,
|
||||
_get_foreground_brush(row),
|
||||
_get_background_brush(row),
|
||||
horizontal_alignment,
|
||||
vertical_alignment,
|
||||
padding);
|
||||
}
|
||||
|
||||
public class RenderTextColumn<TRowVM, TColKey> : RenderTextColumn<TRowVM>, IKeyedColumn<TColKey> {
|
||||
public RenderTextColumn(TColKey key, Func<TRowVM, string> get_text, IDataGridColumnFilter filter, string filter_template)
|
||||
: base(get_text, filter, filter_template) => this.key = key;
|
||||
|
||||
public RenderTextColumn(TColKey key, Func<TRowVM, string> get_text, IDataGridColumnFilter filter, string filter_template, Func<TRowVM, Brush> get_brush)
|
||||
: base(get_text, filter, filter_template, get_brush) => this.key = key;
|
||||
public RenderTextColumn(
|
||||
TColKey key,
|
||||
Func<TRowVM, string> get_text,
|
||||
IDataGridColumnFilter filter,
|
||||
string filter_template,
|
||||
Func<TRowVM, Brush> get_background = null,
|
||||
Func<TRowVM, Brush> get_foreground = null)
|
||||
: base(
|
||||
get_text,
|
||||
filter,
|
||||
filter_template,
|
||||
get_background: get_background,
|
||||
get_foreground: get_foreground) =>
|
||||
this.key = key;
|
||||
|
||||
public TColKey key { get; }
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
||||
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.input_cell_background}}"/>
|
||||
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.default_row_background}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.alternate_row_background}}"/>
|
||||
|
||||
@@ -302,8 +302,12 @@ namespace mbts.ui.controls {
|
||||
return;
|
||||
rect.Intersect(this.GetChildBounds(_drag_rect_adorner.AdornedElement));
|
||||
_drag_rect_adorner.Child.Margin = new Thickness(rect.Left, rect.Top, 0, 0);
|
||||
_drag_rect_adorner.Child.Width = rect.Width;
|
||||
_drag_rect_adorner.Child.Height = rect.Height;
|
||||
if (rect.Width.is_real_non_negative()) {
|
||||
_drag_rect_adorner.Child.Width = rect.Width;
|
||||
}
|
||||
if (rect.Height.is_real_non_negative()) {
|
||||
_drag_rect_adorner.Child.Height = rect.Height;
|
||||
}
|
||||
}
|
||||
|
||||
void _select_items_between(object inclusive_begin, object inclusive_end) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
namespace mbts.ui.settings {
|
||||
using bts;
|
||||
using bts.proto;
|
||||
using bts.utils;
|
||||
using mbts.ui.converters;
|
||||
|
||||
@@ -21,14 +20,12 @@
|
||||
_default_font_color = 0,
|
||||
_default_background = 0x00FFFFFF;
|
||||
const ushort _default_font_weight = 400;
|
||||
const uint _default_background_color = 0x00FFFFFF; // Colors.Transparent
|
||||
const bool _default_enable_background_color = false;
|
||||
|
||||
public static GridSettings Default =>
|
||||
new GridSettings(
|
||||
selection_highlight: FallbackValues.selection_highlight.rgb_color(),
|
||||
background: _default_background_color, //new ColorOpacityProto(FallbackValues.background_color.Color, FallbackValues.background_color.Opacity));
|
||||
enable_background_color: _default_enable_background_color);
|
||||
selection_highlight: BTSColors.Grid.grid_selection_background,
|
||||
background: BTSColors.Grid.default_column_background,
|
||||
font_color: BTSColors.Grid.default_column_foreground);
|
||||
|
||||
// corrects any inappropriate values that would render the grid unusable (usually nulls)
|
||||
// NOTE: if you add a property to GridSettings that could have such a value, please add a conditional-correction for it below)
|
||||
@@ -42,15 +39,6 @@
|
||||
return grid_settings;
|
||||
}
|
||||
|
||||
public static class FallbackValues {
|
||||
public static FontFamily font_family => new FontFamily(_default_font_family);
|
||||
public static double font_size => _default_font_size;
|
||||
public static Color font_color => _default_font_color.rgb_color();
|
||||
public static FontWeight font_weight => FontWeight.FromOpenTypeWeight(_default_font_weight);
|
||||
public static Color selection_highlight => Colors.MediumSlateBlue.with(0x63);
|
||||
public static uint background_color => _default_background;
|
||||
}
|
||||
|
||||
public static IValueConverter font_family_converter => ValueConverter.create<GridSettings, FontFamily>(gs => new FontFamily(gs.font_family));
|
||||
public static IValueConverter font_weight_converter => ValueConverter.create<GridSettings, FontWeight>(gs => gs.font_weight);
|
||||
public static IValueConverter font_size_converter => ValueConverter.create<GridSettings, double>(gs => gs.font_size);
|
||||
@@ -72,24 +60,7 @@
|
||||
[DefaultValue(_default_font_color)]
|
||||
readonly uint _font_color;
|
||||
// selection highlight
|
||||
ColorOpacityProto _obsolete_selection_highlight_backing;
|
||||
uint _selection_highlight_backing;
|
||||
[ProtoMember(5)]
|
||||
ColorOpacityProto _obsolete_selection_highlight {
|
||||
get => _obsolete_selection_highlight_backing;
|
||||
set {
|
||||
_obsolete_selection_highlight_backing = value;
|
||||
// only overwrite non-obsolete selection highlight if it is 0 (assume that means 'unassigned').
|
||||
if (_selection_highlight_backing == 0) {
|
||||
var color = value.argb_color;
|
||||
// ensure reasonable opacity
|
||||
color.A = color.A.within_range(
|
||||
GridSettingsMigrationRules.SelectionHighlightIsTranslucent.min_alpha,
|
||||
GridSettingsMigrationRules.SelectionHighlightIsTranslucent.max_alpha);
|
||||
_selection_highlight_backing = color.rgb_color();
|
||||
}
|
||||
}
|
||||
}
|
||||
[ProtoMember(10)]
|
||||
uint _selection_highlight {
|
||||
get => _selection_highlight_backing;
|
||||
@@ -105,9 +76,6 @@
|
||||
[ProtoMember(8)]
|
||||
[DefaultValue(_default_background)]
|
||||
uint _background;
|
||||
[ProtoMember(9)]
|
||||
[DefaultValue(_default_enable_background_color)]
|
||||
readonly bool _enable_background_color;
|
||||
|
||||
public GridSettings() {
|
||||
_font_family = _default_font_family;
|
||||
@@ -115,7 +83,6 @@
|
||||
_font_weight = _default_font_weight;
|
||||
_font_color = _default_font_color;
|
||||
_background = _default_background;
|
||||
_enable_background_color = _default_enable_background_color;
|
||||
}
|
||||
|
||||
public GridSettings(
|
||||
@@ -126,8 +93,7 @@
|
||||
uint selection_highlight = 0,
|
||||
IEnumerable<GridColumnSettings> columns = null,
|
||||
IEnumerable<SortingCriteria> sorting_criteria = null,
|
||||
uint background = _default_background,
|
||||
bool enable_background_color = _default_enable_background_color) {
|
||||
uint background = _default_background) {
|
||||
//
|
||||
_font_family = font_family;
|
||||
_font_size = font_size;
|
||||
@@ -137,7 +103,6 @@
|
||||
_columns = new List<GridColumnSettings>(columns.empty_if_null());
|
||||
_sorting_criteria = new List<SortingCriteria>(sorting_criteria.empty_if_null());
|
||||
_background = background;
|
||||
_enable_background_color = enable_background_color;
|
||||
}
|
||||
|
||||
public string font_family => _font_family;
|
||||
@@ -147,7 +112,6 @@
|
||||
public Color background => _background.argb_color();
|
||||
public Color selection_highlight => _selection_highlight.argb_color();
|
||||
public uint background_color => _background;
|
||||
public bool enable_background_color => _enable_background_color;
|
||||
public IReadOnlyList<GridColumnSettings> columns => _columns ?? (_columns = new List<GridColumnSettings>(0));
|
||||
[Obsolete] // TODO: remove sorting_criteria from GridSettings entirely. This should be part of IShellWindow's StartupData, since it is an instance-specific setting, and prob not part of the shared defaults
|
||||
public IReadOnlyList<SortingCriteria> sorting_criteria => _sorting_criteria ?? (_sorting_criteria = new List<SortingCriteria>(0));
|
||||
@@ -158,7 +122,6 @@
|
||||
string font_family = null,
|
||||
double font_size = double.NaN,
|
||||
uint? background = null,
|
||||
bool? enable_background_color = null,
|
||||
uint? selection_highlight = null) =>
|
||||
new GridSettings(
|
||||
font_family ?? _font_family,
|
||||
@@ -168,8 +131,7 @@
|
||||
selection_highlight ?? _selection_highlight,
|
||||
columns ?? _columns,
|
||||
sorting_criteria ?? _sorting_criteria,
|
||||
background ?? _background,
|
||||
enable_background_color ?? _enable_background_color);
|
||||
background ?? _background);
|
||||
|
||||
public GridSettings Clone() => with();
|
||||
|
||||
@@ -183,7 +145,6 @@
|
||||
font_color == other.font_color &&
|
||||
selection_highlight == other.selection_highlight &&
|
||||
_background == other._background &&
|
||||
_enable_background_color == other._enable_background_color &&
|
||||
EqualityComparer.safe_sequence_equals(columns, other.columns) &&
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
EqualityComparer.safe_sequence_equals(sorting_criteria, other.sorting_criteria);
|
||||
@@ -200,7 +161,6 @@
|
||||
font_color.GetHashCode(),
|
||||
selection_highlight.GetHashCode(),
|
||||
_background.GetHashCode(),
|
||||
_enable_background_color.GetHashCode(),
|
||||
EqualityComparer.safe_aggregate_hash(columns),
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
EqualityComparer.safe_aggregate_hash(sorting_criteria));
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace mbts.spark {
|
||||
readonly Property<FontWeight> _font_weight;
|
||||
readonly Property<string> _font_display_name;
|
||||
readonly Property<double> _font_size;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations, _show_background_color;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations;
|
||||
readonly OrdersModel _orders_model;
|
||||
readonly IReadOnlyDictionary<string, GridColumnSettingsFeatureFlags> _column_flags;
|
||||
|
||||
@@ -89,7 +89,6 @@ namespace mbts.spark {
|
||||
_font_display_name = backing(nameof(font_display_name), () => TextUtils.display_name(font_family, font_size), new[] { nameof(font_family), nameof(font_size) });
|
||||
_show_predicate_animations = backing(nameof(show_predicate_animations), true);
|
||||
_show_cell_predicate_animations = backing(nameof(show_cell_predicate_animations), true);
|
||||
_show_background_color = backing(nameof(show_background_color), false);
|
||||
_current_column = backing<IColumnVM>(nameof(current_column));
|
||||
predicate_animations = new ObservableEditableCollection<PredicateRowAnimationVM>(() =>
|
||||
new PredicateRowAnimationVM(_create_predicate_vm(), _predicate_data_factory), true);
|
||||
@@ -106,9 +105,8 @@ namespace mbts.spark {
|
||||
public FontFamily font_family { get => _font_family.Value; set => _font_family.set(value); }
|
||||
public FontWeight font_weight { get => _font_weight.Value; set => _font_weight.set(value); }
|
||||
public ColorPickerPopupVM font_color { get; } = new ColorPickerPopupVM();
|
||||
public ColorPickerPopupVM selection_highlight { get; } = new ColorPickerPopupVM();
|
||||
public ColorPickerPopupVM background_color { get; } = new ColorPickerPopupVM();
|
||||
public bool show_background_color => _show_background_color.Value;
|
||||
public ColorPickerPopupVM selection_highlight { get; } = new ColorPickerPopupVM() { bind_opacity_to_alpha = true };
|
||||
public ColorPickerPopupVM background_color { get; } = new ColorPickerPopupVM() { bind_opacity_to_alpha = true };
|
||||
public double font_size { get => _font_size.Value; set => _font_size.set(value); }
|
||||
public bool enable_sound_triggers => true;
|
||||
public bool show_predicate_animations { get => _show_predicate_animations.Value; set => _show_predicate_animations.set(value); }
|
||||
@@ -140,9 +138,8 @@ namespace mbts.spark {
|
||||
animation_map.AddOrUpdate(g.Key, p => animation_tuple(c: g), (p, t) => t.cell_animations.AddRange(g));
|
||||
}
|
||||
return _create_settings_obj(new GridSettings(font_family.name(), font_size, font_weight, font_color.color.rgb_color(), selection_highlight.color.rgb_color(), col_settings,
|
||||
background: show_background_color ?
|
||||
background_color.color.with((byte)(background_color.opacity.within_range(0, 1) * 255.0)).rgb_color() :
|
||||
Colors.Transparent.rgb_color()),
|
||||
background: background_color.color.with(
|
||||
(byte)(background_color.opacity.within_range(0, 1) * 255.0)).rgb_color()),
|
||||
animation_map.Select(kv => PredicateAnimations.create_data<TRowData, TPredicateData>(kv.Key, kv.Value.cell_animations, kv.Value.row_animations, kv.Value.sounds)));
|
||||
//
|
||||
(List<RowAnimation> row_animations, List<SoundNotification> sounds, List<CellAnimation> cell_animations) animation_tuple(IEnumerable<RowAnimation> r = null, IEnumerable<SoundNotification> s = null, IGrouping<TPredicateData, CellAnimation> c = null) =>
|
||||
@@ -154,14 +151,7 @@ namespace mbts.spark {
|
||||
_font_weight.set(sd.general.font_weight);
|
||||
font_color.load_from(sd.general.font_color.rgb_solid_brush());
|
||||
selection_highlight.color = sd.general.selection_highlight;
|
||||
_show_background_color.set(sd.general.enable_background_color);
|
||||
if (sd.general.enable_background_color) {
|
||||
// note that when the OB is moved to allow background colors
|
||||
// we can just background_color.color instead of load_from
|
||||
// so that we get all the alpha goodness similar to SimpleGridSettingsVM
|
||||
// assuming bind_opacity_to_alpha on the picker.
|
||||
background_color.load_from(sd.general.background_color.argb_color().to_solid_brush());
|
||||
}
|
||||
background_color.color = sd.general.background;
|
||||
_font_size.set(sd.general.font_size);
|
||||
var col_animations = new Dictionary<string, Dictionary<TPredicateData, List<CellAnimation>>>();
|
||||
predicate_animations.Clear();
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
xmlns:usp="clr-namespace:mbts.ui.spark"
|
||||
xmlns:ut="clr-namespace:mbts.ui.utilities"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
>
|
||||
TextBlock.Foreground="{u:BTSColor UI.default_text}">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -25,6 +25,7 @@
|
||||
<ResourceDictionary Source="/view/Controls/DIYGrid/Settings/Animation/SoundAnimationView.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/DIYGrid/Settings/Animation/CellAnimationView.xaml"/>
|
||||
<ResourceDictionary Source="/view/Resources/ComboBoxes.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/DragDropItemsControl/DragDropListBox.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
<sys:Double x:Key="VerticalPush">4.0</sys:Double>
|
||||
<sys:Double x:Key="VerticalSplit">8.0</sys:Double>
|
||||
@@ -72,20 +73,15 @@
|
||||
</cv:KeyValue.Value>
|
||||
</cv:KeyValue>
|
||||
</cv:ValueMap>
|
||||
<Style x:Key="DisabledPlaceholderComboBox" TargetType="ComboBox">
|
||||
<Setter Property="IsEnabled" Value="False"/>
|
||||
<Setter Property="Foreground" Value="Gray"/>
|
||||
<Setter Property="SelectedIndex" Value="0"/>
|
||||
<Setter Property="ItemsSource">
|
||||
<Setter.Value>
|
||||
<x:ArrayExtension Type="{x:Type sys:String}">
|
||||
<sys:String>(N/A)</sys:String>
|
||||
</x:ArrayExtension>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="CheckBox" BasedOn="{StaticResource CheckBox.Dark}"/>
|
||||
|
||||
<Style TargetType="c:ExpanderToggleButton" BasedOn="{StaticResource ExpanderToggleButton.Dark}"/>
|
||||
|
||||
<Style TargetType="GroupBox" BasedOn="{StaticResource {x:Type GroupBox}}">
|
||||
<Setter Property="TextBlock.Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
<Setter Property="Padding" Value="8"/>
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="VerticalAlignment" Value="Stretch"/>
|
||||
</Style>
|
||||
@@ -360,7 +356,12 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock>Header</TextBlock>
|
||||
<TextBox x:Name="display_name_text_box" Grid.Column="2" ToolTipService.ShowOnDisabled="True" Text="{Binding display_name}"/>
|
||||
<TextBox
|
||||
x:Name="display_name_text_box"
|
||||
Grid.Column="2"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
Text="{Binding display_name}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBlock Grid.Row="2">Width</TextBlock>
|
||||
<c:TickUpDownDouble Grid.Row="2" Grid.Column="2" Value="{Binding width}" Format="0.##"/>
|
||||
<TextBlock Grid.Row="4">Horizontal Alignment</TextBlock>
|
||||
@@ -369,52 +370,36 @@
|
||||
<ComboBox
|
||||
Grid.Row="6"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
ItemsSource="{Binding DataContext.font_family, Converter={StaticResource FontFamilyWeightsConverter}, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}}"
|
||||
SelectedItem="{Binding font_weight_override}"
|
||||
/>
|
||||
<ComboBox Grid.Row="6" Grid.Column="2" Visibility="{Binding is_font_weight_overridden, Converter={StaticResource FalseVisibilityConverter}}" Style="{StaticResource DisabledPlaceholderComboBox}"/>
|
||||
<CheckBox Grid.Row="8" VerticalAlignment="Top" IsEnabled="{Binding can_override_font_color}" IsChecked="{Binding is_font_color_overridden}">Override Font Color</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="8"
|
||||
Grid.Column="2"
|
||||
DataContext="{Binding font_color_override}"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding DataContext.current_column.is_font_color_overridden, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="8"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding DataContext.current_column.is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}}"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
Grid.Row="10"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding can_override_background_color}"
|
||||
IsChecked="{Binding is_background_color_overridden}"
|
||||
Visibility="{Binding show_background_color, Converter={StaticResource BoolToVisibility}}">
|
||||
IsChecked="{Binding is_background_color_overridden}">
|
||||
Override Background Color
|
||||
</CheckBox>
|
||||
|
||||
<StackPanel Grid.Row="10" Grid.Column="2" Visibility="{Binding show_background_color, Converter={StaticResource BoolToVisibility}}">
|
||||
<StackPanel Grid.Row="10" Grid.Column="2">
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="10"
|
||||
Grid.Column="2"
|
||||
DataContext="{Binding background_color_override}"
|
||||
Visibility="{Binding
|
||||
DataContext.is_background_color_overridden,
|
||||
Converter={StaticResource BooleanToVisibilityConverter},
|
||||
Converter={StaticResource HiddenVisibilityConverter},
|
||||
RelativeSource={RelativeSource AncestorType=StackPanel}}" />
|
||||
<ComboBox
|
||||
Grid.Row="10"
|
||||
Grid.Column="2"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding
|
||||
is_background_color_overridden,
|
||||
Converter={StaticResource FalseVisibilityConverter}}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
@@ -437,24 +422,17 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
ItemsSource="{Binding DataContext.font_family, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}, Converter={StaticResource FontFamilyWeightsConverter}}"
|
||||
SelectedItem="{Binding font_weight_override}"
|
||||
/>
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" Visibility="{Binding is_font_weight_overridden, Converter={StaticResource FalseVisibilityConverter}}" Style="{StaticResource DisabledPlaceholderComboBox}"/>
|
||||
<CheckBox Grid.Row="2" VerticalAlignment="Top" IsChecked="{Binding is_font_color_overridden}">Override Font Color</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -515,12 +493,11 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
ItemsSource="{Binding DataContext.font_family, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}, Converter={StaticResource FontFamilyWeightsConverter}}"
|
||||
SelectedItem="{Binding font_weight_override}"
|
||||
/>
|
||||
<!--Group-->
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" Visibility="{Binding is_font_weight_overridden, Converter={StaticResource FalseVisibilityConverter}}" Style="{StaticResource DisabledPlaceholderComboBox}"/>
|
||||
<CheckBox Grid.Row="2" VerticalAlignment="Top" IsChecked="{Binding is_font_color_overridden}">Override Font Color</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="2"
|
||||
@@ -528,14 +505,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -544,7 +514,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -566,12 +536,11 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
ItemsSource="{Binding DataContext.font_family, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}, Converter={StaticResource FontFamilyWeightsConverter}}"
|
||||
SelectedItem="{Binding font_weight_override}"
|
||||
/>
|
||||
<!--Group-->
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" Visibility="{Binding is_font_weight_overridden, Converter={StaticResource FalseVisibilityConverter}}" Style="{StaticResource DisabledPlaceholderComboBox}"/>
|
||||
<CheckBox Grid.Row="2" VerticalAlignment="Top" IsChecked="{Binding is_font_color_overridden}">Override Font Color</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="2"
|
||||
@@ -579,14 +548,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -595,7 +557,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -617,12 +579,11 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
ItemsSource="{Binding DataContext.font_family, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}, Converter={StaticResource FontFamilyWeightsConverter}}"
|
||||
SelectedItem="{Binding font_weight_override}"
|
||||
/>
|
||||
<!--Group-->
|
||||
<ComboBox Grid.Row="0" Grid.Column="2" Visibility="{Binding is_font_weight_overridden, Converter={StaticResource FalseVisibilityConverter}}" Style="{StaticResource DisabledPlaceholderComboBox}"/>
|
||||
<CheckBox Grid.Row="2" VerticalAlignment="Top" IsChecked="{Binding is_font_color_overridden}">Override Font Color</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="2"
|
||||
@@ -630,14 +591,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -646,14 +600,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
<ComboBox
|
||||
Grid.Row="4"
|
||||
Grid.Column="2"
|
||||
VerticalAlignment="Top"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -855,11 +802,6 @@
|
||||
/>
|
||||
</Grid>
|
||||
<!--<CheckBox Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding play_sound}">Play Sound</CheckBox>-->
|
||||
<!--<ComboBox
|
||||
Grid.Column="1"
|
||||
Visibility="{Binding play_sound, Converter={StaticResource FalseVisibilityConverter}}"
|
||||
Style="{StaticResource DisabledPlaceholderComboBox}"
|
||||
/>-->
|
||||
<Button
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="Left"
|
||||
@@ -936,9 +878,9 @@
|
||||
<ColumnDefinition Width="{Binding Source={StaticResource HorizontalGap}}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<c:DragDropListBox Grid.RowSpan="3" MinWidth="200" MaxHeight="500" ItemsSource="{Binding columns}" SelectedItem="{Binding current_column}">
|
||||
<c:DragDropListBox Grid.RowSpan="3" MinWidth="200" MaxHeight="200" ItemsSource="{Binding columns}" SelectedItem="{Binding current_column}">
|
||||
<c:DragDropListBox.ItemContainerStyle>
|
||||
<Style TargetType="c:DraggableListBoxItem">
|
||||
<Style TargetType="c:DraggableListBoxItem" BasedOn="{StaticResource ListBoxItem.Dark}">
|
||||
<Setter Property="Cursor" Value="Arrow"/>
|
||||
</Style>
|
||||
</c:DragDropListBox.ItemContainerStyle>
|
||||
|
||||
@@ -18,7 +18,6 @@ using System.Linq;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
using FontFamily = System.Windows.Media.FontFamily;
|
||||
|
||||
@@ -41,7 +40,7 @@ namespace mbts.spark {
|
||||
readonly Property<FontWeight> _font_weight;
|
||||
readonly Property<string> _font_display_name;
|
||||
readonly Property<double> _font_size;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations, _show_background_color;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations;
|
||||
readonly DeferrableActionWrapper _update;
|
||||
readonly IReadOnlyDictionary<string, GridColumnSettingsFeatureFlags> _column_flags;
|
||||
readonly Func<GridColumnSettings, ISimpleColumnVM> _column_factory;
|
||||
@@ -55,7 +54,6 @@ namespace mbts.spark {
|
||||
_font_display_name = backing(nameof(font_display_name), () => TextUtils.display_name(font_family, font_size), new[] { nameof(font_family), nameof(font_size) });
|
||||
_show_predicate_animations = backing(nameof(show_predicate_animations), true);
|
||||
_show_cell_predicate_animations = backing(nameof(show_cell_predicate_animations), true);
|
||||
_show_background_color = backing(nameof(show_background_color), false);
|
||||
_current_column = backing<ISimpleColumnVM>(nameof(current_column));
|
||||
// update
|
||||
_update = new DeferrableActionWrapper(() => result_changed?.Invoke());
|
||||
@@ -90,7 +88,6 @@ namespace mbts.spark {
|
||||
public ColorPickerPopupVM background_color { get; } = new ColorPickerPopupVM() { bind_opacity_to_alpha = true };
|
||||
// TODO: consolidate background/background_color into 1 property (tricky merge yielded 2 properties with the same purpose)
|
||||
public ColorPickerPopupVM background => background_color;
|
||||
public bool show_background_color => _show_background_color.Value;
|
||||
public double font_size { get => _font_size.Value; set => _font_size.set(value); }
|
||||
public bool enable_sound_triggers => false;
|
||||
public bool show_predicate_animations { get => _show_predicate_animations.Value; set => _show_predicate_animations.set(value); }
|
||||
@@ -126,9 +123,7 @@ namespace mbts.spark {
|
||||
font_color.color.rgb_color(),
|
||||
selection_highlight.color.rgb_color(),
|
||||
columns.Select(c => c.create()),
|
||||
enable_background_color: show_background_color,
|
||||
background: (show_background_color ?
|
||||
background_color.color : Colors.Transparent).argb_color());
|
||||
background: background_color.color.argb_color());
|
||||
|
||||
public void load_from(GridSettings value) {
|
||||
if (value == null)
|
||||
@@ -138,10 +133,7 @@ namespace mbts.spark {
|
||||
_font_weight.set(value.font_weight);
|
||||
font_color.load_from(value.font_color.rgb_solid_brush());
|
||||
selection_highlight.color = value.selection_highlight;
|
||||
_show_background_color.set(value.enable_background_color);
|
||||
if (value.enable_background_color) {
|
||||
background_color.color = value.background;
|
||||
}
|
||||
background_color.color = value.background;
|
||||
_font_size.set(value.font_size);
|
||||
var curr_col_id = current_column?.id;
|
||||
columns.SetItems(value.columns.Select(_column_factory));
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
>
|
||||
<SolidColorBrush x:Key="header_background" Color="{u:BTSColor Name=header}" />
|
||||
<SolidColorBrush x:Key="header_foreground" Color="{u:BTSColor Name=header_text}" />
|
||||
<SolidColorBrush x:Key="SwipeSumBackground" Color="SlateBlue" Opacity="0.4" />
|
||||
|
||||
<Style x:Key="SelectRowHeaderCell" TargetType="DataGridRowHeader">
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="{u:BTSColor header}" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor header_text}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
||||
<!--Must disable RowHeader button when there are 0 columns (known bug in WPF DataGrid): https://connect.microsoft.com/VisualStudio/feedback/details/778456/click-on-datagridrowheader-raise-an-argumentoutofrange-exception-when-there-is-no-columns -->
|
||||
<Setter Property="IsEnabled" Value="{Binding Columns.Count, RelativeSource={RelativeSource AncestorType=DataGrid}, Converter={StaticResource IntNotZeroConverter}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="DataGridRowHeader">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SelectAllHeaderCell" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Background" Value="{u:BTSColor header}" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor header_text}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
>
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
<Setter Property="Foreground" Value="Black" />
|
||||
<Setter Property="FontWeight" Value="Bold" />
|
||||
<Setter Property="FontSize" Value="12" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="DataGridCellTemplateWithPadding" TargetType="DataGridCell">
|
||||
<Border
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
SnapsToDevicePixels="True"
|
||||
>
|
||||
<ContentPresenter
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="DataGridCellBaseStyle" TargetType="DataGridCell">
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="Padding" Value="4,0" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template" Value="{StaticResource DataGridCellTemplateWithPadding}" />
|
||||
</Style>
|
||||
<Style TargetType="DataGridCell" BasedOn="{StaticResource DataGridCellBaseStyle}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{u:BTSColor Grid.grid_selection_background}" />
|
||||
<Setter Property="Foreground" Value="Black"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="SwipeSumCell" TargetType="DataGridCell" BasedOn="{StaticResource DataGridCellBaseStyle}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{StaticResource SwipeSumBackground}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="RowHeaderCell" TargetType="DataGridCell">
|
||||
<Setter Property="Background" Value="{u:BTSColor Name=header}"/>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor Name=header_text}"/>
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="2,0" />
|
||||
<Setter Property="Template" Value="{StaticResource DataGridCellTemplateWithPadding}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type DataGrid}">
|
||||
<Setter Property="UseLayoutRounding" Value="True" />
|
||||
<Setter Property="ColumnHeaderStyle" Value="{StaticResource {x:Type DataGridColumnHeader}}" />
|
||||
<Setter Property="Background" Value="{u:BTSColor Name=UI.default_background}" />
|
||||
<Setter Property="AlternatingRowBackground" Value="{u:BTSColor MarketData.driver_background}" />
|
||||
<Setter Property="AutoGenerateColumns" Value="False" />
|
||||
<Setter Property="CanUserReorderColumns" Value="False" />
|
||||
<Setter Property="CanUserResizeRows" Value="False" />
|
||||
<Setter Property="CanUserSortColumns" Value="False" />
|
||||
<Setter Property="GridLinesVisibility" Value="Vertical" />
|
||||
<Setter Property="HeadersVisibility" Value="Column" />
|
||||
<Setter Property="VerticalGridLinesBrush" Value="Gray"/>
|
||||
<Setter Property="CanUserAddRows" Value="False" />
|
||||
<Setter Property="CanUserDeleteRows" Value="False" />
|
||||
<Setter Property="CellStyle" Value="{StaticResource {x:Type DataGridCell}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="c:DataGridEx">
|
||||
<Setter Property="AlternatingRowBackground" Value="{u:BTSColor MarketData.driver_background}" />
|
||||
<Setter Property="RowBackground" Value="{u:BTSColor Grid.input_cell_background}" />
|
||||
<Setter Property="AutoGenerateColumns" Value="False" />
|
||||
<Setter Property="CanUserReorderColumns" Value="False" />
|
||||
<Setter Property="CanUserResizeRows" Value="False" />
|
||||
<Setter Property="RowHeaderWidth" Value="0" />
|
||||
<Setter Property="CanUserSortColumns" Value="False" />
|
||||
<Setter Property="GridLinesVisibility" Value="None" />
|
||||
<Setter Property="CanUserAddRows" Value="False" />
|
||||
<Setter Property="CanUserDeleteRows" Value="False" />
|
||||
<Setter Property="c:DataGridEx.UpdateBindingSourceByCell" Value="true" />
|
||||
<Setter Property="SelectionUnit" Value="Cell" />
|
||||
<Setter Property="ClipboardCopyMode" Value="IncludeHeader" />
|
||||
<Setter Property="ColumnHeaderStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="{u:BTSColor Name=header}"/>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor Name=header_text}"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="0,1,1,0"/>
|
||||
<Setter Property="Padding" Value="3"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="SuperHeaderStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="Background" Value="{u:BTSColor Name=header}"/>
|
||||
<Setter Property="Foreground" Value="{u:BTSColor Name=header_text}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="0,0,1,0"/>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user