Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbb4dd6e1f | ||
|
|
f977b0fdd0 | ||
|
|
a3968bd35b | ||
|
|
2b94a29963 | ||
|
|
4b8abc2005 | ||
|
|
2627264eea | ||
|
|
2c7186275f | ||
|
|
a4d8cd9dfc | ||
|
|
ed4be2f1dd | ||
|
|
cd6d504f06 | ||
|
|
e68d37f24d |
No files matched your search
@@ -30,6 +30,9 @@
|
||||
<Setter
|
||||
Property="FontStyle"
|
||||
Value="Italic" />
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="Gray" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -48,6 +51,9 @@
|
||||
<Setter
|
||||
Property="FontStyle"
|
||||
Value="Italic" />
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="Gray" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -117,20 +123,6 @@
|
||||
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>
|
||||
@@ -155,37 +147,24 @@
|
||||
Margin="5,2,2,2"
|
||||
TextBlock.Foreground="Black"
|
||||
HeaderContent="Symbols"
|
||||
ShowSelectAll="True">
|
||||
<c:ComboCheckBox.HeaderContentTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Foreground="{u:BTSColor UI.default_text}" />
|
||||
</DataTemplate>
|
||||
</c:ComboCheckBox.HeaderContentTemplate>
|
||||
</c:ComboCheckBox>
|
||||
ShowSelectAll="True"
|
||||
/>
|
||||
|
||||
<WrapPanel>
|
||||
<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}" />
|
||||
<TextBlock Margin="5,5,0,0" Text="Auto copy rolls:" />
|
||||
<CheckBox Margin="5,5,10,0" IsChecked="{Binding auto_copy_rolls_is_checked}" />
|
||||
</WrapPanel>
|
||||
<WrapPanel>
|
||||
<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}" />
|
||||
<TextBlock Margin='0,5,0,0' Text="Auto copy rates:" />
|
||||
<CheckBox Margin="5,5,0,0" IsChecked="{Binding auto_copy_rates_is_checked}" />
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
<c:DataGridEx
|
||||
x:Name="_grid"
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding visible_rows}"
|
||||
Background="Transparent"
|
||||
VerticalGridLinesBrush="{u:BTSColor Grid.grid_line}"
|
||||
AlternatingRowBackground="{u:BTSColor MarketData.driver_background}"
|
||||
VerticalGridLinesBrush="Gray"
|
||||
EnableRowVirtualization="True"
|
||||
EnableColumnVirtualization="True"
|
||||
CanUserAddRows="False"
|
||||
@@ -198,10 +177,35 @@
|
||||
SelectionUnit="FullRow"
|
||||
SelectedUnits="{Binding selected_rows}"
|
||||
PreviewMouseRightButtonUp="_grid_PreviewMouseRightButtonUp">
|
||||
<c:DataGridEx.RowStyle>
|
||||
<Style TargetType="DataGridRow" BasedOn="{StaticResource {x:Type DataGridRow}}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected, Mode=TwoWay}"/>
|
||||
<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">
|
||||
<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">
|
||||
@@ -214,7 +218,7 @@
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</c:DataGridEx.RowStyle>
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter
|
||||
@@ -226,6 +230,9 @@
|
||||
<Setter
|
||||
Property="HorizontalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter
|
||||
Property="BorderThickness"
|
||||
Value="0,0,1,0" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Black" />
|
||||
@@ -252,6 +259,9 @@
|
||||
<Setter
|
||||
Property="Foreground"
|
||||
Value="{u:BTSColor Name=header_text}" />
|
||||
<Setter
|
||||
Property="BorderThickness"
|
||||
Value="0" />
|
||||
<Setter
|
||||
Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
@@ -298,7 +308,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_driver_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="{u:BTSColor UI.input_dirty_border}" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -306,10 +318,11 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<ComboBox
|
||||
IsSynchronizedWithCurrentItem="False"
|
||||
ItemsSource="{Binding Source={StaticResource Drivers}}"
|
||||
ItemTemplate="{StaticResource DriverTemplate}"
|
||||
SelectedItem="{Binding driver, UpdateSourceTrigger=PropertyChanged}"
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
Margin="2" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -327,28 +340,21 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_deliverable_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</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}"
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
Margin="2" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -366,28 +372,21 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_roll_schedule_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</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}"
|
||||
Style="{StaticResource ComboBoxCellElement}" />
|
||||
Margin="2" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -403,7 +402,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_roll_target_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -414,16 +415,14 @@
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource RollTargetContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
ContextMenu="{StaticResource RollTargetContextMenu}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
Margin="2"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
Text="{Binding roll_target, Converter={StaticResource DoubleTextConverter}}"
|
||||
Margin="2" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -439,7 +438,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_riskless_rate_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -450,15 +451,12 @@
|
||||
Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource RisklessRateContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
ContextMenu="{StaticResource RisklessRateContextMenu}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBox Text="{Binding riskless_rate, Converter={StaticResource RisklessRateConverter}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -474,7 +472,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_settlement_price_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -485,15 +485,12 @@
|
||||
Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource SettlementPriceContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
ContextMenu="{StaticResource SettlementPriceContextMenu}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBox Text="{Binding settlement_price, Converter={StaticResource DoubleTextConverter}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -510,7 +507,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_delta_beta_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -521,15 +520,12 @@
|
||||
Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource DeltaBetaContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
ContextMenu="{StaticResource DeltaBetaContextMenu}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBox Text="{Binding delta_beta, Converter={StaticResource DoubleTextConverter}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
@@ -546,7 +542,9 @@
|
||||
<DataTrigger
|
||||
Binding="{Binding is_vega_beta_dirty}"
|
||||
Value="True">
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.input_dirty_foreground}" />
|
||||
<Setter
|
||||
Property="BorderBrush"
|
||||
Value="Red" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -554,18 +552,15 @@
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource VegaBetaContextMenu}"
|
||||
Style="{StaticResource TextBlockCellElement}" />
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="2,0,2,0"
|
||||
ContextMenu="{StaticResource VegaBetaContextMenu}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
<DataGridTemplateColumn.CellEditingTemplate>
|
||||
<DataTemplate>
|
||||
<TextBox
|
||||
Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBox Text="{Binding vega_beta, Converter={StaticResource DoubleTextConverter}}" />
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellEditingTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
|
||||
@@ -51,10 +51,6 @@ 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,9 +46,7 @@ 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;
|
||||
@@ -60,9 +58,7 @@ 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 = BTSColors.VolSurfaceGrid.readonly_column_foreground
|
||||
Foreground = Brushes.Blue,
|
||||
};
|
||||
view.SetBinding(FrameworkElement.DataContextProperty, new Binding() {
|
||||
Converter = _data_context_converter
|
||||
|
||||
@@ -77,8 +77,8 @@
|
||||
public IRaiseCanExecuteChangedCommand vol_shift { get; }
|
||||
|
||||
IEnumerable<IRaiseCanExecuteChangedCommand> _commands =>
|
||||
ReflectionHelper.property_getters<VolSurfaceMacroActionsVM, IRaiseCanExecuteChangedCommand>()
|
||||
.Select(pg => pg.get(this));
|
||||
ReflectionHelper.property_delegates_of_type<VolSurfaceMacroActionsVM, IRaiseCanExecuteChangedCommand>()
|
||||
.Select(g => g(this));
|
||||
|
||||
public void selection_changed(IEnumerable<VolSurfaceDisplayGridExpiration> selected) {
|
||||
_selected_exps = selected.ToList();
|
||||
|
||||
@@ -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(BTSColors.UI.icon_foreground, 3));
|
||||
ArrowGeometryKey, null, new(Brushes.Black, 3));
|
||||
public static ImageSource DownArrow => create_icon(
|
||||
ArrowGeometryKey, null, new(BTSColors.UI.icon_foreground, 3), new RotateTransform(90, 0.5, 0.5));
|
||||
ArrowGeometryKey, null, new(Brushes.Black, 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(BTSColors.UI.default_text, 3).frozen();
|
||||
static Pen _default_chevron_pen { get; } = new Pen(Brushes.Black, 3).frozen();
|
||||
|
||||
public static ImageSource create_icon(string geometric_path_key) =>
|
||||
create_icon(geometric_path_key, BTSColors.UI.icon_foreground);
|
||||
create_icon(geometric_path_key, Brushes.Black);
|
||||
|
||||
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="{mbts:BTSColor UI.icon_foreground}" />
|
||||
<Pen Thickness="3" Brush="Black" />
|
||||
</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="{mbts:BTSColor UI.icon_foreground}" />
|
||||
<Pen Thickness="1" Brush="Black" />
|
||||
</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="{mbts:BTSColor UI.icon_foreground}" Geometry="
|
||||
<GeometryDrawing Brush="Black" 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="{mbts:BTSColor UI.icon_foreground}" />
|
||||
<Pen Thickness="1" Brush="Black" />
|
||||
</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="{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 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>
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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"/>
|
||||
<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"/>
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{mbts:BTSColor UI.icon_foreground}"
|
||||
<GeometryDrawing Brush="Black"
|
||||
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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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" />
|
||||
<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" />
|
||||
</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="{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"/>
|
||||
<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"/>
|
||||
</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="{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"/>
|
||||
<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"/>
|
||||
</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="{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"/>
|
||||
<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"/>
|
||||
</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="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
<Pen Thickness="2" Brush="Black"/>
|
||||
</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="{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
|
||||
<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
|
||||
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="{mbts:BTSColor UI.icon_foreground}" Thickness="2"/>
|
||||
<Pen Brush="Black" 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="{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"/>
|
||||
<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"/>
|
||||
</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="{mbts:BTSColor UI.icon_foreground}" Thickness="3"/>
|
||||
<Pen Brush="Black" 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="{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"/>
|
||||
<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"/>
|
||||
</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="{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"/>
|
||||
<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"/>
|
||||
</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="{mbts:BTSColor UI.icon_foreground}" Thickness="1" />
|
||||
<Pen Brush="Black" 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="{mbts:BTSColor UI.icon_foreground}"
|
||||
<GeometryDrawing Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
<GeometryDrawing Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
<GeometryDrawing Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
<Pen Thickness="3" Brush="Black"/>
|
||||
</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="{mbts:BTSColor UI.icon_foreground}"/>
|
||||
<Pen Thickness="3" Brush="Black"/>
|
||||
</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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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="{mbts:BTSColor UI.icon_foreground}"
|
||||
Brush="Black"
|
||||
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>
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace mbts.persist {
|
||||
_instance_settings = instance_settings;
|
||||
_get = get;
|
||||
_set = set;
|
||||
hub.request_clear_instance_settings += () => instance_settings = null;
|
||||
}
|
||||
|
||||
public T instance_settings {
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace mbts.spark {
|
||||
using bts.shell.orderbook;
|
||||
using bts.shell.pnl;
|
||||
using bts.shell.time_and_sales;
|
||||
using bts.utils;
|
||||
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
@@ -75,6 +76,11 @@ namespace mbts.spark {
|
||||
[ProtoMember(13)]
|
||||
GlobalAlertSettings? _alerts;
|
||||
|
||||
/// Actual settings may deviate from those of the theme <see cref="_last_picked_theme"/>, as
|
||||
/// the user is free to change specific properties after selecting a theme.
|
||||
[ProtoMember(15)]
|
||||
string? _last_picked_theme;
|
||||
|
||||
public UserSettings() { }
|
||||
|
||||
public LadderSettings ladder =>
|
||||
@@ -116,6 +122,8 @@ namespace mbts.spark {
|
||||
public GlobalAlertSettings alerts =>
|
||||
_alerts ??= new GlobalAlertSettings();
|
||||
|
||||
public string? last_picked_theme => _last_picked_theme;
|
||||
|
||||
public UserSettings with(
|
||||
LadderSettings? ladder = null,
|
||||
LadderSettingsProfile[]? ladder_profiles = null,
|
||||
@@ -127,7 +135,8 @@ namespace mbts.spark {
|
||||
GridSettings? reconcile_report = null,
|
||||
PNLSettings? pnl = null,
|
||||
OrderBookGridSettings? order_book_grid = null,
|
||||
GlobalAlertSettings? alerts = null) {
|
||||
GlobalAlertSettings? alerts = null,
|
||||
Optional<string?> last_picked_theme = default) {
|
||||
var us = new UserSettings() {
|
||||
_ladder_profiles = ladder_profiles ?? _ladder_profiles,
|
||||
_ladder = ladder ?? _ladder,
|
||||
@@ -139,7 +148,8 @@ namespace mbts.spark {
|
||||
_reconcile_report = reconcile_report ?? _reconcile_report,
|
||||
_pnl = pnl ?? _pnl,
|
||||
_order_book = order_book_grid ?? _order_book,
|
||||
_alerts = alerts ?? _alerts
|
||||
_alerts = alerts ?? _alerts,
|
||||
_last_picked_theme = last_picked_theme.or(_last_picked_theme)
|
||||
};
|
||||
us._last_ladder_profile_id = Math.Max(_last_ladder_profile_id, us.ladder_profiles.Select(p => p.id).MaxOrDefault());
|
||||
return us;
|
||||
|
||||
@@ -6,12 +6,15 @@ using bts.utils;
|
||||
using mbts.spark;
|
||||
using mbts.ui.settings;
|
||||
|
||||
using Spark.Settings;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.persist {
|
||||
@@ -35,14 +38,18 @@ namespace mbts.persist {
|
||||
|
||||
readonly object _default_settings_lock = new object();
|
||||
readonly BehaviorSubject<UserSettings> _default_settings_subject = new BehaviorSubject<UserSettings>(UserSettings.factory_defaults);
|
||||
// A 'settings theme' is activated by updating the default settings object, and clearing all
|
||||
// 'instance' settings so existing windows adopt the new theme (i.e., the new 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;
|
||||
readonly Dictionary<string, UserSettingsTheme> _themes;
|
||||
|
||||
UserSettings _default_settings;
|
||||
IDisposable _theme_op = null;
|
||||
|
||||
[ImportingConstructor]
|
||||
public UserSettingsHub(
|
||||
@@ -52,7 +59,8 @@ namespace mbts.persist {
|
||||
[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) {
|
||||
[ImportMany] IEnumerable<IReconcileReportMigrationRule> reconcile_report_migration_rules,
|
||||
[ImportMany] IEnumerable<UserSettingsTheme> themes) {
|
||||
//
|
||||
_persist = persist;
|
||||
_fills_migration_rules = fills_migration_rules ?? Enumerable.Empty<IFillsGridSettingsMigrationRule>();
|
||||
@@ -60,6 +68,7 @@ namespace mbts.persist {
|
||||
_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();
|
||||
_themes = themes.ToDictionaryCrushed(t => t.name);
|
||||
init();
|
||||
async void init() {
|
||||
UserSettings s;
|
||||
@@ -107,9 +116,26 @@ namespace mbts.persist {
|
||||
}
|
||||
}
|
||||
|
||||
public event Action request_clear_instance_settings {
|
||||
add {
|
||||
lock (_default_settings_lock) {
|
||||
_request_clear_instance_settings += value;
|
||||
}
|
||||
}
|
||||
remove {
|
||||
lock (_default_settings_lock) {
|
||||
_request_clear_instance_settings -= value;
|
||||
}
|
||||
}
|
||||
}
|
||||
event Action _request_clear_instance_settings;
|
||||
|
||||
// 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; }
|
||||
|
||||
public IEnumerable<UserSettingsTheme> themes =>
|
||||
_themes.Values;
|
||||
|
||||
internal UserSettings current {
|
||||
get {
|
||||
lock (_default_settings_lock)
|
||||
@@ -152,18 +178,41 @@ namespace mbts.persist {
|
||||
_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
|
||||
public async Task save_default(UserSettings value, bool clear_instance_settings = false) {
|
||||
// * Notify observers before persisting so the changes are reflected immediately in the ui.
|
||||
// * If instance settings are to be cleared, don't clear them until the new defaults are
|
||||
// ready. We want to avoid the case where windows w/ instance settings consume cpu
|
||||
// loading the original defaults, just to load the new defaults immediately after that.
|
||||
lock (_default_settings_lock) {
|
||||
Disposable.dispose(ref _theme_op);
|
||||
if (clear_instance_settings) {
|
||||
clear_instance_async().ignore();
|
||||
}
|
||||
_default_settings_subject.OnNext(_default_settings = value);
|
||||
}
|
||||
await _persist_async();
|
||||
|
||||
async Task clear_instance_async() {
|
||||
var cts = new CancellationTokenSource();
|
||||
_theme_op = Disposable.Create(() => cts.Cancel());
|
||||
var next = await _default_settings_subject.Skip(1).FirstOrDefaultAsync();
|
||||
if (!cts.IsCancellationRequested) {
|
||||
_request_clear_instance_settings?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
var wsm = new WindowSettingsManager<T>(this, instance_settings, propi.get, propi.set);
|
||||
lock (_default_settings_lock) {
|
||||
request_clear_instance_settings += clear_instance_settings;
|
||||
}
|
||||
return wsm;
|
||||
void clear_instance_settings() {
|
||||
wsm.instance_settings = null;
|
||||
}
|
||||
}
|
||||
|
||||
async Task _persist_async() {
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#nullable enable
|
||||
namespace Spark.Settings {
|
||||
using mbts.spark;
|
||||
|
||||
using System.Composition;
|
||||
|
||||
class UserSettingsTheme {
|
||||
public UserSettingsTheme() {
|
||||
name = string.Empty;
|
||||
value = new();
|
||||
}
|
||||
|
||||
public UserSettingsTheme(string name, UserSettings value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public string name { get; }
|
||||
public UserSettings value { get; }
|
||||
}
|
||||
|
||||
class ExportedThemes {
|
||||
[Export]
|
||||
public UserSettingsTheme light_theme =>
|
||||
new("Light", UserSettings.factory_defaults);
|
||||
|
||||
[Export]
|
||||
public UserSettingsTheme dark_theme =>
|
||||
new("Dark", UserSettings.factory_defaults.with(
|
||||
market_view: bts.shell.market_view.MarketViewSettings.dark_theme_grid_settings,
|
||||
time_and_sales: bts.shell.time_and_sales.TimeAndSalesSettings.dark_theme_grid_settings,
|
||||
fills: bts.shell.fills.FillsSettings.dark_theme_grid_settings,
|
||||
synthetic_management: bts.shell.SyntheticManagementSettings.dark_theme_grid_settings,
|
||||
ladder: LadderSettings.dark_theme));
|
||||
}
|
||||
}
|
||||
+25
-25
@@ -1,25 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace bts.api.orderman {
|
||||
public readonly struct FillSecurity : IEquatable<FillSecurity> {
|
||||
public FillSecurity(SecurityImmutable? sec, FillImmutable fill) {
|
||||
this.sec = sec;
|
||||
this.fill = fill;
|
||||
}
|
||||
public FillSecurity((SecurityImmutable? sec, FillImmutable fill) t) {
|
||||
sec = t.sec;
|
||||
fill = t.fill;
|
||||
}
|
||||
public static implicit operator FillSecurity(ValueTuple<SecurityImmutable?, FillImmutable> x) => new FillSecurity(x);
|
||||
public SecurityImmutable? sec { get; }
|
||||
public FillImmutable fill { get; }
|
||||
|
||||
public override bool Equals(object obj) => (obj is FillSecurity os) && Equals(os);
|
||||
public bool Equals(FillSecurity other) => fill.FillKey == other.fill.FillKey && sec == other.sec;
|
||||
public override int GetHashCode() => (sec, fill).GetHashCode();
|
||||
|
||||
public static bool operator ==(FillSecurity left, FillSecurity right) => left.Equals(right);
|
||||
public static bool operator !=(FillSecurity left, FillSecurity right) => !left.Equals(right);
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace bts.api.orderman {
|
||||
public readonly struct FillSecurity : IEquatable<FillSecurity> {
|
||||
public FillSecurity(SecurityImmutable? sec, FillImmutable fill) {
|
||||
this.sec = sec;
|
||||
this.fill = fill;
|
||||
}
|
||||
public FillSecurity((SecurityImmutable? sec, FillImmutable fill) t) {
|
||||
sec = t.sec;
|
||||
fill = t.fill;
|
||||
}
|
||||
public static implicit operator FillSecurity(ValueTuple<SecurityImmutable?, FillImmutable> x) => new FillSecurity(x);
|
||||
public SecurityImmutable? sec { get; }
|
||||
public FillImmutable fill { get; }
|
||||
|
||||
public override bool Equals(object obj) => (obj is FillSecurity os) && Equals(os);
|
||||
public bool Equals(FillSecurity other) => fill.FillKey == other.fill.FillKey && sec == other.sec;
|
||||
public override int GetHashCode() => (sec, fill).GetHashCode();
|
||||
|
||||
public static bool operator ==(FillSecurity left, FillSecurity right) => left.Equals(right);
|
||||
public static bool operator !=(FillSecurity left, FillSecurity right) => !left.Equals(right);
|
||||
|
||||
}
|
||||
}
|
||||
+101
-101
@@ -1,101 +1,101 @@
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.utils;
|
||||
|
||||
using System;
|
||||
|
||||
using static bts.api.orderman.Fill.Types;
|
||||
|
||||
namespace mbts.spark {
|
||||
class FillTuple : IEquatable<FillTuple> {
|
||||
public static readonly Func<FillTuple, string> key_fn = ft => ft.fill.FillKey;
|
||||
public readonly FillImmutable fill;
|
||||
public readonly SecurityImmutable? security;
|
||||
|
||||
OrderSecurityRootPair? _order_tuple;
|
||||
|
||||
public FillTuple(FillImmutable fill, SecurityImmutable? security, OrderSecurityRootPair? order_tuple) {
|
||||
this.fill = fill;
|
||||
this.security = security;
|
||||
_order_tuple = order_tuple;
|
||||
}
|
||||
|
||||
public FillTuple((SecurityImmutable? sec, FillImmutable val) fill, OrderSecurity? order_tuple)
|
||||
: this(fill.val, fill.sec, order_tuple.HasValue ? OrderSecurityRootPair.from_order_security(order_tuple.Value) : (OrderSecurityRootPair?)null) { }
|
||||
|
||||
public AlgoData? algo =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.algo : (AlgoData?)null;
|
||||
|
||||
public AlgoDefinitionMetadata? algo_meta =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.meta : null;
|
||||
|
||||
public OrderRecordImmutable? order =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.order : (OrderRecordImmutable?)null;
|
||||
|
||||
public AlgoData? root_algo =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.root.algo : (AlgoData?)null;
|
||||
|
||||
public AlgoDefinitionMetadata? root_algo_meta =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.root.meta : null;
|
||||
|
||||
public OrderSecurityAlgo? root_order_security => _order_tuple?.root;
|
||||
|
||||
public AccountTuple account_tuple => new(account_id, account);
|
||||
|
||||
public string account {
|
||||
get {
|
||||
var account_string = string.Empty;
|
||||
if (fill.FillKind != FillKind.Sod && order.HasValue && order.Value.HasDef) account_string = order.Value.Def.Account;
|
||||
else account_string = fill.Account;
|
||||
return account_string == null ? string.Empty : account_string;
|
||||
}
|
||||
}
|
||||
|
||||
public uint account_id =>
|
||||
fill.FillKind != FillKind.Sod && order.HasValue ?
|
||||
order.Value.account_id() :
|
||||
fill.InternalAccountId;
|
||||
|
||||
public TimeInForce time_in_force =>
|
||||
order?.time_in_force() ?? TimeInForce.Undefined;
|
||||
|
||||
public bool Equals(FillTuple other) =>
|
||||
other != null &&
|
||||
_order_tuple.Equals(other._order_tuple) &&
|
||||
security.HasValue == other.security.HasValue &&
|
||||
fill.Equals(other.fill);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj as FillTuple);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.aggregate_hash(
|
||||
fill.FillKey.GetHashCode(),
|
||||
order.HasValue ? order.Value.Key.GetHashCode() : 0,
|
||||
security.HasValue ? security.Value.Id.GetHashCode() : 0);
|
||||
}
|
||||
|
||||
static class FillTupleExtensions {
|
||||
public static DateTime fill_time(this FillTuple fill_tuple) =>
|
||||
fill_tuple.fill.Timestamp.to_local_time();
|
||||
|
||||
public static TimeInForce time_in_force(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.time_in_force() : TimeInForce.Undefined;
|
||||
|
||||
public static CustomOrderDefinition.CustomOneofCase order_type(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.order_type() : CustomOrderDefinition.CustomOneofCase.None;
|
||||
|
||||
public static Venue exchange(this FillTuple fill_tuple) =>
|
||||
fill_tuple.security.HasValue ? fill_tuple.security.Value.Exchange : Venue.Unset;
|
||||
|
||||
public static uint order_key(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.Key : 0u;
|
||||
|
||||
public static string user(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.user() : string.Empty;
|
||||
|
||||
public static uint user_id(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order?.user_id() ?? 0;
|
||||
}
|
||||
}
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.utils;
|
||||
|
||||
using System;
|
||||
|
||||
using static bts.api.orderman.Fill.Types;
|
||||
|
||||
namespace mbts.spark {
|
||||
class FillTuple : IEquatable<FillTuple> {
|
||||
public static readonly Func<FillTuple, string> key_fn = ft => ft.fill.FillKey;
|
||||
public readonly FillImmutable fill;
|
||||
public readonly SecurityImmutable? security;
|
||||
|
||||
OrderSecurityRootPair? _order_tuple;
|
||||
|
||||
public FillTuple(FillImmutable fill, SecurityImmutable? security, OrderSecurityRootPair? order_tuple) {
|
||||
this.fill = fill;
|
||||
this.security = security;
|
||||
_order_tuple = order_tuple;
|
||||
}
|
||||
|
||||
public FillTuple((SecurityImmutable? sec, FillImmutable val) fill, OrderSecurity? order_tuple)
|
||||
: this(fill.val, fill.sec, order_tuple.HasValue ? OrderSecurityRootPair.from_order_security(order_tuple.Value) : (OrderSecurityRootPair?)null) { }
|
||||
|
||||
public AlgoData? algo =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.algo : (AlgoData?)null;
|
||||
|
||||
public AlgoDefinitionMetadata? algo_meta =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.meta : null;
|
||||
|
||||
public OrderRecordImmutable? order =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.order.order : (OrderRecordImmutable?)null;
|
||||
|
||||
public AlgoData? root_algo =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.root.algo : (AlgoData?)null;
|
||||
|
||||
public AlgoDefinitionMetadata? root_algo_meta =>
|
||||
_order_tuple.HasValue ? _order_tuple.Value.root.meta : null;
|
||||
|
||||
public OrderSecurityAlgo? root_order_security => _order_tuple?.root;
|
||||
|
||||
public AccountTuple account_tuple => new(account_id, account);
|
||||
|
||||
public string account {
|
||||
get {
|
||||
var account_string = string.Empty;
|
||||
if (fill.FillKind != FillKind.Sod && order.HasValue && order.Value.HasDef) account_string = order.Value.Def.Account;
|
||||
else account_string = fill.Account;
|
||||
return account_string == null ? string.Empty : account_string;
|
||||
}
|
||||
}
|
||||
|
||||
public uint account_id =>
|
||||
fill.FillKind != FillKind.Sod && order.HasValue ?
|
||||
order.Value.account_id() :
|
||||
fill.InternalAccountId;
|
||||
|
||||
public TimeInForce time_in_force =>
|
||||
order?.time_in_force() ?? TimeInForce.Undefined;
|
||||
|
||||
public bool Equals(FillTuple other) =>
|
||||
other != null &&
|
||||
_order_tuple.Equals(other._order_tuple) &&
|
||||
security.HasValue == other.security.HasValue &&
|
||||
fill.Equals(other.fill);
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
Equals(obj as FillTuple);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.aggregate_hash(
|
||||
fill.FillKey.GetHashCode(),
|
||||
order.HasValue ? order.Value.Key.GetHashCode() : 0,
|
||||
security.HasValue ? security.Value.Id.GetHashCode() : 0);
|
||||
}
|
||||
|
||||
static class FillTupleExtensions {
|
||||
public static DateTime fill_time(this FillTuple fill_tuple) =>
|
||||
fill_tuple.fill.Timestamp.to_local_time();
|
||||
|
||||
public static TimeInForce time_in_force(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.time_in_force() : TimeInForce.Undefined;
|
||||
|
||||
public static CustomOrderDefinition.CustomOneofCase order_type(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.order_type() : CustomOrderDefinition.CustomOneofCase.None;
|
||||
|
||||
public static Venue exchange(this FillTuple fill_tuple) =>
|
||||
fill_tuple.security.HasValue ? fill_tuple.security.Value.Exchange : Venue.Unset;
|
||||
|
||||
public static uint order_key(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.Key : 0u;
|
||||
|
||||
public static string user(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order.HasValue ? fill_tuple.order.Value.user() : string.Empty;
|
||||
|
||||
public static uint user_id(this FillTuple fill_tuple) =>
|
||||
fill_tuple.order?.user_id() ?? 0;
|
||||
}
|
||||
}
|
||||
+19
-19
@@ -1,19 +1,19 @@
|
||||
using bts.api.orderman;
|
||||
|
||||
namespace mbts.spark {
|
||||
struct NamedCustomOrderDefinition {
|
||||
public readonly string id, display_name;
|
||||
public readonly CustomOrderDefinitionImmutable definition;
|
||||
public NamedCustomOrderDefinition(CustomOrderDefinitionImmutable definition)
|
||||
: this(definition.CustomCase.type_id(), definition.CustomCase.display_name(), definition) { }
|
||||
|
||||
public NamedCustomOrderDefinition(CompositeAlgoRecordImmutable record)
|
||||
: this(record.AlgoDefinition.Algo) { }
|
||||
|
||||
public NamedCustomOrderDefinition(string id, string display_name, CustomOrderDefinitionImmutable definition) {
|
||||
this.id = id;
|
||||
this.display_name = display_name;
|
||||
this.definition = definition;
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts.api.orderman;
|
||||
|
||||
namespace mbts.spark {
|
||||
struct NamedCustomOrderDefinition {
|
||||
public readonly string id, display_name;
|
||||
public readonly CustomOrderDefinitionImmutable definition;
|
||||
public NamedCustomOrderDefinition(CustomOrderDefinitionImmutable definition)
|
||||
: this(definition.CustomCase.type_id(), definition.CustomCase.display_name(), definition) { }
|
||||
|
||||
public NamedCustomOrderDefinition(CompositeAlgoRecordImmutable record)
|
||||
: this(record.AlgoDefinition.Algo) { }
|
||||
|
||||
public NamedCustomOrderDefinition(string id, string display_name, CustomOrderDefinitionImmutable definition) {
|
||||
this.id = id;
|
||||
this.display_name = display_name;
|
||||
this.definition = definition;
|
||||
}
|
||||
}
|
||||
}
|
||||
+245
-245
@@ -1,245 +1,245 @@
|
||||
using bts.api;
|
||||
using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.shell;
|
||||
using bts.utils;
|
||||
|
||||
using mbts;
|
||||
using mbts.spark;
|
||||
using mbts.ui.controls;
|
||||
|
||||
using Spark.Core;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using OrderPair = System.ValueTuple<bts.api.SecurityImmutable?, bts.api.orderman.OrderRecordImmutable>;
|
||||
using TickDisplaySettingsImmutable = bts.api.domain.TickDisplaySettingsImmutable;
|
||||
|
||||
namespace bts.spark {
|
||||
internal class Activity {
|
||||
public SecurityImmutable? security;
|
||||
public string message;
|
||||
public ILogViewerCategory category;
|
||||
}
|
||||
|
||||
class OrderActivitySummarizer : IDisposable {
|
||||
readonly IBus _bus;
|
||||
IReadOnlyDictionary<uint, SecurityMD> _security = new Dictionary<uint, SecurityMD>();
|
||||
IDisposable _dispose;
|
||||
static readonly IEqualityComparer<OrderRecordImmutable> _id_comparer =
|
||||
bts.utils.EqualityComparer.Create<OrderRecordImmutable, uint>(a => a.Key);
|
||||
|
||||
public OrderActivitySummarizer(IBus bus, IObservable<TableUpdate<(SecurityImmutable? sec, OrderRecordImmutable order), uint>> orders) {
|
||||
_bus = bus;
|
||||
_dispose = Disposable.Create(
|
||||
bus.subscribe(SparkTags.SecuritiesTag).Subscribe(sec => _security = sec),
|
||||
orders.Subscribe(orders_updated)
|
||||
);
|
||||
}
|
||||
|
||||
public void Dispose() => Disposable.dispose(ref _dispose);
|
||||
|
||||
#region formatting
|
||||
|
||||
SecurityImmutable? try_get_security(uint security_key) {
|
||||
if (_security.TryGetValue(security_key, out SecurityMD md)) {
|
||||
return md.security;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static string format_order_success(
|
||||
uint key, double price, double size, Side side, ContractSpecificationImmutable? spec) =>
|
||||
$"({key}) {side.ToString().ToLower()} {size} @ {spec.format(price)}";
|
||||
|
||||
string format_order_fail(
|
||||
double price,
|
||||
double size,
|
||||
Side side,
|
||||
ContractSpecificationImmutable? spec,
|
||||
string error) =>
|
||||
$"Failed to {side.ToString().ToLower()} {size} @ {spec.format(price)}. {error}";
|
||||
|
||||
string format_cancel_success(OrderRecordImmutable order, ContractSpecificationImmutable? spec) {
|
||||
return $"({order.Key}) Canceled {order.short_description(spec)}, was working {order.working_quantity()}";
|
||||
}
|
||||
string format_cancel_error(OrderRecordImmutable order, ContractSpecificationImmutable? spec, string error) {
|
||||
return $"({order.Key}) Failed to cancel {order.short_description(spec)}: {error}";
|
||||
}
|
||||
public static string format_fill_summary(OrderRecordImmutable before, OrderRecordImmutable after) =>
|
||||
_format_fill_summary(_header(after.Key), before, after);
|
||||
|
||||
public static string format_fill_summary(OrderRecordImmutable before, OrderRecordImmutable after, SecurityImmutable? security) =>
|
||||
_format_fill_summary(_header(after.Key, security), before, after);
|
||||
|
||||
public static string format_status_change(uint key, OrderStatus old_status, OrderStatus new_status) =>
|
||||
_format_status_change(_header(key), key, old_status, new_status);
|
||||
|
||||
public static string format_status_change(uint key, OrderStatus old_status, OrderStatus new_status, SecurityImmutable? security) =>
|
||||
_format_status_change(_header(key, security), key, old_status, new_status);
|
||||
|
||||
// since changes are naggled, transition changes aren't always detected (e.g. a new order changes before observers are notified of its existence), so old_status might be null.
|
||||
public static string format_status_change(uint key, OrderStatus? old_status, OrderStatus new_status, SecurityImmutable? security) {
|
||||
string header = _header(key, security);
|
||||
return old_status.HasValue ?
|
||||
_format_status_change(header, key, old_status.Value, new_status) :
|
||||
_format_status_change(header, key, new_status);
|
||||
}
|
||||
|
||||
public static string order_completion_debrief(
|
||||
OrderRecordImmutable order,
|
||||
SecurityImmutable? security,
|
||||
TickDisplaySettingsImmutable qty_display) =>
|
||||
_format_order_completion(
|
||||
_header(order.Key, security), order, security?.ContractSpec, qty_display);
|
||||
|
||||
public static string modified_description(OrderRecordImmutable old_order, OrderRecordImmutable new_order, ContractSpecificationImmutable? spec) {
|
||||
double old_price = old_order.State.Price, new_price = new_order.State.Price;
|
||||
uint old_size = old_order.State.Quantity, new_size = new_order.State.Quantity;
|
||||
uint old_attached_target_key = old_order.attached_target_order_key(), new_attached_target_key = new_order.attached_target_order_key();
|
||||
return StringBuilderEx.join(prefix, change_descs());
|
||||
//
|
||||
string prefix() => $"({old_order.Key}) Changed";
|
||||
IEnumerable<string> change_descs() {
|
||||
if (old_price != new_price)
|
||||
yield return $"price from {spec.format(old_price)} to {spec.format(new_price)}";
|
||||
if (old_size != new_size)
|
||||
yield return $"size from {old_size} to {new_size}, working {new_order.working_quantity()}";
|
||||
if (old_attached_target_key != new_attached_target_key)
|
||||
yield return $"attached target from {old_attached_target_key} to {new_attached_target_key}";
|
||||
}
|
||||
}
|
||||
|
||||
static string _header(uint key) => $"({key})";
|
||||
static string _header(uint key, SecurityImmutable? security) => $"({key}) {security.display_name()}";
|
||||
|
||||
static string _format_fill_summary(string header, OrderRecordImmutable before, OrderRecordImmutable after) {
|
||||
int fb = (int)before.State.FilledQuantity;
|
||||
int fa = (int)after.State.FilledQuantity;
|
||||
return $"{header} {after.Def.Side.past_tense()} {(fa - fb)} ({fa} total), still working {after.working_quantity()}";
|
||||
}
|
||||
|
||||
static string _format_status_change(string header, uint key, OrderStatus new_status) =>
|
||||
$"{header} Status changed to {new_status}";
|
||||
|
||||
static string _format_status_change(string header, uint key, OrderStatus old_status, OrderStatus new_status) =>
|
||||
$"{header} Status changed from {old_status} to {new_status}";
|
||||
|
||||
static string _format_order_completion(
|
||||
string header,
|
||||
OrderRecordImmutable order,
|
||||
ContractSpecificationImmutable? spec,
|
||||
TickDisplaySettingsImmutable qty_display) {
|
||||
var filled_qty_str = qty_display.format(order.filled_quantity());
|
||||
return $"{header} Completed: {order.side().past_tense()} {filled_qty_str}, " +
|
||||
$"@ {spec.spec_or_default().format(order.avg_price())} (avg)";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
void orders_updated(TableUpdate<(SecurityImmutable? sec, OrderRecordImmutable order), uint> update) {
|
||||
|
||||
foreach (var o in update.added) {
|
||||
if (!string.IsNullOrEmpty(o.order.State.LastMsg) && o.order.State.Created.ToDateTime().Date == DateTime.Today) {
|
||||
if (o.sec.HasValue) {
|
||||
log_status(ActivityLogCategory.warn, o.sec.Value, o.order.State.LastMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var order in update.changes) {
|
||||
var neworder = order.New.order;
|
||||
var oldorder = order.Old.order;
|
||||
var security = order.New.sec ?? order.Old.sec;
|
||||
//
|
||||
// description
|
||||
var mod_desc = modified_description(oldorder, neworder, security?.ContractSpec);
|
||||
if (!string.IsNullOrEmpty(mod_desc)) {
|
||||
log_status(ActivityLogCategory.modify, security, mod_desc);
|
||||
}
|
||||
//
|
||||
// filled quantity
|
||||
if (oldorder.State.FilledQuantity != neworder.State.FilledQuantity && !neworder.has_parent()) {
|
||||
log_status(ActivityLogCategory.fill, security, format_fill_summary(oldorder, neworder));
|
||||
}
|
||||
|
||||
//
|
||||
// status
|
||||
if (oldorder.State.Status != neworder.State.Status && !neworder.has_parent()) {
|
||||
log_status(ActivityLogCategory.modify, security,
|
||||
format_status_change(neworder.Key, oldorder.State.Status, neworder.State.Status));
|
||||
}
|
||||
|
||||
// last msg
|
||||
if (oldorder.State.LastMsg != neworder.State.LastMsg) {
|
||||
if (security.HasValue) {
|
||||
log_status(ActivityLogCategory.warn, security, neworder.State.LastMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void log_status(ILogViewerCategory category, SecurityImmutable? security, string msg) {
|
||||
_bus.post(SparkTags.LogActivity, new Activity { security = security, message = msg, category = category });
|
||||
}
|
||||
|
||||
internal void on_send_order(
|
||||
OrderDefinitionImmutable order, double price, double size, uint? key, string error) {
|
||||
var security = try_get_security(order.SecurityKey);
|
||||
log_status(ActivityLogCategory.order, security, key.HasValue ?
|
||||
format_order_success(key.Value, price, size, order.Side, security?.ContractSpec) :
|
||||
format_order_fail(price, size, order.Side, security?.ContractSpec, error));
|
||||
}
|
||||
|
||||
internal void on_cancel_order(OrderRecordImmutable order, bool success, string error) {
|
||||
var security = try_get_security(order.Def.SecurityKey);
|
||||
log_status(ActivityLogCategory.cancel, security, success ?
|
||||
format_cancel_success(order, security?.ContractSpec) :
|
||||
format_cancel_error(order, security?.ContractSpec, error));
|
||||
}
|
||||
|
||||
internal void update_order(
|
||||
OrderRecordImmutable order, double price, double size, bool algo_changed) =>
|
||||
_log_order_update(order, price, size, algo_changed, "change from");
|
||||
|
||||
internal void update_order_failed(OrderRecordImmutable order, double price, double size, bool algo_changed) =>
|
||||
_log_order_update(order, price, size, algo_changed, "failed to change from");
|
||||
|
||||
void _log_order_update(
|
||||
OrderRecordImmutable order,
|
||||
double price,
|
||||
double size,
|
||||
bool algo_changed,
|
||||
string change_desc_prefix
|
||||
) {
|
||||
if (price == order.price() && size == order.working_quantity() && !algo_changed) {
|
||||
// nothing actually changed
|
||||
return;
|
||||
}
|
||||
const string algo_change_text = "change algo parameters";
|
||||
var security = try_get_security(order.Def.SecurityKey);
|
||||
var change_descs = new List<string>(1);
|
||||
|
||||
TickDisplaySettingsImmutable? price_display =
|
||||
security.HasValue && security.Value.HasContractSpec ?
|
||||
security.Value.ContractSpec.tick_factors().to_api_tick_display_settingsi() : null;
|
||||
|
||||
var price_qty_change_desc = OrderUtils.update_description(
|
||||
order, price, size, price_display);
|
||||
|
||||
if (!price_qty_change_desc.is_null_or_empty()) {
|
||||
change_descs.Add(price_qty_change_desc);
|
||||
}
|
||||
if (algo_changed) {
|
||||
change_descs.Add(algo_change_text);
|
||||
}
|
||||
|
||||
var desc = $"({order.Key}) {change_desc_prefix} {"; ".join(change_descs)}";
|
||||
log_status(ActivityLogCategory.modify, security, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts.api;
|
||||
using bts.api.core;
|
||||
using bts.api.orderman;
|
||||
using bts.shell;
|
||||
using bts.utils;
|
||||
|
||||
using mbts;
|
||||
using mbts.spark;
|
||||
using mbts.ui.controls;
|
||||
|
||||
using Spark.Core;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using OrderPair = System.ValueTuple<bts.api.SecurityImmutable?, bts.api.orderman.OrderRecordImmutable>;
|
||||
using TickDisplaySettingsImmutable = bts.api.domain.TickDisplaySettingsImmutable;
|
||||
|
||||
namespace bts.spark {
|
||||
internal class Activity {
|
||||
public SecurityImmutable? security;
|
||||
public string message;
|
||||
public ILogViewerCategory category;
|
||||
}
|
||||
|
||||
class OrderActivitySummarizer : IDisposable {
|
||||
readonly IBus _bus;
|
||||
IReadOnlyDictionary<uint, SecurityMD> _security = new Dictionary<uint, SecurityMD>();
|
||||
IDisposable _dispose;
|
||||
static readonly IEqualityComparer<OrderRecordImmutable> _id_comparer =
|
||||
bts.utils.EqualityComparer.Create<OrderRecordImmutable, uint>(a => a.Key);
|
||||
|
||||
public OrderActivitySummarizer(IBus bus, IObservable<TableUpdate<(SecurityImmutable? sec, OrderRecordImmutable order), uint>> orders) {
|
||||
_bus = bus;
|
||||
_dispose = Disposable.Create(
|
||||
bus.subscribe(SparkTags.SecuritiesTag).Subscribe(sec => _security = sec),
|
||||
orders.Subscribe(orders_updated)
|
||||
);
|
||||
}
|
||||
|
||||
public void Dispose() => Disposable.dispose(ref _dispose);
|
||||
|
||||
#region formatting
|
||||
|
||||
SecurityImmutable? try_get_security(uint security_key) {
|
||||
if (_security.TryGetValue(security_key, out SecurityMD md)) {
|
||||
return md.security;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static string format_order_success(
|
||||
uint key, double price, double size, Side side, ContractSpecificationImmutable? spec) =>
|
||||
$"({key}) {side.ToString().ToLower()} {size} @ {spec.format(price)}";
|
||||
|
||||
string format_order_fail(
|
||||
double price,
|
||||
double size,
|
||||
Side side,
|
||||
ContractSpecificationImmutable? spec,
|
||||
string error) =>
|
||||
$"Failed to {side.ToString().ToLower()} {size} @ {spec.format(price)}. {error}";
|
||||
|
||||
string format_cancel_success(OrderRecordImmutable order, ContractSpecificationImmutable? spec) {
|
||||
return $"({order.Key}) Canceled {order.short_description(spec)}, was working {order.working_quantity()}";
|
||||
}
|
||||
string format_cancel_error(OrderRecordImmutable order, ContractSpecificationImmutable? spec, string error) {
|
||||
return $"({order.Key}) Failed to cancel {order.short_description(spec)}: {error}";
|
||||
}
|
||||
public static string format_fill_summary(OrderRecordImmutable before, OrderRecordImmutable after) =>
|
||||
_format_fill_summary(_header(after.Key), before, after);
|
||||
|
||||
public static string format_fill_summary(OrderRecordImmutable before, OrderRecordImmutable after, SecurityImmutable? security) =>
|
||||
_format_fill_summary(_header(after.Key, security), before, after);
|
||||
|
||||
public static string format_status_change(uint key, OrderStatus old_status, OrderStatus new_status) =>
|
||||
_format_status_change(_header(key), key, old_status, new_status);
|
||||
|
||||
public static string format_status_change(uint key, OrderStatus old_status, OrderStatus new_status, SecurityImmutable? security) =>
|
||||
_format_status_change(_header(key, security), key, old_status, new_status);
|
||||
|
||||
// since changes are naggled, transition changes aren't always detected (e.g. a new order changes before observers are notified of its existence), so old_status might be null.
|
||||
public static string format_status_change(uint key, OrderStatus? old_status, OrderStatus new_status, SecurityImmutable? security) {
|
||||
string header = _header(key, security);
|
||||
return old_status.HasValue ?
|
||||
_format_status_change(header, key, old_status.Value, new_status) :
|
||||
_format_status_change(header, key, new_status);
|
||||
}
|
||||
|
||||
public static string order_completion_debrief(
|
||||
OrderRecordImmutable order,
|
||||
SecurityImmutable? security,
|
||||
TickDisplaySettingsImmutable qty_display) =>
|
||||
_format_order_completion(
|
||||
_header(order.Key, security), order, security?.ContractSpec, qty_display);
|
||||
|
||||
public static string modified_description(OrderRecordImmutable old_order, OrderRecordImmutable new_order, ContractSpecificationImmutable? spec) {
|
||||
double old_price = old_order.State.Price, new_price = new_order.State.Price;
|
||||
uint old_size = old_order.State.Quantity, new_size = new_order.State.Quantity;
|
||||
uint old_attached_target_key = old_order.attached_target_order_key(), new_attached_target_key = new_order.attached_target_order_key();
|
||||
return StringBuilderEx.join(prefix, change_descs());
|
||||
//
|
||||
string prefix() => $"({old_order.Key}) Changed";
|
||||
IEnumerable<string> change_descs() {
|
||||
if (old_price != new_price)
|
||||
yield return $"price from {spec.format(old_price)} to {spec.format(new_price)}";
|
||||
if (old_size != new_size)
|
||||
yield return $"size from {old_size} to {new_size}, working {new_order.working_quantity()}";
|
||||
if (old_attached_target_key != new_attached_target_key)
|
||||
yield return $"attached target from {old_attached_target_key} to {new_attached_target_key}";
|
||||
}
|
||||
}
|
||||
|
||||
static string _header(uint key) => $"({key})";
|
||||
static string _header(uint key, SecurityImmutable? security) => $"({key}) {security.display_name()}";
|
||||
|
||||
static string _format_fill_summary(string header, OrderRecordImmutable before, OrderRecordImmutable after) {
|
||||
int fb = (int)before.State.FilledQuantity;
|
||||
int fa = (int)after.State.FilledQuantity;
|
||||
return $"{header} {after.Def.Side.past_tense()} {(fa - fb)} ({fa} total), still working {after.working_quantity()}";
|
||||
}
|
||||
|
||||
static string _format_status_change(string header, uint key, OrderStatus new_status) =>
|
||||
$"{header} Status changed to {new_status}";
|
||||
|
||||
static string _format_status_change(string header, uint key, OrderStatus old_status, OrderStatus new_status) =>
|
||||
$"{header} Status changed from {old_status} to {new_status}";
|
||||
|
||||
static string _format_order_completion(
|
||||
string header,
|
||||
OrderRecordImmutable order,
|
||||
ContractSpecificationImmutable? spec,
|
||||
TickDisplaySettingsImmutable qty_display) {
|
||||
var filled_qty_str = qty_display.format(order.filled_quantity());
|
||||
return $"{header} Completed: {order.side().past_tense()} {filled_qty_str}, " +
|
||||
$"@ {spec.spec_or_default().format(order.avg_price())} (avg)";
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
void orders_updated(TableUpdate<(SecurityImmutable? sec, OrderRecordImmutable order), uint> update) {
|
||||
|
||||
foreach (var o in update.added) {
|
||||
if (!string.IsNullOrEmpty(o.order.State.LastMsg) && o.order.State.Created.ToDateTime().Date == DateTime.Today) {
|
||||
if (o.sec.HasValue) {
|
||||
log_status(ActivityLogCategory.warn, o.sec.Value, o.order.State.LastMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var order in update.changes) {
|
||||
var neworder = order.New.order;
|
||||
var oldorder = order.Old.order;
|
||||
var security = order.New.sec ?? order.Old.sec;
|
||||
//
|
||||
// description
|
||||
var mod_desc = modified_description(oldorder, neworder, security?.ContractSpec);
|
||||
if (!string.IsNullOrEmpty(mod_desc)) {
|
||||
log_status(ActivityLogCategory.modify, security, mod_desc);
|
||||
}
|
||||
//
|
||||
// filled quantity
|
||||
if (oldorder.State.FilledQuantity != neworder.State.FilledQuantity && !neworder.has_parent()) {
|
||||
log_status(ActivityLogCategory.fill, security, format_fill_summary(oldorder, neworder));
|
||||
}
|
||||
|
||||
//
|
||||
// status
|
||||
if (oldorder.State.Status != neworder.State.Status && !neworder.has_parent()) {
|
||||
log_status(ActivityLogCategory.modify, security,
|
||||
format_status_change(neworder.Key, oldorder.State.Status, neworder.State.Status));
|
||||
}
|
||||
|
||||
// last msg
|
||||
if (oldorder.State.LastMsg != neworder.State.LastMsg) {
|
||||
if (security.HasValue) {
|
||||
log_status(ActivityLogCategory.warn, security, neworder.State.LastMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void log_status(ILogViewerCategory category, SecurityImmutable? security, string msg) {
|
||||
_bus.post(SparkTags.LogActivity, new Activity { security = security, message = msg, category = category });
|
||||
}
|
||||
|
||||
internal void on_send_order(
|
||||
OrderDefinitionImmutable order, double price, double size, uint? key, string error) {
|
||||
var security = try_get_security(order.SecurityKey);
|
||||
log_status(ActivityLogCategory.order, security, key.HasValue ?
|
||||
format_order_success(key.Value, price, size, order.Side, security?.ContractSpec) :
|
||||
format_order_fail(price, size, order.Side, security?.ContractSpec, error));
|
||||
}
|
||||
|
||||
internal void on_cancel_order(OrderRecordImmutable order, bool success, string error) {
|
||||
var security = try_get_security(order.Def.SecurityKey);
|
||||
log_status(ActivityLogCategory.cancel, security, success ?
|
||||
format_cancel_success(order, security?.ContractSpec) :
|
||||
format_cancel_error(order, security?.ContractSpec, error));
|
||||
}
|
||||
|
||||
internal void update_order(
|
||||
OrderRecordImmutable order, double price, double size, bool algo_changed) =>
|
||||
_log_order_update(order, price, size, algo_changed, "change from");
|
||||
|
||||
internal void update_order_failed(OrderRecordImmutable order, double price, double size, bool algo_changed) =>
|
||||
_log_order_update(order, price, size, algo_changed, "failed to change from");
|
||||
|
||||
void _log_order_update(
|
||||
OrderRecordImmutable order,
|
||||
double price,
|
||||
double size,
|
||||
bool algo_changed,
|
||||
string change_desc_prefix
|
||||
) {
|
||||
if (price == order.price() && size == order.working_quantity() && !algo_changed) {
|
||||
// nothing actually changed
|
||||
return;
|
||||
}
|
||||
const string algo_change_text = "change algo parameters";
|
||||
var security = try_get_security(order.Def.SecurityKey);
|
||||
var change_descs = new List<string>(1);
|
||||
|
||||
TickDisplaySettingsImmutable? price_display =
|
||||
security.HasValue && security.Value.HasContractSpec ?
|
||||
security.Value.ContractSpec.tick_factors().to_api_tick_display_settingsi() : null;
|
||||
|
||||
var price_qty_change_desc = OrderUtils.update_description(
|
||||
order, price, size, price_display);
|
||||
|
||||
if (!price_qty_change_desc.is_null_or_empty()) {
|
||||
change_descs.Add(price_qty_change_desc);
|
||||
}
|
||||
if (algo_changed) {
|
||||
change_descs.Add(algo_change_text);
|
||||
}
|
||||
|
||||
var desc = $"({order.Key}) {change_desc_prefix} {"; ".join(change_descs)}";
|
||||
log_status(ActivityLogCategory.modify, security, desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
+849
-849
File diff suppressed because it is too large.
Load diff
+34
-34
@@ -1,34 +1,34 @@
|
||||
using bts.api;
|
||||
using bts.spark;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace mbts.ui.spark {
|
||||
internal static class OrderIconFactory {
|
||||
static OrderIconFactory() {
|
||||
_bid_pen.Freeze();
|
||||
_ask_pen.Freeze();
|
||||
}
|
||||
private static readonly Pen _bid_pen = new Pen(BTSColors.MarketData.bid_brush, 4), _ask_pen = new Pen(BTSColors.MarketData.ask_brush, 4);
|
||||
private static readonly ConcurrentDictionary<uint, Brush> _algo_palette = new ConcurrentDictionary<uint, Brush>();
|
||||
|
||||
public static ImageSource Create(OrderMetadata metadata, Side side) {
|
||||
Brush brush = _algo_palette.GetOrAdd(metadata.Color, c => {
|
||||
Brush b = new SolidColorBrush(c.rgb_color());
|
||||
b.Freeze();
|
||||
return b;
|
||||
});
|
||||
var group = new DrawingGroup();
|
||||
group.Children.Add(new GeometryDrawing(brush, side == Side.Buy ? _bid_pen : _ask_pen, new RectangleGeometry(new Rect(0, 0, 40, 28), 3, 3)));
|
||||
return new DrawingImage { Drawing = group };
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts.api;
|
||||
using bts.spark;
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace mbts.ui.spark {
|
||||
internal static class OrderIconFactory {
|
||||
static OrderIconFactory() {
|
||||
_bid_pen.Freeze();
|
||||
_ask_pen.Freeze();
|
||||
}
|
||||
private static readonly Pen _bid_pen = new Pen(BTSColors.MarketData.bid_brush, 4), _ask_pen = new Pen(BTSColors.MarketData.ask_brush, 4);
|
||||
private static readonly ConcurrentDictionary<uint, Brush> _algo_palette = new ConcurrentDictionary<uint, Brush>();
|
||||
|
||||
public static ImageSource Create(OrderMetadata metadata, Side side) {
|
||||
Brush brush = _algo_palette.GetOrAdd(metadata.Color, c => {
|
||||
Brush b = new SolidColorBrush(c.rgb_color());
|
||||
b.Freeze();
|
||||
return b;
|
||||
});
|
||||
var group = new DrawingGroup();
|
||||
group.Children.Add(new GeometryDrawing(brush, side == Side.Buy ? _bid_pen : _ask_pen, new RectangleGeometry(new Rect(0, 0, 40, 28), 3, 3)));
|
||||
return new DrawingImage { Drawing = group };
|
||||
}
|
||||
}
|
||||
}
|
||||
+160
-160
@@ -1,160 +1,160 @@
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark.utilities;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace mbts.spark {
|
||||
/// <summary>
|
||||
/// Monitors selected rows, and determines whether or not they are all active-orders, with common parameters.
|
||||
/// </summary>
|
||||
class OrderParamsAggregator {
|
||||
readonly TimeSpan _throttle;
|
||||
readonly CommonValueGroupMonitor<CustomOrderDefinitionImmutable, CustomOrderDefinitionImmutable> _algo_def_mon =
|
||||
new CommonValueGroupMonitor<CustomOrderDefinitionImmutable, CustomOrderDefinitionImmutable>(
|
||||
ask => ask,
|
||||
OrderDataHelper.EqualsHelpers.custom_order_defi_structure_comparer,
|
||||
OrderDataHelper.EqualsHelpers.custom_order_defi_comparer);
|
||||
readonly CommonValueMonitor<SecurityImmutable?> _spreader_security_mon = new CommonValueMonitor<SecurityImmutable?>();
|
||||
readonly CommonValueMonitor<SecurityImmutable?> _security_mon = new CommonValueMonitor<SecurityImmutable?>();
|
||||
readonly CommonValueMonitor<double> _price_mon = new CommonValueMonitor<double>(double.NaN);
|
||||
readonly CommonValueMonitor<double> _size_mon = new();
|
||||
readonly CommonValueMonitor<AccountTuple> _account_mon = new CommonValueMonitor<AccountTuple>();
|
||||
readonly CommonValueMonitor<bool> _all_active_mon = new CommonValueMonitor<bool>();
|
||||
readonly CommonValueMonitorMultiplexor<OrderSecurityAlgo> _group_mon = new CommonValueMonitorMultiplexor<OrderSecurityAlgo>();
|
||||
readonly DynamicOrderHelper _dyn_helper;
|
||||
readonly Func<uint, OrderSecurityAlgo?> _lookup_order;
|
||||
|
||||
public OrderParamsAggregator(DynamicOrderHelper dyn_helper, TimeSpan throttle, Func<uint, OrderSecurityAlgo?> lookup_order) {
|
||||
_dyn_helper = dyn_helper;
|
||||
_throttle = throttle;
|
||||
_lookup_order = lookup_order;
|
||||
_group_mon.add_member_mon(_algo_def_mon, _build_algo_tree);
|
||||
_group_mon.add_member_mon(_spreader_security_mon, _get_spreader_sec, s => s.HasValue);
|
||||
_group_mon.add_member_mon(_security_mon, osam => osam.security, s => s.HasValue);
|
||||
_group_mon.add_member_mon(_price_mon, osam => osam.order.price());
|
||||
_group_mon.add_member_mon(_size_mon, osam => osam.order.quantity());
|
||||
_group_mon.add_member_mon(_account_mon, osam => new AccountTuple(osam.order.account_id(), osam.order.account()));
|
||||
_group_mon.add_member_mon(_all_active_mon, osam => osam.order.is_active());
|
||||
}
|
||||
|
||||
public SecurityImmutable? security => _security_mon.common_value;
|
||||
public SecurityImmutable? spreader_security => _spreader_security_mon.common_value;
|
||||
public double price => _price_mon.try_get_common_value(out double p) ? p : double.NaN;
|
||||
public double? size => _size_mon.common_value_nullable();
|
||||
public AccountTuple? account => _account_mon.common_value_nullable();
|
||||
public bool all_active => _all_active_mon.common_value;
|
||||
|
||||
/// <summary>
|
||||
/// Notifies observers when the set of <see cref="CustomOrderDefinitionImmutable"/>s changes.
|
||||
/// The algos in the set are the distinct group of algos for the selected <see cref="OrderSecurityAlgo"/>s.
|
||||
/// </summary>
|
||||
// Note: this might be better optimized by adding a 'begin_reset' method to CommonValueMonitor that records the current state,
|
||||
// and accumulates subsequent changes into a batch change. If the 'begin_reset' method returned an IDisposable,
|
||||
// the batch change object could be examined when Dispose is called,
|
||||
// to avoid firing the common_values_changed event if the accumulated changes cancel each other out.
|
||||
|
||||
// However, such a change would be non-trivial, so this method will suffice for now.
|
||||
// It should perform fine in practice, even with a large number of selected orders,
|
||||
// because the input is throttled.
|
||||
public IObservable<IEnumerable<CustomOrderDefinitionImmutable>> subscribe_algos() =>
|
||||
Observable.Create<ImmutableHashSet<CustomOrderDefinitionImmutable>>(o => {
|
||||
var last_algos = ImmutableHashSet.Create(OrderDataHelper.EqualsHelpers.custom_order_defi_comparer);
|
||||
return _algo_def_mon
|
||||
.SubscribeThrottled(_throttle, (ask, vals) => vals, Array.Empty<CustomOrderDefinitionImmutable>())
|
||||
.Subscribe(algos => {
|
||||
// only notify the observer if the algo set has actually changed.
|
||||
if (algos.Count != last_algos.Count || !algos.All(last_algos.Contains))
|
||||
o.OnNext(last_algos = ImmutableHashSet.CreateRange(OrderDataHelper.EqualsHelpers.custom_order_defi_comparer, algos));
|
||||
});
|
||||
});
|
||||
public IObservable<SecurityImmutable?> subscribe_spreader_security() => _spreader_security_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<SecurityImmutable?> subscribe_security() => _security_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<double> subscribe_price() => _price_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<double?> subscribe_size() => _size_mon.SubscribeThrottledNullable(_throttle);
|
||||
public IObservable<AccountTuple?> subscribe_account() => _account_mon.SubscribeThrottledNullable(_throttle);
|
||||
public IObservable<bool> subscribe_all_active() => _all_active_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<Plurality> subscribe_security_plurality() => _security_mon.SubscribePluralityThrottled(_throttle);
|
||||
|
||||
public IDisposable defer_updates() =>
|
||||
_group_mon.defer_updates();
|
||||
|
||||
public void Add(OrderSecurityAlgo order_tuple) =>
|
||||
_group_mon.add(order_tuple);
|
||||
|
||||
public void Remove(OrderSecurityAlgo order_tuple) =>
|
||||
_group_mon.remove(order_tuple);
|
||||
|
||||
public void Clear() =>
|
||||
_group_mon.clear();
|
||||
|
||||
static SecurityImmutable? _get_spreader_sec(OrderSecurityAlgo osam) =>
|
||||
OrderDataHelper.enumerate_algo_hierarchy(osam.order.Def.CustomDef.CloneToMutable())
|
||||
.Any(algo => algo.CustomCase == CustomOrderDefinition.CustomOneofCase.Spreader) ?
|
||||
osam.security : null;
|
||||
|
||||
CustomOrderDefinitionImmutable _build_algo_tree(OrderSecurityAlgo root) =>
|
||||
root.order.Def.AttachTargetOrderKey == 0 ?
|
||||
root.order.Def.CustomDef :
|
||||
new CustomOrderDefinitionImmutable(_add_attached_targets(root.order.Def.CustomDef.CloneToMutable(), root.order.Key, root.order.Def.AttachTargetOrderKey));
|
||||
|
||||
CustomOrderDefinition _add_attached_targets(CustomOrderDefinition mroot, uint root_id, uint attached_target) {
|
||||
var lin = _lineage(root_id, attached_target);
|
||||
if (lin != null && lin.Count > 0) {
|
||||
var mparent = mroot;
|
||||
var pcad = OrderDataHelper.get_primary_child_algo_data(mparent);
|
||||
if (pcad.HasValue) {
|
||||
do {
|
||||
var mchild = lin.Pop().order.Def.CustomDef.CloneToMutable();
|
||||
pcad.Value.assign_child(mparent, mchild);
|
||||
mparent = mchild;
|
||||
pcad = OrderDataHelper.get_primary_child_algo_data(mparent);
|
||||
} while (lin.Count > 0 && pcad.HasValue);
|
||||
}
|
||||
}
|
||||
return mroot;
|
||||
}
|
||||
|
||||
Stack<OrderSecurityAlgo> _lineage(uint root, uint target) {
|
||||
// check args/preconditions
|
||||
if (root == 0) throw new ArgumentException("Cannot be zero.", nameof(root));
|
||||
if (target == 0) throw new ArgumentException("Cannot be zero.", nameof(target));
|
||||
if (target == root) return null;
|
||||
var inner = _lookup_order(target);
|
||||
if (!inner.HasValue)
|
||||
return null;
|
||||
// if 'target' has an attach target iteself (nested), push the nested lineage onto the stack first,
|
||||
// then push the original target onto the stack, and try to hop up each algo-generation
|
||||
// via parent-key lookups until we reach the root.
|
||||
// **If the lineage is disjointed, and we never reach the root, return null**
|
||||
var ival = inner.Value;
|
||||
var lin_stack = ival.order.attached_target_order_key() != 0 ?
|
||||
_lineage(ival.order.Key, ival.order.attached_target_order_key()) ?? new Stack<OrderSecurityAlgo>() :
|
||||
new Stack<OrderSecurityAlgo>();
|
||||
lin_stack.Push(ival);
|
||||
target = ival.order.ParentKey;
|
||||
while (target != root) {
|
||||
if (target == 0) {
|
||||
// **disjointed lineage**
|
||||
return null;
|
||||
}
|
||||
inner = _lookup_order(target);
|
||||
if (!inner.HasValue) {
|
||||
// **disjointed lineage**
|
||||
return null;
|
||||
}
|
||||
ival = inner.Value;
|
||||
lin_stack.Push(ival);
|
||||
target = ival.order.ParentKey;
|
||||
}
|
||||
return lin_stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark.utilities;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
namespace mbts.spark {
|
||||
/// <summary>
|
||||
/// Monitors selected rows, and determines whether or not they are all active-orders, with common parameters.
|
||||
/// </summary>
|
||||
class OrderParamsAggregator {
|
||||
readonly TimeSpan _throttle;
|
||||
readonly CommonValueGroupMonitor<CustomOrderDefinitionImmutable, CustomOrderDefinitionImmutable> _algo_def_mon =
|
||||
new CommonValueGroupMonitor<CustomOrderDefinitionImmutable, CustomOrderDefinitionImmutable>(
|
||||
ask => ask,
|
||||
OrderDataHelper.EqualsHelpers.custom_order_defi_structure_comparer,
|
||||
OrderDataHelper.EqualsHelpers.custom_order_defi_comparer);
|
||||
readonly CommonValueMonitor<SecurityImmutable?> _spreader_security_mon = new CommonValueMonitor<SecurityImmutable?>();
|
||||
readonly CommonValueMonitor<SecurityImmutable?> _security_mon = new CommonValueMonitor<SecurityImmutable?>();
|
||||
readonly CommonValueMonitor<double> _price_mon = new CommonValueMonitor<double>(double.NaN);
|
||||
readonly CommonValueMonitor<double> _size_mon = new();
|
||||
readonly CommonValueMonitor<AccountTuple> _account_mon = new CommonValueMonitor<AccountTuple>();
|
||||
readonly CommonValueMonitor<bool> _all_active_mon = new CommonValueMonitor<bool>();
|
||||
readonly CommonValueMonitorMultiplexor<OrderSecurityAlgo> _group_mon = new CommonValueMonitorMultiplexor<OrderSecurityAlgo>();
|
||||
readonly DynamicOrderHelper _dyn_helper;
|
||||
readonly Func<uint, OrderSecurityAlgo?> _lookup_order;
|
||||
|
||||
public OrderParamsAggregator(DynamicOrderHelper dyn_helper, TimeSpan throttle, Func<uint, OrderSecurityAlgo?> lookup_order) {
|
||||
_dyn_helper = dyn_helper;
|
||||
_throttle = throttle;
|
||||
_lookup_order = lookup_order;
|
||||
_group_mon.add_member_mon(_algo_def_mon, _build_algo_tree);
|
||||
_group_mon.add_member_mon(_spreader_security_mon, _get_spreader_sec, s => s.HasValue);
|
||||
_group_mon.add_member_mon(_security_mon, osam => osam.security, s => s.HasValue);
|
||||
_group_mon.add_member_mon(_price_mon, osam => osam.order.price());
|
||||
_group_mon.add_member_mon(_size_mon, osam => osam.order.quantity());
|
||||
_group_mon.add_member_mon(_account_mon, osam => new AccountTuple(osam.order.account_id(), osam.order.account()));
|
||||
_group_mon.add_member_mon(_all_active_mon, osam => osam.order.is_active());
|
||||
}
|
||||
|
||||
public SecurityImmutable? security => _security_mon.common_value;
|
||||
public SecurityImmutable? spreader_security => _spreader_security_mon.common_value;
|
||||
public double price => _price_mon.try_get_common_value(out double p) ? p : double.NaN;
|
||||
public double? size => _size_mon.common_value_nullable();
|
||||
public AccountTuple? account => _account_mon.common_value_nullable();
|
||||
public bool all_active => _all_active_mon.common_value;
|
||||
|
||||
/// <summary>
|
||||
/// Notifies observers when the set of <see cref="CustomOrderDefinitionImmutable"/>s changes.
|
||||
/// The algos in the set are the distinct group of algos for the selected <see cref="OrderSecurityAlgo"/>s.
|
||||
/// </summary>
|
||||
// Note: this might be better optimized by adding a 'begin_reset' method to CommonValueMonitor that records the current state,
|
||||
// and accumulates subsequent changes into a batch change. If the 'begin_reset' method returned an IDisposable,
|
||||
// the batch change object could be examined when Dispose is called,
|
||||
// to avoid firing the common_values_changed event if the accumulated changes cancel each other out.
|
||||
|
||||
// However, such a change would be non-trivial, so this method will suffice for now.
|
||||
// It should perform fine in practice, even with a large number of selected orders,
|
||||
// because the input is throttled.
|
||||
public IObservable<IEnumerable<CustomOrderDefinitionImmutable>> subscribe_algos() =>
|
||||
Observable.Create<ImmutableHashSet<CustomOrderDefinitionImmutable>>(o => {
|
||||
var last_algos = ImmutableHashSet.Create(OrderDataHelper.EqualsHelpers.custom_order_defi_comparer);
|
||||
return _algo_def_mon
|
||||
.SubscribeThrottled(_throttle, (ask, vals) => vals, Array.Empty<CustomOrderDefinitionImmutable>())
|
||||
.Subscribe(algos => {
|
||||
// only notify the observer if the algo set has actually changed.
|
||||
if (algos.Count != last_algos.Count || !algos.All(last_algos.Contains))
|
||||
o.OnNext(last_algos = ImmutableHashSet.CreateRange(OrderDataHelper.EqualsHelpers.custom_order_defi_comparer, algos));
|
||||
});
|
||||
});
|
||||
public IObservable<SecurityImmutable?> subscribe_spreader_security() => _spreader_security_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<SecurityImmutable?> subscribe_security() => _security_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<double> subscribe_price() => _price_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<double?> subscribe_size() => _size_mon.SubscribeThrottledNullable(_throttle);
|
||||
public IObservable<AccountTuple?> subscribe_account() => _account_mon.SubscribeThrottledNullable(_throttle);
|
||||
public IObservable<bool> subscribe_all_active() => _all_active_mon.SubscribeThrottled(_throttle);
|
||||
public IObservable<Plurality> subscribe_security_plurality() => _security_mon.SubscribePluralityThrottled(_throttle);
|
||||
|
||||
public IDisposable defer_updates() =>
|
||||
_group_mon.defer_updates();
|
||||
|
||||
public void Add(OrderSecurityAlgo order_tuple) =>
|
||||
_group_mon.add(order_tuple);
|
||||
|
||||
public void Remove(OrderSecurityAlgo order_tuple) =>
|
||||
_group_mon.remove(order_tuple);
|
||||
|
||||
public void Clear() =>
|
||||
_group_mon.clear();
|
||||
|
||||
static SecurityImmutable? _get_spreader_sec(OrderSecurityAlgo osam) =>
|
||||
OrderDataHelper.enumerate_algo_hierarchy(osam.order.Def.CustomDef.CloneToMutable())
|
||||
.Any(algo => algo.CustomCase == CustomOrderDefinition.CustomOneofCase.Spreader) ?
|
||||
osam.security : null;
|
||||
|
||||
CustomOrderDefinitionImmutable _build_algo_tree(OrderSecurityAlgo root) =>
|
||||
root.order.Def.AttachTargetOrderKey == 0 ?
|
||||
root.order.Def.CustomDef :
|
||||
new CustomOrderDefinitionImmutable(_add_attached_targets(root.order.Def.CustomDef.CloneToMutable(), root.order.Key, root.order.Def.AttachTargetOrderKey));
|
||||
|
||||
CustomOrderDefinition _add_attached_targets(CustomOrderDefinition mroot, uint root_id, uint attached_target) {
|
||||
var lin = _lineage(root_id, attached_target);
|
||||
if (lin != null && lin.Count > 0) {
|
||||
var mparent = mroot;
|
||||
var pcad = OrderDataHelper.get_primary_child_algo_data(mparent);
|
||||
if (pcad.HasValue) {
|
||||
do {
|
||||
var mchild = lin.Pop().order.Def.CustomDef.CloneToMutable();
|
||||
pcad.Value.assign_child(mparent, mchild);
|
||||
mparent = mchild;
|
||||
pcad = OrderDataHelper.get_primary_child_algo_data(mparent);
|
||||
} while (lin.Count > 0 && pcad.HasValue);
|
||||
}
|
||||
}
|
||||
return mroot;
|
||||
}
|
||||
|
||||
Stack<OrderSecurityAlgo> _lineage(uint root, uint target) {
|
||||
// check args/preconditions
|
||||
if (root == 0) throw new ArgumentException("Cannot be zero.", nameof(root));
|
||||
if (target == 0) throw new ArgumentException("Cannot be zero.", nameof(target));
|
||||
if (target == root) return null;
|
||||
var inner = _lookup_order(target);
|
||||
if (!inner.HasValue)
|
||||
return null;
|
||||
// if 'target' has an attach target iteself (nested), push the nested lineage onto the stack first,
|
||||
// then push the original target onto the stack, and try to hop up each algo-generation
|
||||
// via parent-key lookups until we reach the root.
|
||||
// **If the lineage is disjointed, and we never reach the root, return null**
|
||||
var ival = inner.Value;
|
||||
var lin_stack = ival.order.attached_target_order_key() != 0 ?
|
||||
_lineage(ival.order.Key, ival.order.attached_target_order_key()) ?? new Stack<OrderSecurityAlgo>() :
|
||||
new Stack<OrderSecurityAlgo>();
|
||||
lin_stack.Push(ival);
|
||||
target = ival.order.ParentKey;
|
||||
while (target != root) {
|
||||
if (target == 0) {
|
||||
// **disjointed lineage**
|
||||
return null;
|
||||
}
|
||||
inner = _lookup_order(target);
|
||||
if (!inner.HasValue) {
|
||||
// **disjointed lineage**
|
||||
return null;
|
||||
}
|
||||
ival = inner.Value;
|
||||
lin_stack.Push(ival);
|
||||
target = ival.order.ParentKey;
|
||||
}
|
||||
return lin_stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
+157
-157
@@ -1,157 +1,157 @@
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark;
|
||||
|
||||
using System;
|
||||
|
||||
namespace bts.api.orderman {
|
||||
readonly struct OrderSecurity : IEquatable<OrderSecurity> {
|
||||
public OrderSecurity((SecurityImmutable? sec, OrderRecordImmutable order) t) {
|
||||
security = t.sec;
|
||||
order = t.order;
|
||||
piq = null;
|
||||
algo = null;
|
||||
meta = null;
|
||||
}
|
||||
|
||||
public OrderSecurity(SecurityImmutable? sec, OrderRecordImmutable order, uint? piq) {
|
||||
this.security = sec;
|
||||
this.order = order;
|
||||
this.piq = piq;
|
||||
algo = null;
|
||||
meta = null;
|
||||
}
|
||||
|
||||
public OrderSecurity(SecurityImmutable? sec, OrderRecordImmutable order, uint? piq, AlgoData? algo, AlgoDefinitionMetadata? meta) {
|
||||
this.security = sec;
|
||||
this.order = order;
|
||||
this.piq = piq;
|
||||
this.algo = algo;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public static implicit operator OrderSecurity(ValueTuple<SecurityImmutable?, OrderRecordImmutable> x) => new OrderSecurity(x);
|
||||
public SecurityImmutable? security { get; }
|
||||
public OrderRecordImmutable order { get; }
|
||||
public uint? piq { get; }
|
||||
public AlgoData? algo { get; }
|
||||
public AlgoDefinitionMetadata? meta { get; }
|
||||
|
||||
public bool Equals(OrderSecurity other) =>
|
||||
order == other.order &&
|
||||
security == other.security &&
|
||||
piq == other.piq &&
|
||||
algo == other.algo &&
|
||||
meta == other.meta;
|
||||
|
||||
public override bool Equals(object obj) => EqualityComparer.equals_obj(this, obj);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.aggregate_hash(
|
||||
order.GetHashCode(),
|
||||
security?.GetHashCode() ?? 0,
|
||||
piq?.GetHashCode() ?? 0,
|
||||
algo?.GetHashCode() ?? 0,
|
||||
meta?.GetHashCode() ?? 0);
|
||||
|
||||
public static bool operator ==(OrderSecurity left, OrderSecurity right) => left.Equals(right);
|
||||
public static bool operator !=(OrderSecurity left, OrderSecurity right) => !left.Equals(right);
|
||||
}
|
||||
|
||||
// This is a core data type on the front end, so data validation is strict, as bad values may yield weird/difficult to track bugs.
|
||||
// Descriptive factory methods are favored over public constructors, as they are less likely to be misused.
|
||||
readonly struct OrderSecurityAlgo : IEquatable<OrderSecurityAlgo> {
|
||||
public readonly OrderRecordImmutable order;
|
||||
public readonly SecurityImmutable? security;
|
||||
public readonly AlgoData algo;
|
||||
public readonly AlgoDefinitionMetadata? meta;
|
||||
public readonly uint? piq;
|
||||
|
||||
OrderSecurityAlgo(OrderRecordImmutable order, SecurityImmutable? security, AlgoData algo, AlgoDefinitionMetadata? meta, uint? piq) {
|
||||
this.order = order;
|
||||
this.security = security;
|
||||
this.algo = algo;
|
||||
this.meta = meta;
|
||||
this.piq = piq;
|
||||
}
|
||||
|
||||
public static OrderSecurityAlgo from_order_security(OrderSecurity os) =>
|
||||
new OrderSecurityAlgo(
|
||||
os.order,
|
||||
os.security,
|
||||
os.algo ?? AlgoData.from_custom_def(os.order.Def.CustomDef),
|
||||
os.meta,
|
||||
os.piq);
|
||||
|
||||
public bool Equals(OrderSecurityAlgo other) =>
|
||||
order == other.order &&
|
||||
piq == other.piq &&
|
||||
security == other.security &&
|
||||
algo == other.algo;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is OrderSecurityAlgo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.auto_phase(
|
||||
order.Key.GetHashCode(),
|
||||
piq?.GetHashCode() ?? 0,
|
||||
security.HasValue ? security.Value.Id.GetHashCode() : 0,
|
||||
algo.GetHashCode());
|
||||
|
||||
public static bool operator ==(OrderSecurityAlgo a, OrderSecurityAlgo b) => a.Equals(b);
|
||||
public static bool operator !=(OrderSecurityAlgo a, OrderSecurityAlgo b) => !a.Equals(b);
|
||||
}
|
||||
|
||||
// This is a core data type on the front end, so data validation is strict, as bad values may yield weird/difficult to track bugs.
|
||||
// Descriptive factory methods are favored over public constructors, as they are less likely to be misused.
|
||||
readonly struct OrderSecurityRootPair : IEquatable<OrderSecurityRootPair> {
|
||||
public readonly OrderSecurityAlgo order;
|
||||
readonly OrderSecurityAlgo? _root;
|
||||
|
||||
OrderSecurityRootPair(OrderSecurityAlgo order) {
|
||||
this.order = order;
|
||||
_root = null;
|
||||
}
|
||||
|
||||
OrderSecurityRootPair(OrderSecurityAlgo order, OrderSecurityAlgo? root) {
|
||||
this.order = order;
|
||||
_root = root;
|
||||
}
|
||||
|
||||
public OrderSecurityAlgo root => _root ?? order;
|
||||
|
||||
public static OrderSecurityRootPair from_order_security(OrderSecurity order) =>
|
||||
new OrderSecurityRootPair(OrderSecurityAlgo.from_order_security(order));
|
||||
|
||||
public static OrderSecurityRootPair from_order_security(OrderSecurity order, OrderSecurity root) =>
|
||||
new OrderSecurityRootPair(
|
||||
OrderSecurityAlgo.from_order_security(order),
|
||||
OrderSecurityAlgo.from_order_security(root));
|
||||
|
||||
public bool Equals(OrderSecurityRootPair other) =>
|
||||
order == other.order &&
|
||||
_root == other._root;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is OrderSecurityRootPair other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
_root.HasValue ?
|
||||
(order.GetHashCode() % (1 << 15)) | (_root.Value.GetHashCode() % (1 << 15) << 16) :
|
||||
order.GetHashCode() % (1 << 15);
|
||||
|
||||
public static bool operator ==(OrderSecurityRootPair a, OrderSecurityRootPair b) => a.Equals(b);
|
||||
public static bool operator !=(OrderSecurityRootPair a, OrderSecurityRootPair b) => !a.Equals(b);
|
||||
}
|
||||
|
||||
static class OrderSecurityHelper {
|
||||
public static readonly Func<OrderSecurity, uint>
|
||||
key_fn = o => o.order.Key,
|
||||
parent_key_fn = o => o.order.ParentKey;
|
||||
|
||||
public static readonly Func<OrderSecurityRootPair, uint>
|
||||
root_pair_key_fn = o => o.order.order.Key,
|
||||
root_pair_parent_key_fn = o => o.order.order.ParentKey;
|
||||
}
|
||||
}
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark;
|
||||
|
||||
using System;
|
||||
|
||||
namespace bts.api.orderman {
|
||||
readonly struct OrderSecurity : IEquatable<OrderSecurity> {
|
||||
public OrderSecurity((SecurityImmutable? sec, OrderRecordImmutable order) t) {
|
||||
security = t.sec;
|
||||
order = t.order;
|
||||
piq = null;
|
||||
algo = null;
|
||||
meta = null;
|
||||
}
|
||||
|
||||
public OrderSecurity(SecurityImmutable? sec, OrderRecordImmutable order, uint? piq) {
|
||||
this.security = sec;
|
||||
this.order = order;
|
||||
this.piq = piq;
|
||||
algo = null;
|
||||
meta = null;
|
||||
}
|
||||
|
||||
public OrderSecurity(SecurityImmutable? sec, OrderRecordImmutable order, uint? piq, AlgoData? algo, AlgoDefinitionMetadata? meta) {
|
||||
this.security = sec;
|
||||
this.order = order;
|
||||
this.piq = piq;
|
||||
this.algo = algo;
|
||||
this.meta = meta;
|
||||
}
|
||||
|
||||
public static implicit operator OrderSecurity(ValueTuple<SecurityImmutable?, OrderRecordImmutable> x) => new OrderSecurity(x);
|
||||
public SecurityImmutable? security { get; }
|
||||
public OrderRecordImmutable order { get; }
|
||||
public uint? piq { get; }
|
||||
public AlgoData? algo { get; }
|
||||
public AlgoDefinitionMetadata? meta { get; }
|
||||
|
||||
public bool Equals(OrderSecurity other) =>
|
||||
order == other.order &&
|
||||
security == other.security &&
|
||||
piq == other.piq &&
|
||||
algo == other.algo &&
|
||||
meta == other.meta;
|
||||
|
||||
public override bool Equals(object obj) => EqualityComparer.equals_obj(this, obj);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.aggregate_hash(
|
||||
order.GetHashCode(),
|
||||
security?.GetHashCode() ?? 0,
|
||||
piq?.GetHashCode() ?? 0,
|
||||
algo?.GetHashCode() ?? 0,
|
||||
meta?.GetHashCode() ?? 0);
|
||||
|
||||
public static bool operator ==(OrderSecurity left, OrderSecurity right) => left.Equals(right);
|
||||
public static bool operator !=(OrderSecurity left, OrderSecurity right) => !left.Equals(right);
|
||||
}
|
||||
|
||||
// This is a core data type on the front end, so data validation is strict, as bad values may yield weird/difficult to track bugs.
|
||||
// Descriptive factory methods are favored over public constructors, as they are less likely to be misused.
|
||||
readonly struct OrderSecurityAlgo : IEquatable<OrderSecurityAlgo> {
|
||||
public readonly OrderRecordImmutable order;
|
||||
public readonly SecurityImmutable? security;
|
||||
public readonly AlgoData algo;
|
||||
public readonly AlgoDefinitionMetadata? meta;
|
||||
public readonly uint? piq;
|
||||
|
||||
OrderSecurityAlgo(OrderRecordImmutable order, SecurityImmutable? security, AlgoData algo, AlgoDefinitionMetadata? meta, uint? piq) {
|
||||
this.order = order;
|
||||
this.security = security;
|
||||
this.algo = algo;
|
||||
this.meta = meta;
|
||||
this.piq = piq;
|
||||
}
|
||||
|
||||
public static OrderSecurityAlgo from_order_security(OrderSecurity os) =>
|
||||
new OrderSecurityAlgo(
|
||||
os.order,
|
||||
os.security,
|
||||
os.algo ?? AlgoData.from_custom_def(os.order.Def.CustomDef),
|
||||
os.meta,
|
||||
os.piq);
|
||||
|
||||
public bool Equals(OrderSecurityAlgo other) =>
|
||||
order == other.order &&
|
||||
piq == other.piq &&
|
||||
security == other.security &&
|
||||
algo == other.algo;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is OrderSecurityAlgo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
EqualityComparer.auto_phase(
|
||||
order.Key.GetHashCode(),
|
||||
piq?.GetHashCode() ?? 0,
|
||||
security.HasValue ? security.Value.Id.GetHashCode() : 0,
|
||||
algo.GetHashCode());
|
||||
|
||||
public static bool operator ==(OrderSecurityAlgo a, OrderSecurityAlgo b) => a.Equals(b);
|
||||
public static bool operator !=(OrderSecurityAlgo a, OrderSecurityAlgo b) => !a.Equals(b);
|
||||
}
|
||||
|
||||
// This is a core data type on the front end, so data validation is strict, as bad values may yield weird/difficult to track bugs.
|
||||
// Descriptive factory methods are favored over public constructors, as they are less likely to be misused.
|
||||
readonly struct OrderSecurityRootPair : IEquatable<OrderSecurityRootPair> {
|
||||
public readonly OrderSecurityAlgo order;
|
||||
readonly OrderSecurityAlgo? _root;
|
||||
|
||||
OrderSecurityRootPair(OrderSecurityAlgo order) {
|
||||
this.order = order;
|
||||
_root = null;
|
||||
}
|
||||
|
||||
OrderSecurityRootPair(OrderSecurityAlgo order, OrderSecurityAlgo? root) {
|
||||
this.order = order;
|
||||
_root = root;
|
||||
}
|
||||
|
||||
public OrderSecurityAlgo root => _root ?? order;
|
||||
|
||||
public static OrderSecurityRootPair from_order_security(OrderSecurity order) =>
|
||||
new OrderSecurityRootPair(OrderSecurityAlgo.from_order_security(order));
|
||||
|
||||
public static OrderSecurityRootPair from_order_security(OrderSecurity order, OrderSecurity root) =>
|
||||
new OrderSecurityRootPair(
|
||||
OrderSecurityAlgo.from_order_security(order),
|
||||
OrderSecurityAlgo.from_order_security(root));
|
||||
|
||||
public bool Equals(OrderSecurityRootPair other) =>
|
||||
order == other.order &&
|
||||
_root == other._root;
|
||||
|
||||
public override bool Equals(object obj) =>
|
||||
obj is OrderSecurityRootPair other && Equals(other);
|
||||
|
||||
public override int GetHashCode() =>
|
||||
_root.HasValue ?
|
||||
(order.GetHashCode() % (1 << 15)) | (_root.Value.GetHashCode() % (1 << 15) << 16) :
|
||||
order.GetHashCode() % (1 << 15);
|
||||
|
||||
public static bool operator ==(OrderSecurityRootPair a, OrderSecurityRootPair b) => a.Equals(b);
|
||||
public static bool operator !=(OrderSecurityRootPair a, OrderSecurityRootPair b) => !a.Equals(b);
|
||||
}
|
||||
|
||||
static class OrderSecurityHelper {
|
||||
public static readonly Func<OrderSecurity, uint>
|
||||
key_fn = o => o.order.Key,
|
||||
parent_key_fn = o => o.order.ParentKey;
|
||||
|
||||
public static readonly Func<OrderSecurityRootPair, uint>
|
||||
root_pair_key_fn = o => o.order.order.Key,
|
||||
root_pair_parent_key_fn = o => o.order.order.ParentKey;
|
||||
}
|
||||
}
|
||||
+483
-483
@@ -1,483 +1,483 @@
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.co2;
|
||||
using bts.spark;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark.utilities;
|
||||
using mbts.ui;
|
||||
using mbts.ui.utilities;
|
||||
using mbts.ui.utility;
|
||||
using mbts.utils;
|
||||
|
||||
using Spark.Core;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Media;
|
||||
|
||||
using static mbts.ui.utilities.DisplayNameHelper;
|
||||
|
||||
namespace mbts.spark {
|
||||
static class OrderUtils {
|
||||
public static readonly Func<OrderRecordImmutable, uint> RecordKeySelector = o => o.Key;
|
||||
|
||||
#region OrderStateImmutable extension methods
|
||||
public static double quantity(this OrderStateImmutable state) =>
|
||||
Convert.ToDouble(state.Quantity) +
|
||||
(state.HasFractionalQuantity ? state.FractionalQuantity.Fraction : 0.0);
|
||||
|
||||
public static double filled_quantity(this OrderStateImmutable state) =>
|
||||
Convert.ToDouble(state.FilledQuantity) +
|
||||
(state.HasFractionalFilledQuantity ? state.FractionalFilledQuantity.Fraction : 0.0);
|
||||
|
||||
public static double working_quantity(this OrderStateImmutable state) =>
|
||||
state.quantity() - state.filled_quantity();
|
||||
|
||||
public static double fill_ratio(this OrderStateImmutable state) =>
|
||||
state.filled_quantity() / state.quantity();
|
||||
|
||||
#endregion
|
||||
|
||||
public static double filled_quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.filled_quantity() : 0.0;
|
||||
|
||||
public static double fill_ratio(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.FilledQuantity / (double)order.State.Quantity : double.NaN;
|
||||
|
||||
public static double quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.quantity() : 0;
|
||||
|
||||
public static double working_quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.working_quantity() : 0;
|
||||
|
||||
|
||||
public static double price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.Price : double.NaN;
|
||||
|
||||
public static double ui_price(this OrderRecordImmutable order) {
|
||||
if (order.HasState) {
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.Stop && !order.stop_or_stop_limit_has_been_triggered()) {
|
||||
return order.stop_price();
|
||||
}
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.StopLimit && !order.stop_or_stop_limit_has_been_triggered()) {
|
||||
return order.stop_limit_price();
|
||||
}
|
||||
return order.State.Price;
|
||||
}
|
||||
return double.NaN;
|
||||
}
|
||||
|
||||
public static double stop_price(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasStop && order.State.Stop.HasNativeState ? order.State.Stop.NativeState.StopPx : double.NaN;
|
||||
|
||||
public static double stop_limit_price(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasStopLimit && order.State.StopLimit.HasNativeState ? order.State.StopLimit.NativeState.StopPx : double.NaN;
|
||||
|
||||
public static double avg_price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.AvgPrice : double.NaN;
|
||||
|
||||
public static double last_price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.LastPrice : double.NaN;
|
||||
|
||||
public static string last_msg(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.LastMsg : string.Empty;
|
||||
|
||||
public static IReadOnlyDictionary<string, DynamicOrderParam> dynamic_custom_state(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasDynamic ?
|
||||
(order.State.Dynamic.CustomState ?? DictionaryHelper.empty<string, DynamicOrderParam>()) :
|
||||
DictionaryHelper.empty<string, DynamicOrderParam>();
|
||||
|
||||
public static DateTime created(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasCreated ? order.State.Created.ToDateTime().ToLocalTime() : DateTime.MinValue;
|
||||
|
||||
public static DateTime last_change(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasLastChange ? order.State.LastChange.ToDateTime().ToLocalTime() : DateTime.MinValue;
|
||||
|
||||
public static OrderStatus status(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.Status : OrderStatus.Error;
|
||||
|
||||
public static uint security_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.SecurityKey : 0u;
|
||||
|
||||
public static Side side(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.Side : Side.Undefined;
|
||||
|
||||
public static string user(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.User : string.Empty;
|
||||
|
||||
public static uint user_id(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.UserId : 0;
|
||||
|
||||
public static UserTuple user_tuple(this OrderRecordImmutable order) =>
|
||||
new(order.user_id(), order.user());
|
||||
|
||||
public static string account(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.Account : string.Empty;
|
||||
|
||||
public static uint account_id(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.AccountId : 0;
|
||||
|
||||
public static CustomOrderDefinition.CustomOneofCase order_type(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef ? order.Def.CustomDef.CustomCase : CustomOrderDefinition.CustomOneofCase.None;
|
||||
|
||||
/// <summary>
|
||||
/// Unwraps all <see cref="CompositeOrderDefinition"/>s (if any) to return the underlying order type.
|
||||
/// </summary>
|
||||
/// <param name="order">The order who's underlying algo will be returned.</param>
|
||||
/// <returns>The first non-composite algo definition in the specified <see cref="CustomOrderDefinition"/>.</returns>
|
||||
public static CustomOrderDefinition.CustomOneofCase actual_order_type(this OrderRecordImmutable order) {
|
||||
if (!order.HasDef || !order.Def.HasCustomDef)
|
||||
return CustomOrderDefinition.CustomOneofCase.None;
|
||||
var cdef = order.Def.CustomDef;
|
||||
while (cdef.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite) {
|
||||
if (!cdef.Composite.HasDefinition)
|
||||
return CustomOrderDefinition.CustomOneofCase.None;
|
||||
cdef = cdef.Composite.Definition;
|
||||
}
|
||||
return cdef.CustomCase;
|
||||
}
|
||||
|
||||
public static string dynamic_order_type_display_name(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef && order.Def.CustomDef.HasDynamic ? order.Def.CustomDef.Dynamic.DynamicOrderType : string.Empty;
|
||||
|
||||
public static uint algo_template_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef && order.Def.CustomDef.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite ?
|
||||
order.Def.CustomDef.Composite.AlgoTemplateKey : 0u;
|
||||
|
||||
/// <summary>
|
||||
/// If the definitions is a <see cref="CompositeOrderDefinition"/>, returns the underlying algo, otherwise returns <paramref name="custom_def"/> iteself.
|
||||
/// </summary>
|
||||
/// <param name="custom_def">The definition to for which the underlying algo will be returned.</param>
|
||||
/// <returns>The first non-composite algo definition in the specified <see cref="CustomOrderDefinition"/>.</returns>
|
||||
public static CustomOrderDefinitionImmutable actual(this CustomOrderDefinitionImmutable custom_def) {
|
||||
while (custom_def.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite)
|
||||
custom_def = custom_def.Composite.Definition;
|
||||
return custom_def;
|
||||
}
|
||||
|
||||
public static OrderSubType sub_type(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.SubType : OrderSubType.None;
|
||||
|
||||
public static TimeInForce time_in_force(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.TimeInForce : TimeInForce.Undefined;
|
||||
|
||||
public static uint attached_target_order_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.AttachTargetOrderKey : 0;
|
||||
|
||||
public static bool is_exchange_order(this OrderRecordImmutable order) {
|
||||
if (order.HasDef && order.Def.HasCustomDef) {
|
||||
switch (order.Def.CustomDef.CustomCase) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Limit:
|
||||
case CustomOrderDefinition.CustomOneofCase.Market:
|
||||
case CustomOrderDefinition.CustomOneofCase.Stop:
|
||||
case CustomOrderDefinition.CustomOneofCase.StopLimit:
|
||||
case CustomOrderDefinition.CustomOneofCase.GlbxIceberg: return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool can_attach(this OrderRecordImmutable order) =>
|
||||
order.working_quantity() > 0;
|
||||
|
||||
public static bool can_be_attached_to(this OrderRecordImmutable order) {
|
||||
if (order.HasDef && order.Def.HasCustomDef) {
|
||||
// TODO: implement with real logic (this is impl is a placeholder for development purposes)
|
||||
switch (order.Def.CustomDef.CustomCase) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Iceberg:
|
||||
case CustomOrderDefinition.CustomOneofCase.Dynamic:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool can_detach(this OrderRecordImmutable order) =>
|
||||
order.attached_target_order_key() == 0 && order.has_parent();
|
||||
|
||||
public static string display_name(this OrderSecurity order_tuple) =>
|
||||
display_name(order_tuple.order, order_tuple.algo);
|
||||
|
||||
public static string display_name(OrderRecordImmutable order, AlgoData? algo, SecurityImmutable? security = null) {
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.Spreader && security.HasValue)
|
||||
return security.Value.ToString();
|
||||
if (algo.HasValue) {
|
||||
return algo.Value.name;
|
||||
} else if (order.HasDef && order.Def.HasCustomDef) {
|
||||
return order.Def.CustomDef.HasDynamic ?
|
||||
order.Def.CustomDef.Dynamic.DynamicOrderType :
|
||||
order.Def.CustomDef.CustomCase.display_name();
|
||||
}
|
||||
return "Undefined";
|
||||
}
|
||||
|
||||
public static string full_description(
|
||||
this OrderRecordImmutable order,
|
||||
SecurityImmutable security,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? qty_display = null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string sec_key_text;
|
||||
if (order.HasDef) {
|
||||
sec_key_text = $"Security: {order.Def.SecurityKey}";
|
||||
if (order.HasState) {
|
||||
qty_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var qty_str = qty_display.Value.format(order.quantity());
|
||||
var filled_qty_str = qty_display.Value.format(order.filled_quantity());
|
||||
sb.AppendLine($"{order.Def.Side}: {TickUtils.format(security.ContractSpec, order.State.Price)}");
|
||||
sb.AppendLine($"Filled: {filled_qty_str} / {qty_str}");
|
||||
} else {
|
||||
sb.AppendLine($"{order.Def.Side}: (price-unknown)");
|
||||
sb.AppendLine("Filled: (quantity-unknown)");
|
||||
}
|
||||
sb.AppendLine($"TIF: {order.Def.TimeInForce}");
|
||||
sb.AppendLine($"Type: {display_name(order.Def.CustomDef.CustomCase)}");
|
||||
} else {
|
||||
sec_key_text = "Security: (id-unknown)";
|
||||
sb.AppendLine($"(side-unknown): (price-unknown)");
|
||||
sb.AppendLine("Filled: (quantity-unknown)");
|
||||
}
|
||||
sb.AppendLine($"Order: {order.Key}");
|
||||
if (order.has_parent()) {
|
||||
sb.AppendLine(sec_key_text);
|
||||
sb.Append($"Parent Key: {order.ParentKey}");
|
||||
} else
|
||||
sb.Append(sec_key_text);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string short_description(this OrderRecordImmutable order, ContractSpecificationImmutable? spec) =>
|
||||
$"{(order.HasDef ? order.Def.Side.ToString() : "(unknown-side)")} {(order.HasState ? ($@"{spec.format(order.State.Price)} @ {order.State.Quantity}") : "(unknown-price) @ (unknown-quantity)")}";
|
||||
|
||||
public static string short_description(
|
||||
SecurityImmutable security, Side side, double price, double quantity) =>
|
||||
new StringBuilderEx(
|
||||
security.ToString(), " ",
|
||||
side.ToString(), " ",
|
||||
price_quantity_description(price, quantity, security.spec_or_default())
|
||||
).ToString();
|
||||
|
||||
public static string short_description(this OrderRecordImmutable order, SecurityImmutable? security) {
|
||||
var spec = security.spec_or_default();
|
||||
return new StringBuilderEx(
|
||||
security.display_name(), " ",
|
||||
order.side().ToString(), " ",
|
||||
price_quantity_description(order.price(), order.quantity(), spec), " (",
|
||||
filled_status_description(order, spec), ")"
|
||||
).ToString();
|
||||
}
|
||||
|
||||
public static string price_quantity_description(
|
||||
double price, double quantity, ContractSpecificationImmutable spec) =>
|
||||
price_quantity_description(
|
||||
price, quantity, spec.tick_factors().to_api_tick_display_settingsi());
|
||||
|
||||
public static string price_quantity_description(
|
||||
double price,
|
||||
double quantity,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? price_display = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? quantity_display = null) {
|
||||
price_display ??= SecurityDataHelper.Defaults.price_display_settingsi;
|
||||
quantity_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
return $"{quantity_display.Value.format(quantity)} @ {price_display.Value.format(price)}";
|
||||
}
|
||||
|
||||
public static string filled_status_description(
|
||||
this OrderRecordImmutable order,
|
||||
ContractSpecificationImmutable spec,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? qty_display = null
|
||||
) {
|
||||
qty_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var sb = new StringBuilderEx(
|
||||
"filled ", qty_display.Value.format(order.filled_quantity()));
|
||||
if (order.filled_quantity() > 0)
|
||||
sb.Add(" @ ", spec.format(order.avg_price()));
|
||||
sb.Add(", ", camel_to_title_case(order.status().ToString(), TextCapitalizationFormat.NoCaps));
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string update_description(
|
||||
OrderRecordImmutable order,
|
||||
double? new_price = null,
|
||||
double? new_quantity = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? price_display = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? quantity_display = null
|
||||
) {
|
||||
var price = new_price ?? order.price();
|
||||
var quantity = new_quantity ?? order.working_quantity();
|
||||
if (price == order.price() && quantity == order.working_quantity()) {
|
||||
// nothing actually changed
|
||||
return null;
|
||||
}
|
||||
|
||||
price_display ??= SecurityDataHelper.Defaults.price_display_settingsi;
|
||||
quantity_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var from_desc = price_quantity_description(
|
||||
order.quantity(), order.price(), price_display, quantity_display);
|
||||
var to_desc = price_quantity_description(
|
||||
quantity, price, price_display, quantity_display);
|
||||
return $"{from_desc} to {to_desc}";
|
||||
}
|
||||
|
||||
public static bool has_parent(this OrderRecordImmutable order) =>
|
||||
order.ParentKey != 0;
|
||||
|
||||
public static bool is_active(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.Status == OrderStatus.Working;
|
||||
|
||||
public static bool is_non_terminal(this OrderRecordImmutable order) {
|
||||
if (!order.HasState)
|
||||
return false;
|
||||
switch (order.State.Status) {
|
||||
case OrderStatus.PendingWorking: return true;
|
||||
case OrderStatus.Working: return true;
|
||||
case OrderStatus.Inactive: return true;
|
||||
case OrderStatus.Disconnected: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool stop_or_stop_limit_has_been_triggered(this OrderRecordImmutable order) {
|
||||
if (order.HasState && (order.order_type() == CustomOrderDefinition.CustomOneofCase.Stop || order.order_type() == CustomOrderDefinition.CustomOneofCase.StopLimit)) {
|
||||
var native_state = order.State.native_order_state();
|
||||
if (native_state.HasValue) {
|
||||
if (order.State.HasStop || order.State.HasStopLimit) {
|
||||
return native_state.Value.NativeType == NativeOrderType.Limit;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string type_id(this CustomOrderDefinition.CustomOneofCase order_type) =>
|
||||
order_type.ToString().ToUpper();
|
||||
|
||||
public static string display_name(this OrderSecurityAlgo order_sec_algo) =>
|
||||
display_name(order_sec_algo.order, order_sec_algo.algo, order_sec_algo.security);
|
||||
|
||||
public static string display_name(this CustomOrderDefinitionImmutable algo) =>
|
||||
algo.CustomCase == CustomOrderDefinition.CustomOneofCase.Dynamic ? algo.Dynamic.DynamicOrderType : algo.CustomCase.display_name();
|
||||
|
||||
public static string display_name(this CustomOrderDefinition.CustomOneofCase order_type) =>
|
||||
camel_to_title_case(Regex.Replace(order_type.ToString(), "Order", string.Empty, RegexOptions.IgnoreCase));
|
||||
|
||||
public static bool is_bts_algo_type(this CustomOrderDefinition.CustomOneofCase algo_type) {
|
||||
switch (algo_type) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Iceberg:
|
||||
case CustomOrderDefinition.CustomOneofCase.Lean:
|
||||
case CustomOrderDefinition.CustomOneofCase.Join:
|
||||
case CustomOrderDefinition.CustomOneofCase.Cover:
|
||||
case CustomOrderDefinition.CustomOneofCase.Top:
|
||||
case CustomOrderDefinition.CustomOneofCase.Spreader: return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Brush badge_fill(AlgoDefinitionMetadata? algo_meta, OrderMetadata order_meta) =>
|
||||
new SolidColorBrush(badge_color(algo_meta, order_meta));
|
||||
|
||||
public static Color badge_color(AlgoDefinitionMetadata? algo_meta, OrderMetadata order_meta) =>
|
||||
algo_meta?.badge_color ?? order_meta.Color.rgb_color();
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price, double best_price_volume, double total_volume) =>
|
||||
order_collection_summary(
|
||||
best_price,
|
||||
best_price_volume,
|
||||
total_volume,
|
||||
SecurityDataHelper.Defaults.ContractSpecificationImmutable);
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price,
|
||||
double best_price_volume,
|
||||
double total_volume,
|
||||
ContractSpecificationImmutable spec
|
||||
) {
|
||||
if (total_volume == 0)
|
||||
return string.Empty;
|
||||
return total_volume == best_price_volume ?
|
||||
$"{best_price_volume} @ {spec.format(best_price)}" :
|
||||
$"{best_price_volume} ({total_volume}) @ {spec.format(best_price)}";
|
||||
}
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price,
|
||||
double avg_price,
|
||||
double best_price_volume,
|
||||
double total_volume,
|
||||
ContractSpecificationImmutable spec) {
|
||||
if (total_volume == 0)
|
||||
return string.Empty;
|
||||
return total_volume == best_price_volume ?
|
||||
$"{best_price_volume} @ {spec.format(best_price)}" :
|
||||
$"{best_price_volume} @ {spec.format(best_price)} ({total_volume} @ {spec.format(avg_price)})";
|
||||
}
|
||||
|
||||
public static string past_tense(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return "Bought";
|
||||
case Side.Sell: return "Sold";
|
||||
default: return side.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string abbreviate(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return "B";
|
||||
case Side.Sell: return "S";
|
||||
case Side.Undefined:
|
||||
default: return "E";
|
||||
}
|
||||
}
|
||||
|
||||
public static string abbreviate_structure(CustomOrderDefinitionImmutable def) {
|
||||
var builder = new StringBuilder();
|
||||
impl(builder, def.CloneToMutable());
|
||||
return builder.ToString();
|
||||
// local methods
|
||||
void impl(StringBuilder sb, CustomOrderDefinition mdef) {
|
||||
sb.Append(abbreviate(mdef.CustomCase));
|
||||
foreach (var cad in OrderDataHelper.get_child_algo_data(def.CloneToMutable())) {
|
||||
var child = cad.get_child(mdef);
|
||||
sb.Append(".[");
|
||||
impl(sb, child);
|
||||
sb.Append("]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static readonly Dictionary<CustomOrderDefinition.CustomOneofCase, string> _abbreviated_exchange_types =
|
||||
get_word_tree_abbreviations(OrderDataHelper.all_order_types.Select(t => t.ToString().ToUpper()))
|
||||
.ToDictionary(kv => EnumHelper.parse<CustomOrderDefinition.CustomOneofCase>(kv.Key), kv => kv.Value);
|
||||
|
||||
public static string abbreviate(this CustomOrderDefinition.CustomOneofCase type) =>
|
||||
_abbreviated_exchange_types.TryGetValue(type, out string result) ? result : type.ToString();
|
||||
|
||||
public static string order_sub_type_display_name(OrderSubType sub_type, bool use_long_name) {
|
||||
switch (sub_type) {
|
||||
case OrderSubType.HedgingLeg:
|
||||
return use_long_name ? "Hedging (H)" : "H";
|
||||
case OrderSubType.QuotingLeg:
|
||||
return use_long_name ? "Quoting (Q)" : "Q";
|
||||
case OrderSubType.None:
|
||||
return use_long_name ? "None" : string.Empty;
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static AggressorSide to_aggressor(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return AggressorSide.Buy;
|
||||
case Side.Sell: return AggressorSide.Sell;
|
||||
default: return AggressorSide.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using bts;
|
||||
using bts.api;
|
||||
using bts.api.orderman;
|
||||
using bts.co2;
|
||||
using bts.spark;
|
||||
using bts.utils;
|
||||
|
||||
using mbts.spark.utilities;
|
||||
using mbts.ui;
|
||||
using mbts.ui.utilities;
|
||||
using mbts.ui.utility;
|
||||
using mbts.utils;
|
||||
|
||||
using Spark.Core;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Media;
|
||||
|
||||
using static mbts.ui.utilities.DisplayNameHelper;
|
||||
|
||||
namespace mbts.spark {
|
||||
static class OrderUtils {
|
||||
public static readonly Func<OrderRecordImmutable, uint> RecordKeySelector = o => o.Key;
|
||||
|
||||
#region OrderStateImmutable extension methods
|
||||
public static double quantity(this OrderStateImmutable state) =>
|
||||
Convert.ToDouble(state.Quantity) +
|
||||
(state.HasFractionalQuantity ? state.FractionalQuantity.Fraction : 0.0);
|
||||
|
||||
public static double filled_quantity(this OrderStateImmutable state) =>
|
||||
Convert.ToDouble(state.FilledQuantity) +
|
||||
(state.HasFractionalFilledQuantity ? state.FractionalFilledQuantity.Fraction : 0.0);
|
||||
|
||||
public static double working_quantity(this OrderStateImmutable state) =>
|
||||
state.quantity() - state.filled_quantity();
|
||||
|
||||
public static double fill_ratio(this OrderStateImmutable state) =>
|
||||
state.filled_quantity() / state.quantity();
|
||||
|
||||
#endregion
|
||||
|
||||
public static double filled_quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.filled_quantity() : 0.0;
|
||||
|
||||
public static double fill_ratio(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.FilledQuantity / (double)order.State.Quantity : double.NaN;
|
||||
|
||||
public static double quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.quantity() : 0;
|
||||
|
||||
public static double working_quantity(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.working_quantity() : 0;
|
||||
|
||||
|
||||
public static double price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.Price : double.NaN;
|
||||
|
||||
public static double ui_price(this OrderRecordImmutable order) {
|
||||
if (order.HasState) {
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.Stop && !order.stop_or_stop_limit_has_been_triggered()) {
|
||||
return order.stop_price();
|
||||
}
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.StopLimit && !order.stop_or_stop_limit_has_been_triggered()) {
|
||||
return order.stop_limit_price();
|
||||
}
|
||||
return order.State.Price;
|
||||
}
|
||||
return double.NaN;
|
||||
}
|
||||
|
||||
public static double stop_price(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasStop && order.State.Stop.HasNativeState ? order.State.Stop.NativeState.StopPx : double.NaN;
|
||||
|
||||
public static double stop_limit_price(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasStopLimit && order.State.StopLimit.HasNativeState ? order.State.StopLimit.NativeState.StopPx : double.NaN;
|
||||
|
||||
public static double avg_price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.AvgPrice : double.NaN;
|
||||
|
||||
public static double last_price(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.LastPrice : double.NaN;
|
||||
|
||||
public static string last_msg(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.LastMsg : string.Empty;
|
||||
|
||||
public static IReadOnlyDictionary<string, DynamicOrderParam> dynamic_custom_state(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasDynamic ?
|
||||
(order.State.Dynamic.CustomState ?? DictionaryHelper.empty<string, DynamicOrderParam>()) :
|
||||
DictionaryHelper.empty<string, DynamicOrderParam>();
|
||||
|
||||
public static DateTime created(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasCreated ? order.State.Created.ToDateTime().ToLocalTime() : DateTime.MinValue;
|
||||
|
||||
public static DateTime last_change(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.HasLastChange ? order.State.LastChange.ToDateTime().ToLocalTime() : DateTime.MinValue;
|
||||
|
||||
public static OrderStatus status(this OrderRecordImmutable order) =>
|
||||
order.HasState ? order.State.Status : OrderStatus.Error;
|
||||
|
||||
public static uint security_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.SecurityKey : 0u;
|
||||
|
||||
public static Side side(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.Side : Side.Undefined;
|
||||
|
||||
public static string user(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.User : string.Empty;
|
||||
|
||||
public static uint user_id(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.UserId : 0;
|
||||
|
||||
public static UserTuple user_tuple(this OrderRecordImmutable order) =>
|
||||
new(order.user_id(), order.user());
|
||||
|
||||
public static string account(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.Account : string.Empty;
|
||||
|
||||
public static uint account_id(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.AccountId : 0;
|
||||
|
||||
public static CustomOrderDefinition.CustomOneofCase order_type(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef ? order.Def.CustomDef.CustomCase : CustomOrderDefinition.CustomOneofCase.None;
|
||||
|
||||
/// <summary>
|
||||
/// Unwraps all <see cref="CompositeOrderDefinition"/>s (if any) to return the underlying order type.
|
||||
/// </summary>
|
||||
/// <param name="order">The order who's underlying algo will be returned.</param>
|
||||
/// <returns>The first non-composite algo definition in the specified <see cref="CustomOrderDefinition"/>.</returns>
|
||||
public static CustomOrderDefinition.CustomOneofCase actual_order_type(this OrderRecordImmutable order) {
|
||||
if (!order.HasDef || !order.Def.HasCustomDef)
|
||||
return CustomOrderDefinition.CustomOneofCase.None;
|
||||
var cdef = order.Def.CustomDef;
|
||||
while (cdef.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite) {
|
||||
if (!cdef.Composite.HasDefinition)
|
||||
return CustomOrderDefinition.CustomOneofCase.None;
|
||||
cdef = cdef.Composite.Definition;
|
||||
}
|
||||
return cdef.CustomCase;
|
||||
}
|
||||
|
||||
public static string dynamic_order_type_display_name(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef && order.Def.CustomDef.HasDynamic ? order.Def.CustomDef.Dynamic.DynamicOrderType : string.Empty;
|
||||
|
||||
public static uint algo_template_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef && order.Def.HasCustomDef && order.Def.CustomDef.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite ?
|
||||
order.Def.CustomDef.Composite.AlgoTemplateKey : 0u;
|
||||
|
||||
/// <summary>
|
||||
/// If the definitions is a <see cref="CompositeOrderDefinition"/>, returns the underlying algo, otherwise returns <paramref name="custom_def"/> iteself.
|
||||
/// </summary>
|
||||
/// <param name="custom_def">The definition to for which the underlying algo will be returned.</param>
|
||||
/// <returns>The first non-composite algo definition in the specified <see cref="CustomOrderDefinition"/>.</returns>
|
||||
public static CustomOrderDefinitionImmutable actual(this CustomOrderDefinitionImmutable custom_def) {
|
||||
while (custom_def.CustomCase == CustomOrderDefinition.CustomOneofCase.Composite)
|
||||
custom_def = custom_def.Composite.Definition;
|
||||
return custom_def;
|
||||
}
|
||||
|
||||
public static OrderSubType sub_type(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.SubType : OrderSubType.None;
|
||||
|
||||
public static TimeInForce time_in_force(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.TimeInForce : TimeInForce.Undefined;
|
||||
|
||||
public static uint attached_target_order_key(this OrderRecordImmutable order) =>
|
||||
order.HasDef ? order.Def.AttachTargetOrderKey : 0;
|
||||
|
||||
public static bool is_exchange_order(this OrderRecordImmutable order) {
|
||||
if (order.HasDef && order.Def.HasCustomDef) {
|
||||
switch (order.Def.CustomDef.CustomCase) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Limit:
|
||||
case CustomOrderDefinition.CustomOneofCase.Market:
|
||||
case CustomOrderDefinition.CustomOneofCase.Stop:
|
||||
case CustomOrderDefinition.CustomOneofCase.StopLimit:
|
||||
case CustomOrderDefinition.CustomOneofCase.GlbxIceberg: return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool can_attach(this OrderRecordImmutable order) =>
|
||||
order.working_quantity() > 0;
|
||||
|
||||
public static bool can_be_attached_to(this OrderRecordImmutable order) {
|
||||
if (order.HasDef && order.Def.HasCustomDef) {
|
||||
// TODO: implement with real logic (this is impl is a placeholder for development purposes)
|
||||
switch (order.Def.CustomDef.CustomCase) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Iceberg:
|
||||
case CustomOrderDefinition.CustomOneofCase.Dynamic:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool can_detach(this OrderRecordImmutable order) =>
|
||||
order.attached_target_order_key() == 0 && order.has_parent();
|
||||
|
||||
public static string display_name(this OrderSecurity order_tuple) =>
|
||||
display_name(order_tuple.order, order_tuple.algo);
|
||||
|
||||
public static string display_name(OrderRecordImmutable order, AlgoData? algo, SecurityImmutable? security = null) {
|
||||
if (order.order_type() == CustomOrderDefinition.CustomOneofCase.Spreader && security.HasValue)
|
||||
return security.Value.ToString();
|
||||
if (algo.HasValue) {
|
||||
return algo.Value.name;
|
||||
} else if (order.HasDef && order.Def.HasCustomDef) {
|
||||
return order.Def.CustomDef.HasDynamic ?
|
||||
order.Def.CustomDef.Dynamic.DynamicOrderType :
|
||||
order.Def.CustomDef.CustomCase.display_name();
|
||||
}
|
||||
return "Undefined";
|
||||
}
|
||||
|
||||
public static string full_description(
|
||||
this OrderRecordImmutable order,
|
||||
SecurityImmutable security,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? qty_display = null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string sec_key_text;
|
||||
if (order.HasDef) {
|
||||
sec_key_text = $"Security: {order.Def.SecurityKey}";
|
||||
if (order.HasState) {
|
||||
qty_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var qty_str = qty_display.Value.format(order.quantity());
|
||||
var filled_qty_str = qty_display.Value.format(order.filled_quantity());
|
||||
sb.AppendLine($"{order.Def.Side}: {TickUtils.format(security.ContractSpec, order.State.Price)}");
|
||||
sb.AppendLine($"Filled: {filled_qty_str} / {qty_str}");
|
||||
} else {
|
||||
sb.AppendLine($"{order.Def.Side}: (price-unknown)");
|
||||
sb.AppendLine("Filled: (quantity-unknown)");
|
||||
}
|
||||
sb.AppendLine($"TIF: {order.Def.TimeInForce}");
|
||||
sb.AppendLine($"Type: {display_name(order.Def.CustomDef.CustomCase)}");
|
||||
} else {
|
||||
sec_key_text = "Security: (id-unknown)";
|
||||
sb.AppendLine($"(side-unknown): (price-unknown)");
|
||||
sb.AppendLine("Filled: (quantity-unknown)");
|
||||
}
|
||||
sb.AppendLine($"Order: {order.Key}");
|
||||
if (order.has_parent()) {
|
||||
sb.AppendLine(sec_key_text);
|
||||
sb.Append($"Parent Key: {order.ParentKey}");
|
||||
} else
|
||||
sb.Append(sec_key_text);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string short_description(this OrderRecordImmutable order, ContractSpecificationImmutable? spec) =>
|
||||
$"{(order.HasDef ? order.Def.Side.ToString() : "(unknown-side)")} {(order.HasState ? ($@"{spec.format(order.State.Price)} @ {order.State.Quantity}") : "(unknown-price) @ (unknown-quantity)")}";
|
||||
|
||||
public static string short_description(
|
||||
SecurityImmutable security, Side side, double price, double quantity) =>
|
||||
new StringBuilderEx(
|
||||
security.ToString(), " ",
|
||||
side.ToString(), " ",
|
||||
price_quantity_description(price, quantity, security.spec_or_default())
|
||||
).ToString();
|
||||
|
||||
public static string short_description(this OrderRecordImmutable order, SecurityImmutable? security) {
|
||||
var spec = security.spec_or_default();
|
||||
return new StringBuilderEx(
|
||||
security.display_name(), " ",
|
||||
order.side().ToString(), " ",
|
||||
price_quantity_description(order.price(), order.quantity(), spec), " (",
|
||||
filled_status_description(order, spec), ")"
|
||||
).ToString();
|
||||
}
|
||||
|
||||
public static string price_quantity_description(
|
||||
double price, double quantity, ContractSpecificationImmutable spec) =>
|
||||
price_quantity_description(
|
||||
price, quantity, spec.tick_factors().to_api_tick_display_settingsi());
|
||||
|
||||
public static string price_quantity_description(
|
||||
double price,
|
||||
double quantity,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? price_display = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? quantity_display = null) {
|
||||
price_display ??= SecurityDataHelper.Defaults.price_display_settingsi;
|
||||
quantity_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
return $"{quantity_display.Value.format(quantity)} @ {price_display.Value.format(price)}";
|
||||
}
|
||||
|
||||
public static string filled_status_description(
|
||||
this OrderRecordImmutable order,
|
||||
ContractSpecificationImmutable spec,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? qty_display = null
|
||||
) {
|
||||
qty_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var sb = new StringBuilderEx(
|
||||
"filled ", qty_display.Value.format(order.filled_quantity()));
|
||||
if (order.filled_quantity() > 0)
|
||||
sb.Add(" @ ", spec.format(order.avg_price()));
|
||||
sb.Add(", ", camel_to_title_case(order.status().ToString(), TextCapitalizationFormat.NoCaps));
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string update_description(
|
||||
OrderRecordImmutable order,
|
||||
double? new_price = null,
|
||||
double? new_quantity = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? price_display = null,
|
||||
bts.api.domain.TickDisplaySettingsImmutable? quantity_display = null
|
||||
) {
|
||||
var price = new_price ?? order.price();
|
||||
var quantity = new_quantity ?? order.working_quantity();
|
||||
if (price == order.price() && quantity == order.working_quantity()) {
|
||||
// nothing actually changed
|
||||
return null;
|
||||
}
|
||||
|
||||
price_display ??= SecurityDataHelper.Defaults.price_display_settingsi;
|
||||
quantity_display ??= SecurityDataHelper.Defaults.quantity_display_settingsi;
|
||||
var from_desc = price_quantity_description(
|
||||
order.quantity(), order.price(), price_display, quantity_display);
|
||||
var to_desc = price_quantity_description(
|
||||
quantity, price, price_display, quantity_display);
|
||||
return $"{from_desc} to {to_desc}";
|
||||
}
|
||||
|
||||
public static bool has_parent(this OrderRecordImmutable order) =>
|
||||
order.ParentKey != 0;
|
||||
|
||||
public static bool is_active(this OrderRecordImmutable order) =>
|
||||
order.HasState && order.State.Status == OrderStatus.Working;
|
||||
|
||||
public static bool is_non_terminal(this OrderRecordImmutable order) {
|
||||
if (!order.HasState)
|
||||
return false;
|
||||
switch (order.State.Status) {
|
||||
case OrderStatus.PendingWorking: return true;
|
||||
case OrderStatus.Working: return true;
|
||||
case OrderStatus.Inactive: return true;
|
||||
case OrderStatus.Disconnected: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool stop_or_stop_limit_has_been_triggered(this OrderRecordImmutable order) {
|
||||
if (order.HasState && (order.order_type() == CustomOrderDefinition.CustomOneofCase.Stop || order.order_type() == CustomOrderDefinition.CustomOneofCase.StopLimit)) {
|
||||
var native_state = order.State.native_order_state();
|
||||
if (native_state.HasValue) {
|
||||
if (order.State.HasStop || order.State.HasStopLimit) {
|
||||
return native_state.Value.NativeType == NativeOrderType.Limit;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static string type_id(this CustomOrderDefinition.CustomOneofCase order_type) =>
|
||||
order_type.ToString().ToUpper();
|
||||
|
||||
public static string display_name(this OrderSecurityAlgo order_sec_algo) =>
|
||||
display_name(order_sec_algo.order, order_sec_algo.algo, order_sec_algo.security);
|
||||
|
||||
public static string display_name(this CustomOrderDefinitionImmutable algo) =>
|
||||
algo.CustomCase == CustomOrderDefinition.CustomOneofCase.Dynamic ? algo.Dynamic.DynamicOrderType : algo.CustomCase.display_name();
|
||||
|
||||
public static string display_name(this CustomOrderDefinition.CustomOneofCase order_type) =>
|
||||
camel_to_title_case(Regex.Replace(order_type.ToString(), "Order", string.Empty, RegexOptions.IgnoreCase));
|
||||
|
||||
public static bool is_bts_algo_type(this CustomOrderDefinition.CustomOneofCase algo_type) {
|
||||
switch (algo_type) {
|
||||
case CustomOrderDefinition.CustomOneofCase.Iceberg:
|
||||
case CustomOrderDefinition.CustomOneofCase.Lean:
|
||||
case CustomOrderDefinition.CustomOneofCase.Join:
|
||||
case CustomOrderDefinition.CustomOneofCase.Cover:
|
||||
case CustomOrderDefinition.CustomOneofCase.Top:
|
||||
case CustomOrderDefinition.CustomOneofCase.Spreader: return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static Brush badge_fill(AlgoDefinitionMetadata? algo_meta, OrderMetadata order_meta) =>
|
||||
new SolidColorBrush(badge_color(algo_meta, order_meta));
|
||||
|
||||
public static Color badge_color(AlgoDefinitionMetadata? algo_meta, OrderMetadata order_meta) =>
|
||||
algo_meta?.badge_color ?? order_meta.Color.rgb_color();
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price, double best_price_volume, double total_volume) =>
|
||||
order_collection_summary(
|
||||
best_price,
|
||||
best_price_volume,
|
||||
total_volume,
|
||||
SecurityDataHelper.Defaults.ContractSpecificationImmutable);
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price,
|
||||
double best_price_volume,
|
||||
double total_volume,
|
||||
ContractSpecificationImmutable spec
|
||||
) {
|
||||
if (total_volume == 0)
|
||||
return string.Empty;
|
||||
return total_volume == best_price_volume ?
|
||||
$"{best_price_volume} @ {spec.format(best_price)}" :
|
||||
$"{best_price_volume} ({total_volume}) @ {spec.format(best_price)}";
|
||||
}
|
||||
|
||||
public static string order_collection_summary(
|
||||
double best_price,
|
||||
double avg_price,
|
||||
double best_price_volume,
|
||||
double total_volume,
|
||||
ContractSpecificationImmutable spec) {
|
||||
if (total_volume == 0)
|
||||
return string.Empty;
|
||||
return total_volume == best_price_volume ?
|
||||
$"{best_price_volume} @ {spec.format(best_price)}" :
|
||||
$"{best_price_volume} @ {spec.format(best_price)} ({total_volume} @ {spec.format(avg_price)})";
|
||||
}
|
||||
|
||||
public static string past_tense(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return "Bought";
|
||||
case Side.Sell: return "Sold";
|
||||
default: return side.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public static string abbreviate(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return "B";
|
||||
case Side.Sell: return "S";
|
||||
case Side.Undefined:
|
||||
default: return "E";
|
||||
}
|
||||
}
|
||||
|
||||
public static string abbreviate_structure(CustomOrderDefinitionImmutable def) {
|
||||
var builder = new StringBuilder();
|
||||
impl(builder, def.CloneToMutable());
|
||||
return builder.ToString();
|
||||
// local methods
|
||||
void impl(StringBuilder sb, CustomOrderDefinition mdef) {
|
||||
sb.Append(abbreviate(mdef.CustomCase));
|
||||
foreach (var cad in OrderDataHelper.get_child_algo_data(def.CloneToMutable())) {
|
||||
var child = cad.get_child(mdef);
|
||||
sb.Append(".[");
|
||||
impl(sb, child);
|
||||
sb.Append("]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static readonly Dictionary<CustomOrderDefinition.CustomOneofCase, string> _abbreviated_exchange_types =
|
||||
get_word_tree_abbreviations(OrderDataHelper.all_order_types.Select(t => t.ToString().ToUpper()))
|
||||
.ToDictionary(kv => EnumHelper.parse<CustomOrderDefinition.CustomOneofCase>(kv.Key), kv => kv.Value);
|
||||
|
||||
public static string abbreviate(this CustomOrderDefinition.CustomOneofCase type) =>
|
||||
_abbreviated_exchange_types.TryGetValue(type, out string result) ? result : type.ToString();
|
||||
|
||||
public static string order_sub_type_display_name(OrderSubType sub_type, bool use_long_name) {
|
||||
switch (sub_type) {
|
||||
case OrderSubType.HedgingLeg:
|
||||
return use_long_name ? "Hedging (H)" : "H";
|
||||
case OrderSubType.QuotingLeg:
|
||||
return use_long_name ? "Quoting (Q)" : "Q";
|
||||
case OrderSubType.None:
|
||||
return use_long_name ? "None" : string.Empty;
|
||||
default:
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public static AggressorSide to_aggressor(this Side side) {
|
||||
switch (side) {
|
||||
case Side.Buy: return AggressorSide.Buy;
|
||||
case Side.Sell: return AggressorSide.Sell;
|
||||
default: return AggressorSide.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+667
-667
File diff suppressed because it is too large.
Load diff
@@ -180,8 +180,7 @@ namespace mbts.spark {
|
||||
_bus.post(SparkTags.ShowSlideReportTag, SlideReportSettings.Default(id));
|
||||
|
||||
void _create_combo_report(string _) {
|
||||
var vm = new ComboReportSettingsVM(
|
||||
_bus.subscribe(SparkTags.AccountsTag), _bus.subscribe(SparkTags.SecuritiesTag));
|
||||
var vm = new ComboReportSettingsVM(_bus.subscribe(SparkTags.AccountsTag));
|
||||
vm.load_from(new(new Report { ReportType = Report.Types.ReportType.Slide }));
|
||||
var win = new ComboReportCreationDialog() {
|
||||
DataContext = vm
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
xmlns:shell="clr-namespace:mbts.ui.shell"
|
||||
x:Name="me"
|
||||
Background="{u:BTSColor UI.spark_menu_background}"
|
||||
Background="Transparent"
|
||||
MinWidth="250"
|
||||
>
|
||||
<UserControl.Resources>
|
||||
@@ -26,7 +26,8 @@
|
||||
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"/>
|
||||
@@ -65,8 +66,8 @@
|
||||
Padding="16,6,6,6"
|
||||
IsDefault="True"
|
||||
Command="{Binding create_cmd}"
|
||||
Background="Transparent"
|
||||
Style="{StaticResource LargeMenuButton}">
|
||||
Style="{StaticResource LargeMenuButton}"
|
||||
>
|
||||
<TextBlock FontWeight="Bold" Text="{Binding type_name, StringFormat='New {0}'}" />
|
||||
</Button>
|
||||
</Grid>
|
||||
|
||||
+8
-35
@@ -30,8 +30,7 @@
|
||||
Grid.IsSharedSizeScope="True"
|
||||
ItemsSource="{Binding columns}"
|
||||
SelectionMode="Extended"
|
||||
SelectedItem="{Binding selected_column}"
|
||||
Style="{StaticResource ListBox.Dark}">
|
||||
SelectedItem="{Binding selected_column}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected}" />
|
||||
@@ -92,12 +91,7 @@
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<GroupBox
|
||||
Grid.Column="1"
|
||||
Header="Data Formatting"
|
||||
Margin="0,8,12,12"
|
||||
Padding="6"
|
||||
Foreground="{u:BTSColor UI.default_text}">
|
||||
<GroupBox Grid.Column="1" Header="Data Formatting" Margin="0,8,12,12" Padding="6">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -109,34 +103,13 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="label"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<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}" />
|
||||
<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>
|
||||
<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"
|
||||
Text="Multiplier"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
<TextBlock Grid.Row="3" Margin="0,5,0,0" VerticalAlignment="Center">Multiplier</TextBlock>
|
||||
<c:TickUpDownDouble Grid.Row="3" Grid.Column="1" AllowNaN="True" NaNText="" Margin="8,5,0,0" Value="{Binding display_multiplier}" />
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
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">
|
||||
@@ -31,11 +30,11 @@
|
||||
<Setter
|
||||
Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{u:BTSColor UI.default_text}" />
|
||||
</Style>
|
||||
</StackPanel.Resources>
|
||||
<GroupBox Padding="4" Foreground="{u:BTSColor UI.default_text}" Header="Cascade">
|
||||
<GroupBox
|
||||
Header="Cascade"
|
||||
Padding="4">
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@@ -81,7 +80,7 @@
|
||||
TickCommand="{Binding atm_shift}"
|
||||
TickUpCommandParameter="true"
|
||||
TickDownCommandParameter="false" />
|
||||
<GroupBox Header="Fit To Market" Foreground="{u:BTSColor UI.default_text}">
|
||||
<GroupBox Header="Fit To Market">
|
||||
<StackPanel>
|
||||
<ComboBox
|
||||
Margin="5"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
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>
|
||||
@@ -23,18 +22,7 @@
|
||||
<Setter Property="Margin" Value="16,8" />
|
||||
</Style>
|
||||
|
||||
<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}">
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
||||
@@ -42,15 +30,12 @@
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="border"
|
||||
Background="{TemplateBinding Background}"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
x:Name="label"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{TemplateBinding Header}" />
|
||||
<TextBlock x:Name="label" Text="{TemplateBinding Header}" />
|
||||
<TextBlock
|
||||
x:Name="check"
|
||||
Text="✓"
|
||||
@@ -62,10 +47,12 @@
|
||||
</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>
|
||||
@@ -158,7 +145,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<TextBlock Text="Number of Put Points" Style="{StaticResource TextBlock.Dark}" />
|
||||
<TextBlock Text="Number of Put Points" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -166,7 +153,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" Style="{StaticResource TextBlock.Dark}" />
|
||||
<TextBlock Grid.Row="1" Text="Number of Call Points" Margin="0,5,0,0" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -218,7 +205,7 @@
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="c0" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Text="Number of Put Points" Style="{StaticResource TextBlock.Dark}" />
|
||||
<TextBlock Text="Number of Put Points" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
@@ -229,8 +216,7 @@
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Margin="0,5,0,0"
|
||||
Text="Number of Call Points"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
Text="Number of Call Points" />
|
||||
<c:TextBoxUInt
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -143,10 +143,8 @@
|
||||
</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}" />
|
||||
@@ -213,16 +211,13 @@
|
||||
<Setter Property="HeaderContentTemplate">
|
||||
<Setter.Value>
|
||||
<DataTemplate>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="{Binding}" />
|
||||
<TextBlock Text="{Binding}" VerticalAlignment="Center" />
|
||||
</DataTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="ItemContainerStyle">
|
||||
<Setter.Value>
|
||||
<Style TargetType="c:ComboCheckBoxItem" BasedOn="{StaticResource {x:Type c:ComboCheckBoxItem}}">
|
||||
<Style TargetType="c:ComboCheckBoxItem">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
</Style>
|
||||
@@ -414,22 +409,6 @@
|
||||
<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>
|
||||
@@ -469,7 +448,7 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TabControl Style="{StaticResource TabControl.Dark}">
|
||||
<TabControl>
|
||||
<TabItem x:Name="vol_curve_tab" Header="Vol Curve" DataContext="{Binding vol_curve_vm}">
|
||||
<Grid x:Name="vol_curve_tab_content">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -535,7 +514,6 @@
|
||||
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>
|
||||
|
||||
@@ -36,7 +36,27 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
|
||||
public static GridSettings DefaultGridSettings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria, enable_background_color: true);
|
||||
|
||||
public static GridSettings dark_theme_grid_settings =>
|
||||
DefaultGridSettings.with(
|
||||
selection_highlight: BTSDarkColors.selection_highlight.argb_color(),
|
||||
background: BTSDarkColors.background.argb_color(),
|
||||
font_color: BTSDarkColors.foreground.argb_color(),
|
||||
columns: DefaultColumns.all.Select(c => {
|
||||
Color? fg = c.strong_id<Columns>() switch {
|
||||
Columns.Ask or Columns.AskDirectQty or Columns.AskMergedQty or Columns.AskImpliedQty or Columns.WorkingAsks => BTSDarkColors.ask_foreground,
|
||||
Columns.Bid or Columns.BidDirectQty or Columns.BidMergedQty or Columns.BidImpliedQty or Columns.WorkingBids => BTSDarkColors.bid_foreground,
|
||||
_ => null,
|
||||
};
|
||||
Color? bg = c.strong_id<Columns>() switch {
|
||||
Columns.Ask or Columns.Bid => BTSDarkColors.dark_background,
|
||||
_ => null
|
||||
};
|
||||
return c.with(
|
||||
background_color_override: new(bg),
|
||||
font_color_override: new(fg));
|
||||
}));
|
||||
|
||||
public static fills.FillsSettings DefaultAuxiliaryFills {
|
||||
get {
|
||||
@@ -86,7 +106,7 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
}
|
||||
// and enable background color upgrade
|
||||
return s.with(columns);
|
||||
return s.with(columns, enable_background_color: true);
|
||||
}
|
||||
|
||||
static class DefaultColumns {
|
||||
@@ -102,21 +122,8 @@ 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.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 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 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);
|
||||
@@ -150,8 +157,8 @@ namespace bts.shell.market_view {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
|
||||
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 IEnumerable<Func<MarketViewVM, IDataGridColumnFilter<Row>>> _filter_getters =
|
||||
ReflectionHelper.property_getters<MarketViewVM, IDataGridColumnFilter<Row>>().Cut2();
|
||||
static readonly IReadOnlyList<Func<MarketViewVM, IDataGridColumnFilter<Row>>> _filter_getters =
|
||||
ReflectionHelper.property_delegates_of_type<MarketViewVM, IDataGridColumnFilter<Row>>().ToReadOnlyList();
|
||||
|
||||
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,6 +83,18 @@ 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) =>
|
||||
|
||||
@@ -41,6 +41,12 @@ namespace bts.shell.time_and_sales {
|
||||
public static GridSettings DefaultGridSettings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static GridSettings dark_theme_grid_settings =>
|
||||
DefaultGridSettings.with(
|
||||
selection_highlight: BTSDarkColors.selection_highlight.argb_color(),
|
||||
background: BTSDarkColors.background.argb_color(),
|
||||
font_color: BTSDarkColors.foreground.argb_color());
|
||||
|
||||
[ProtoMember(1)]
|
||||
public SecurityCriteria? security_criteria { get; }
|
||||
|
||||
@@ -132,8 +138,8 @@ namespace bts.shell.time_and_sales {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
|
||||
static GridColumnSettings _mk_col(
|
||||
ColKey key,
|
||||
|
||||
@@ -281,8 +281,8 @@
|
||||
}
|
||||
|
||||
IEnumerable<IDataGridColumnFilter<TimeAndSalesRowVM>> _filters =>
|
||||
ReflectionHelper.property_getters<TimeAndSalesVM, IDataGridColumnFilter<TimeAndSalesRowVM>>()
|
||||
.Select(pg => pg.get(this));
|
||||
ReflectionHelper.property_delegates_of_type<TimeAndSalesVM, IDataGridColumnFilter<TimeAndSalesRowVM>>()
|
||||
.Select(fn => fn(this));
|
||||
|
||||
public (TimeAndSalesFilterSettings filters, IReadOnlyList<SortingCriteria> sorting_criteria, GridSettings grid_settings) create() =>
|
||||
(_get_filter_states(), _sorting_criteria, grid_settings_manager.create());
|
||||
|
||||
@@ -8,12 +8,17 @@ using mbts.spark;
|
||||
using mbts.ui;
|
||||
using mbts.ui.shell;
|
||||
using mbts.ui.spark;
|
||||
using mbts.ui.utility;
|
||||
|
||||
using Spark.Settings;
|
||||
using Spark.View;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace bts.ui {
|
||||
@@ -30,7 +35,9 @@ namespace bts.ui {
|
||||
ws_model = ws;
|
||||
var actions_list = new List<SparkCommand>(2) {
|
||||
SparkCommands.ShowGlobalAlerts,
|
||||
SparkCommands.ShowWorkspaces
|
||||
SparkCommands.ShowWorkspaces,
|
||||
new SparkCommandCommand(
|
||||
"Choose Theme", Icons.ViewSettings, new DialogCommand(mk_theme_picker_dialog, -60, -40))
|
||||
};
|
||||
if (Configuration.get<bts.config.toggles.ToastNotifications>().enabled) {
|
||||
actions_list.Add(SparkCommands.ShowSettings);
|
||||
@@ -46,6 +53,21 @@ namespace bts.ui {
|
||||
}));
|
||||
|
||||
_bus = bus;
|
||||
|
||||
Window mk_theme_picker_dialog() {
|
||||
var model = new ThemePickerModel(settings_hub);
|
||||
var vm = new ThemePickerVM(model);
|
||||
var view = new ThemePickerView() { };
|
||||
var win = new Window() {
|
||||
DataContext = vm,
|
||||
Content = view,
|
||||
Title = "Choose Theme",
|
||||
SizeToContent = SizeToContent.WidthAndHeight,
|
||||
Style = Application.Current.FindResource("BTSDialog") as Style
|
||||
};
|
||||
vm.RequestClose += (s, e) => WindowUtilities.force_close(win);
|
||||
return win;
|
||||
}
|
||||
}
|
||||
public ImageSource icon => Icons.Admin;
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#nullable enable
|
||||
namespace Spark.Settings {
|
||||
using bts;
|
||||
|
||||
using mbts.persist;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
class ThemePickerModel {
|
||||
readonly UserSettingsHub _settings_hub;
|
||||
|
||||
public ThemePickerModel(UserSettingsHub settings_hub) =>
|
||||
_settings_hub = settings_hub;
|
||||
|
||||
public IObservable<UserSettingsTheme?> selected_theme =>
|
||||
_settings_hub.subscribe_default_settings()
|
||||
.Select(us => _settings_hub.themes.FirstOrDefault(t => t.name == us.last_picked_theme))
|
||||
.DistinctUntilChanged();
|
||||
|
||||
public IEnumerable<UserSettingsTheme> themes =>
|
||||
_settings_hub.themes;
|
||||
|
||||
public async Task<bool> set_theme(UserSettingsTheme theme) {
|
||||
try {
|
||||
Log.Gen.info($"Applying settings theme '{theme.name}'");
|
||||
await _settings_hub.save_default(theme.value, true);
|
||||
return true;
|
||||
} catch (Exception ex) {
|
||||
Log.Gen.error($"Error applying theme '{theme.name}': {ex}");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#nullable enable
|
||||
namespace Spark.Settings {
|
||||
using bts;
|
||||
using bts.collections;
|
||||
|
||||
using mbts;
|
||||
using mbts.ui;
|
||||
using mbts.ui.shell;
|
||||
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
class ThemePickerVM : DisposableViewModelBase, IRequestViewClose {
|
||||
readonly ThemePickerModel _model;
|
||||
readonly Property<UserSettingsTheme?> _selected_theme;
|
||||
|
||||
public ThemePickerVM(ThemePickerModel model) {
|
||||
_model = model;
|
||||
themes.AddRange(model.themes);
|
||||
_selected_theme = backing(nameof(selected_theme), model.selected_theme.OnDispatcher());
|
||||
commit_cmd = observant_cmd(
|
||||
commit, t => t is not null, _selected_theme.observe_current(true).OnDispatcher());
|
||||
cancel_cmd = new Command(close);
|
||||
|
||||
async Task commit(UserSettingsTheme? theme) {
|
||||
if (theme is null) {
|
||||
Log.Ui.warn($"Unable to apply theme: {nameof(theme)} arg is null");
|
||||
return;
|
||||
}
|
||||
await _model.set_theme(theme);
|
||||
close();
|
||||
}
|
||||
|
||||
void close() =>
|
||||
RequestClose?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public event EventHandler? RequestClose;
|
||||
|
||||
public ObservableCollection<UserSettingsTheme> themes { get; } = new();
|
||||
public UserSettingsTheme? selected_theme {
|
||||
get => _selected_theme.Value;
|
||||
set => _selected_theme.set(value);
|
||||
}
|
||||
|
||||
public ICommand commit_cmd { get; }
|
||||
public ICommand cancel_cmd { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<UserControl
|
||||
x:Class="Spark.View.ThemePickerView"
|
||||
x:ClassModifier="internal"
|
||||
x:Name="me"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:analytics="clr-namespace:mbts.analytics"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
xmlns:view="clr-namespace:Spark.View">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="/view/Resources/CursorsEx.xaml"/>
|
||||
<ResourceDictionary Source="/view/Resources/DataTemplates.xaml"/>
|
||||
<ResourceDictionary Source="/view/Controls/ExpandedContentSelector.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ComboBox
|
||||
Margin="12"
|
||||
ItemsSource="{Binding themes}"
|
||||
SelectedItem="{Binding selected_theme}"
|
||||
DisplayMemberPath="name" />
|
||||
|
||||
<c:DialogSkirtOKCancel
|
||||
Grid.Row="1"
|
||||
Grid.ColumnSpan="2"
|
||||
VerticalAlignment="Bottom"
|
||||
CloseOnOK="False"
|
||||
CloseOnCancel="False"
|
||||
OKCommand="{Binding commit_cmd}"
|
||||
OKCommandParameter="{Binding selected_theme}"
|
||||
CancelCommand="{Binding cancel_cmd}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
#nullable enable
|
||||
namespace Spark.View {
|
||||
using System.Windows.Controls;
|
||||
|
||||
partial class ThemePickerView : UserControl {
|
||||
public ThemePickerView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,12 @@ namespace bts.shell {
|
||||
public static GridSettings default_grid_settings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static GridSettings dark_theme_grid_settings =>
|
||||
default_grid_settings.with(
|
||||
selection_highlight: BTSDarkColors.selection_highlight.argb_color(),
|
||||
background: BTSDarkColors.background.argb_color(),
|
||||
font_color: BTSDarkColors.foreground.argb_color());
|
||||
|
||||
public static string col_id(Columns col) =>
|
||||
col.ToString();
|
||||
|
||||
|
||||
+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.get_generic_type_args(pvm.GetType(), generic_algo_param_itype).FirstOrDefault();
|
||||
var targ = ReflectionHelper.GetGenericTypeArgs(pvm.GetType(), generic_algo_param_itype).FirstOrDefault();
|
||||
if (targ != null) {
|
||||
if (targ.IsEnum)
|
||||
return EnumTemplate;
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace mbts.spark {
|
||||
using mbts.ui.controls;
|
||||
|
||||
using System;
|
||||
using System.Windows.Media;
|
||||
|
||||
using ColKey = ui.spark.FillsView.Columns;
|
||||
|
||||
@@ -43,16 +42,8 @@ namespace mbts.spark {
|
||||
IDataGridColumnPersistentFilter<FillTuple, TColFilter> filter_model,
|
||||
Func<FillsFilterStates, TColFilter> get_col_filter,
|
||||
Action<FillsFilterStates, TColFilter> set_col_filter,
|
||||
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) {
|
||||
string? filter_template = null)
|
||||
: base(key, get_text, filter_model, filter_template) {
|
||||
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<FillsRowVM, FillsView.Columns>, IFillsColumn {
|
||||
class FillsSideColumn : DIYGrid.SideColumn<FillTuple, FillsView.Columns>, IFillsColumn {
|
||||
public FillsSideColumn(
|
||||
IDataGridColumnPersistentFilter<FillTuple, Side[]> filter_model)
|
||||
: base(FillsView.Columns.Side, r => r.side, filter_model) {
|
||||
: base(FillsView.Columns.Side, r => r.fill.Side, filter_model) {
|
||||
this.filter_model = filter_model;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,8 @@ namespace mbts.spark {
|
||||
|
||||
public new IDataGridColumnPersistentFilter<FillTuple, Side[]> filter_model { get; }
|
||||
|
||||
IDataGridColumnFilter<FillTuple> IFilterableDIYGridColumn<FillTuple, FillsView.Columns>.filter_model =>
|
||||
filter_model;
|
||||
|
||||
IDataGridColumnFilter<FillTuple> IFilterableDIYGridColumn<FillTuple, FillsView.Columns>.filter_model => filter_model;
|
||||
IDataGridColumnFilter IFilterableDIYGridColumn.filter_model => filter_model;
|
||||
FillsView.Columns IDIYGridColumn<FillsView.Columns>.id => key;
|
||||
|
||||
public FillsFilterStates assign_filter_settings(FillsFilterStates filter_settings) {
|
||||
|
||||
@@ -228,8 +228,7 @@ namespace mbts.spark {
|
||||
DataGridFilterKnownTemplates.UIntMinMax,
|
||||
fs => fs.size,
|
||||
(fs, cf) => fs.size = cf,
|
||||
DefaultColumnWidths.Qty,
|
||||
get_fg: r => r.side == Side.Buy ? BTSColors.MarketData.bid : BTSColors.MarketData.ask);
|
||||
DefaultColumnWidths.Qty);
|
||||
|
||||
add_col(
|
||||
Columns.Price,
|
||||
@@ -239,8 +238,7 @@ namespace mbts.spark {
|
||||
DataGridFilterKnownTemplates.DoubleMinMax,
|
||||
fs => fs.price,
|
||||
(fs, cf) => fs.price = cf,
|
||||
DefaultColumnWidths.Price,
|
||||
get_fg: r => r.side == Side.Buy ? BTSColors.MarketData.bid : BTSColors.MarketData.ask);
|
||||
DefaultColumnWidths.Price);
|
||||
|
||||
add_col(
|
||||
Columns.FillKind,
|
||||
@@ -380,18 +378,14 @@ namespace mbts.spark {
|
||||
string filter_template,
|
||||
Func<FillsFilterStates, TFilter> get_col_filter,
|
||||
Action<FillsFilterStates, TFilter> set_col_filter,
|
||||
double width,
|
||||
Func<FillsRowVM, Brush>? get_fg = null,
|
||||
Func<FillsRowVM, Brush>? get_bg = null) =>
|
||||
double width) =>
|
||||
_columns.Add(new FillsColumn<TFilter>(
|
||||
col_key,
|
||||
r => get_text(r.fill_tuple),
|
||||
filter_model,
|
||||
get_col_filter,
|
||||
set_col_filter,
|
||||
filter_template,
|
||||
get_background: get_bg,
|
||||
get_foreground: get_fg) {
|
||||
filter_template) {
|
||||
Header = header,
|
||||
Width = width
|
||||
});
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</c:DIYGrid.RowStyle>
|
||||
<c:DIYGrid.RowTemplate>
|
||||
<DataTemplate>
|
||||
<usp:FillsRowView />
|
||||
<usp:FillsRowView Background="{Binding side, Converter={StaticResource SideToBrushConverter}}"/>
|
||||
</DataTemplate>
|
||||
</c:DIYGrid.RowTemplate>
|
||||
</c:DIYGrid>
|
||||
|
||||
@@ -39,6 +39,13 @@ namespace bts.shell.fills {
|
||||
}
|
||||
|
||||
public static GridSettings DefaultGridSettings => GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
|
||||
public static GridSettings dark_theme_grid_settings =>
|
||||
DefaultGridSettings.with(
|
||||
selection_highlight: BTSDarkColors.selection_highlight.argb_color(),
|
||||
background: BTSDarkColors.background.argb_color(),
|
||||
font_color: BTSDarkColors.foreground.argb_color());
|
||||
|
||||
public static GridSettings MiniGridSettings => GridSettings.Default.with(DefaultColumns.Mini.all, DefaultColumns.Mini.sorting_criteria);
|
||||
public IReadOnlyList<SortingCriteria> sorting_criteria => _sorting_criteria ?? (_sorting_criteria = DefaultColumns.default_sorting_criteria.ToList());
|
||||
public static FillsSettings Default() =>
|
||||
|
||||
@@ -40,43 +40,24 @@ namespace mbts.spark {
|
||||
width = 50,
|
||||
font_family = "Segoe UI",
|
||||
font_size = 10,
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight(),
|
||||
background = BTSColors.Ladder.default_column_background,
|
||||
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 DefaultOrderColumnSettings => new LadderColumnSettings {
|
||||
show = true,
|
||||
width = 70,
|
||||
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);
|
||||
public static LadderColumnSettings DefaultPiqColumnSettings => new LadderColumnSettings {
|
||||
show = false,
|
||||
width = 50,
|
||||
font_family = "Segoe UI",
|
||||
font_size = 10,
|
||||
font_weight = FontWeights.SemiBold.ToOpenTypeWeight()
|
||||
};
|
||||
|
||||
[ProtoMember(1)]
|
||||
public bool show { get; set; }
|
||||
@@ -94,24 +75,6 @@ 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 &&
|
||||
@@ -168,13 +131,13 @@ namespace mbts.spark {
|
||||
get {
|
||||
var gen = LadderColumnSettings.Default;
|
||||
gen.show = false;
|
||||
gen.background = BTSColors.Ladder.volume_column_background;
|
||||
gen.background = BTSColors.LadderSpecial.default_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.Ladder.passive_volume_bar, false) },
|
||||
total = new HistogramBarAnimation { bars = new ColorShowProto((uint)BTSColors.Ladder.total_volume_bar), show_numbers = true },
|
||||
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 },
|
||||
show_ltq = false
|
||||
};
|
||||
}
|
||||
@@ -455,7 +418,7 @@ namespace mbts.spark {
|
||||
|
||||
static FontParamsProto _default_font =>
|
||||
new FontParamsProto {
|
||||
font_color = BTSColors.UI.default_text,
|
||||
font_color = Colors.Black.rgb_color(),
|
||||
font_size = FontSizes.Regular,
|
||||
typeface = new TypefaceProto(TextUtils.StandardFontFamilyName, FontWeights.Bold.ToOpenTypeWeight())
|
||||
};
|
||||
@@ -591,12 +554,20 @@ namespace mbts.spark {
|
||||
public static LadderSettings historic_default {
|
||||
get {
|
||||
LadderColumnSettings
|
||||
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;
|
||||
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;
|
||||
var rv = new LadderSettings {
|
||||
row_height = 22,
|
||||
grid_line_color = 0x535353,
|
||||
@@ -653,11 +624,46 @@ namespace mbts.spark {
|
||||
}
|
||||
}
|
||||
|
||||
public static LadderSettings tt_default => historic_default;
|
||||
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 Default => mimic_tt ?
|
||||
tt_default : historic_default;
|
||||
|
||||
public static LadderSettings dark_theme {
|
||||
get {
|
||||
var rv = Default;
|
||||
rv.orders_column.background = BTSDarkColors.background.argb_color();
|
||||
rv.orders_column.foreground = BTSDarkColors.foreground.argb_color();
|
||||
|
||||
rv.bid_column.background = BTSDarkColors.dark_background.argb_color();
|
||||
rv.bid_column.foreground = BTSDarkColors.bid_foreground.argb_color();
|
||||
|
||||
rv.price_column.background = BTSDarkColors.background.argb_color();
|
||||
rv.price_column.foreground = BTSDarkColors.foreground.argb_color();
|
||||
|
||||
rv.ask_column.background = BTSDarkColors.dark_background.argb_color();
|
||||
rv.ask_column.foreground = BTSDarkColors.ask_foreground.argb_color();
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
public enum BadgeStyle { Normal, Alternate }
|
||||
|
||||
// TODO: rename to PriceDisplayFormat (today is merge monday, since this isn't a functional change, it is not worth the potential merge headaches right now)
|
||||
|
||||
@@ -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 = BTSColors.Ladder.bid_column_background;
|
||||
_bid_market_cell_background = knobs.bid_market_cell_background.argb_color();
|
||||
if (knobs.ask_market_cell_background != 0)
|
||||
_ask_market_cell_background = BTSColors.Ladder.ask_column_background;
|
||||
_ask_market_cell_background = knobs.ask_market_cell_background.argb_color();
|
||||
}
|
||||
|
||||
public LadderGridHost() {
|
||||
|
||||
@@ -223,9 +223,7 @@ 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((BTSColor)0x40ffffff)
|
||||
.to_brush();
|
||||
market_cell_background_brush = settings.background.rgb_color().blend_with(Colors.White).to_brush();
|
||||
} else {
|
||||
market_cell_background_brush = null;
|
||||
}
|
||||
|
||||
@@ -715,9 +715,9 @@
|
||||
</u:TemplateSelectorKeyValue>
|
||||
</u:KeyedTemplateSelector>
|
||||
</UserControl.Resources>
|
||||
<TabControl Style="{StaticResource TabControl.Dark}">
|
||||
<TabControl>
|
||||
<TabControl.ItemContainerStyle>
|
||||
<Style TargetType="TabItem" BasedOn="{StaticResource TabItem.Dark}">
|
||||
<Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}">
|
||||
<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" BasedOn="{StaticResource Button.Dark}">
|
||||
<Style x:Key="LadderMenuButton" TargetType="Button">
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="Margin" Value="2,0,2,5"/>
|
||||
@@ -307,7 +307,6 @@
|
||||
<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"/>
|
||||
@@ -680,12 +679,7 @@
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<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 Margin="2" Command="{Binding Path=DataContext.size_calculator.click, RelativeSource={RelativeSource AncestorType=ItemsControl}}" Content="{Binding}" Focusable="False">
|
||||
<Button.CommandParameter>
|
||||
<MultiBinding Converter="{x:Static converters:DynamicDoubleMultiplierConverter.Instance}">
|
||||
<Binding/>
|
||||
@@ -697,13 +691,8 @@
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<!-- Clear button -->
|
||||
<Button
|
||||
Margin="2"
|
||||
HorizontalAlignment="Stretch"
|
||||
Command="{Binding size_calculator.clear}"
|
||||
Visibility="{Binding show_clear, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Content="Clear"
|
||||
Style="{StaticResource CommonButton}" />
|
||||
<Button Margin="2" HorizontalAlignment="Stretch" Command="{Binding size_calculator.clear}"
|
||||
Visibility="{Binding show_clear, Converter={StaticResource BooleanToVisibilityConverter}}">Clear</Button>
|
||||
<!-- Auto Clear button - reset to defaults after order -->
|
||||
<CheckBox Margin="2" IsChecked="{Binding auto_clear}"
|
||||
Visibility="{Binding show_auto_clear, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
@@ -812,11 +801,7 @@
|
||||
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}"
|
||||
Foreground="Black"
|
||||
Padding="5,0" />
|
||||
<TextBlock Text="{Binding status_message}" Background="{Binding status_background}" Padding="5,0" />
|
||||
</ControlTemplate>
|
||||
</Button.Template>
|
||||
</Button>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
VerticalAlignment="Stretch"
|
||||
CloseOnCancel="True"
|
||||
CloseOnOK="True"
|
||||
Header="{Binding security, Converter={StaticResource SelectedSecurityTextConverter}}"
|
||||
Header="{Binding security}"
|
||||
IsEditMode="False"
|
||||
IsLazy="True"
|
||||
SecurityMap="{DynamicResource ResourceKey={x:Static u:ResourceKeys.Securities}}"
|
||||
@@ -67,13 +67,7 @@
|
||||
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,9 +8,6 @@
|
||||
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.UI.spark_menu_background.to_brush(),
|
||||
Background = BTSColors.common_background_brush,
|
||||
BorderBrush = Brushes.Black,
|
||||
BorderThickness = new Thickness(0),
|
||||
BorderThickness = new Thickness(1),
|
||||
Padding = new Thickness(0, 6, 0, 0),
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
VerticalAlignment = VerticalAlignment.Top
|
||||
|
||||
@@ -588,18 +588,8 @@ 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),
|
||||
background_brush,
|
||||
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), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
}
|
||||
|
||||
#region Explicit Column Defs
|
||||
@@ -608,18 +598,8 @@ 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),
|
||||
background_brush,
|
||||
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), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class SizeColumn : OrderbookColumnBase<DoubleMinMaxState>, IRenderColumn<OrderBookRowVM> {
|
||||
@@ -627,18 +607,8 @@ 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),
|
||||
background_brush,
|
||||
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), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class FilledColumn : OrderbookColumnBase<DoubleMinMaxState>, IRenderColumn<OrderBookRowVM> {
|
||||
@@ -646,18 +616,8 @@ 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),
|
||||
background_brush,
|
||||
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), null, horizontal_alignment, VerticalAlignment.Center, DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class OrderBookOrderTypeColumn : OrderTypeColumn<Columns>, ICVOrderBookColumn {
|
||||
@@ -723,18 +683,8 @@ 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),
|
||||
background_brush,
|
||||
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), null, HorizontalAlignment.Right, VerticalAlignment.Center, DefaultCellPadding);
|
||||
}
|
||||
|
||||
public class SecurityColumn : FrameworkElementColumnBase<Columns>, ICVOrderBookColumn, IFilterableColumn {
|
||||
@@ -785,10 +735,7 @@ namespace mbts.spark {
|
||||
grid.Children.Add(toggle_button);
|
||||
grid.Children.Add(security_view);
|
||||
//
|
||||
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;
|
||||
return new Border { Child = grid, Margin = new Thickness(10, 0, 0, 0) };
|
||||
}
|
||||
|
||||
protected override void OnSortDirectionChanged(ListSortDirection? new_value) {
|
||||
@@ -815,21 +762,16 @@ namespace mbts.spark {
|
||||
}
|
||||
|
||||
public override FrameworkElement view_factory() {
|
||||
var cb = new CheckBox {
|
||||
var grid = new Grid() {
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
};
|
||||
var cb = new CheckBox();
|
||||
cb.Name = "check_col";
|
||||
cb.SetBinding(CheckBox.IsCheckedProperty, _checked_binding);
|
||||
|
||||
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;
|
||||
grid.Children.Add(cb);
|
||||
return grid;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,14 +820,6 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -988,19 +922,12 @@ namespace mbts.spark {
|
||||
|
||||
#endregion
|
||||
|
||||
var grid = new Grid();
|
||||
grid.Children.Add(attach_grid);
|
||||
grid.Children.Add(detach_grid);
|
||||
grid.Children.Add(popup);
|
||||
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 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;
|
||||
return the_whole_thing;
|
||||
|
||||
UIElement create_popup_child() {
|
||||
#region OrderParamsPanel
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<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>
|
||||
@@ -44,7 +46,11 @@
|
||||
<Color x:Key="TabMouseOverBackgroundLightColor">#FFECF4FC</Color>
|
||||
<Color x:Key="TabMouseOverBackgroundMediumColor">#FFDCECFC</Color>
|
||||
|
||||
<SolidColorBrush x:Key="MenuPopupBrush" Color="{DynamicResource ControlMediumColor}" />
|
||||
<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>
|
||||
|
||||
<!--Converters-->
|
||||
<cv:CastConverter x:Key="CastConverter"/>
|
||||
@@ -185,7 +191,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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<!--Tab-->
|
||||
@@ -229,7 +235,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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.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"/>
|
||||
@@ -239,8 +245,9 @@
|
||||
</Storyboard>
|
||||
<Storyboard x:Key="TabMouseOverStoryboard">
|
||||
<!--Background Opacity/Color-->
|
||||
<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}"/>
|
||||
<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}"/>
|
||||
<!--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"/>
|
||||
@@ -251,9 +258,7 @@
|
||||
|
||||
<Style x:Key="RightPanel.MenuItem" TargetType="MenuItem">
|
||||
<Setter Property="c:MenuItemEx.ClickMode" Value="Press"/>
|
||||
<Setter Property="Background" Value="{StaticResource TabItem.Background}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource TabItem.Foreground}" />
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="BorderThickness" Value="1,0"/>
|
||||
<Setter Property="IsCheckable" Value="True"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
@@ -292,7 +297,10 @@
|
||||
<SolidColorBrush Color="#006CD9" Opacity="0"/>
|
||||
</Border.BorderBrush>
|
||||
<Border.Background>
|
||||
<SolidColorBrush Color="#400080FF" />
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1" Opacity="0">
|
||||
<GradientStop Color="#400080FF" Offset="0.0"/>
|
||||
<GradientStop Color="#400080FF" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup>
|
||||
@@ -301,43 +309,46 @@
|
||||
<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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.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).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<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"/>
|
||||
</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).(SolidColorBrush.Color)" BeginTime="0" Duration="0" To="#800080FF"/>
|
||||
<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"/>
|
||||
|
||||
<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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="0.5"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.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).(SolidColorBrush.Opacity)" BeginTime="0" Duration="0" To="1"/>
|
||||
<DoubleAnimation Storyboard.TargetName="Border" Storyboard.TargetProperty="(Control.Background).(LinearGradientBrush.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).(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}"/>
|
||||
<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}"/>
|
||||
<!--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"/>
|
||||
@@ -362,10 +373,7 @@
|
||||
<Image.Source>
|
||||
<DrawingImage>
|
||||
<DrawingImage.Drawing>
|
||||
<GeometryDrawing
|
||||
Brush="{StaticResource TextBox.ForegroundBrush}"
|
||||
Geometry="{Binding Source={
|
||||
StaticResource {x:Static u:Icons.CheckMarkGeometryKey}}}" />
|
||||
<GeometryDrawing Brush="Black" Geometry="{Binding Source={StaticResource {x:Static u:Icons.CheckMarkGeometryKey}}}"/>
|
||||
</DrawingImage.Drawing>
|
||||
</DrawingImage>
|
||||
</Image.Source>
|
||||
|
||||
@@ -254,11 +254,7 @@
|
||||
</Style>
|
||||
</ToggleButton.Style>
|
||||
</ToggleButton>
|
||||
<Grid
|
||||
x:Name="right_panel_content_root"
|
||||
Grid.Column="1"
|
||||
Background="{u:BTSColor UI.spark_menu_background}"
|
||||
Visibility="Collapsed">
|
||||
<Grid x:Name="right_panel_content_root" Grid.Column="1" Visibility="Collapsed">
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager Target="{Binding Source={u:DirectReference right_panel_content_root}}">
|
||||
<u:StateDefinitionCollection>
|
||||
@@ -391,7 +387,9 @@
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
ItemContainerStyle="{StaticResource RightPanel.MenuItem}"
|
||||
BorderThickness="0">
|
||||
BorderBrush="DarkGray"
|
||||
BorderThickness="1"
|
||||
>
|
||||
<ToolBar.Background>
|
||||
<SolidColorBrush Color="LightGray" Opacity="1"/>
|
||||
</ToolBar.Background>
|
||||
@@ -470,21 +468,16 @@
|
||||
<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"
|
||||
Text="(No orders are selected)"
|
||||
Style="{StaticResource TextBlock.Dark}" />
|
||||
|
||||
<TextBlock x:Name="no_rows_selected_text_block" Visibility="Collapsed">
|
||||
(No orders are selected)
|
||||
</TextBlock>
|
||||
<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,6 +473,18 @@ 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,7 +157,10 @@ namespace bts.shell.pnl {
|
||||
};
|
||||
|
||||
public static GridSettings DefaultGridSettings =>
|
||||
GridSettings.Default.with(DefaultColumns.all, DefaultColumns.default_sorting_criteria);
|
||||
GridSettings.Default.with(
|
||||
DefaultColumns.all,
|
||||
DefaultColumns.default_sorting_criteria,
|
||||
enable_background_color: true);
|
||||
|
||||
public static fills.FillsSettings DefaultAuxiliaryFills {
|
||||
get {
|
||||
|
||||
@@ -39,9 +39,8 @@
|
||||
using SecurityType = api.Security.ContractOneofCase;
|
||||
|
||||
class PNLVM : DisposableViewModelBase, IHandleRowSelection {
|
||||
static readonly IEnumerable<Func<PNLVM, IDataGridColumnFilter<PNLRowData>>> _filter_getters =
|
||||
ReflectionHelper.property_getters<PNLVM, IDataGridColumnFilter<PNLRowData>>().Cut2();
|
||||
|
||||
static readonly IReadOnlyList<Func<PNLVM, IDataGridColumnFilter<PNLRowData>>> _filter_getters =
|
||||
ReflectionHelper.property_delegates_of_type<PNLVM, IDataGridColumnFilter<PNLRowData>>().ToReadOnlyList();
|
||||
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,13 +2,10 @@
|
||||
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;
|
||||
@@ -142,26 +139,17 @@ 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, TickFactorsImmutable? qty_tick_factors = null) {
|
||||
public static ReconcileReportMatchType match_type(this ReconcileReportRowData rd) {
|
||||
if (!rd.has_exch_position() && !rd.has_sys_position()) {
|
||||
return ReconcileReportMatchType.Price | ReconcileReportMatchType.Quantity;
|
||||
}
|
||||
|
||||
// allow for rounding errors
|
||||
var mt = ReconcileReportMatchType.None;
|
||||
|
||||
// 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())) {
|
||||
// allow for rounding error
|
||||
if (rd.sys_quantity().epsilon_equals(rd.exch_quantity())) {
|
||||
mt |= ReconcileReportMatchType.Quantity;
|
||||
}
|
||||
|
||||
// price
|
||||
var price_comp = (rd.security?.ContractSpec)?.tick_equality_comparer()
|
||||
?? MathUtils.epsilon_eq_comparer;
|
||||
if (price_comp.Equals(rd.sys_price(), rd.exch_price())) {
|
||||
if (rd.sys_price().epsilon_equals(rd.exch_price())) {
|
||||
mt |= ReconcileReportMatchType.Price;
|
||||
}
|
||||
return mt;
|
||||
|
||||
@@ -36,10 +36,13 @@ namespace Spark.Trading {
|
||||
rv.sorting_criteria.AddRange(
|
||||
new(nameof(ColKey.Security), true),
|
||||
new(nameof(ColKey.Account), true));
|
||||
rv.grid = GridSettings.Default.with(columns: DefaultColumns.all);
|
||||
rv.grid = default_grid_settings;
|
||||
return rv;
|
||||
}
|
||||
|
||||
public static GridSettings default_grid_settings =>
|
||||
GridSettings.Default.with(columns: DefaultColumns.all);
|
||||
|
||||
public IList<SortingCriteria> sorting_criteria =>
|
||||
_sorting_criteria ??= new(1);
|
||||
|
||||
@@ -119,8 +122,8 @@ namespace Spark.Trading {
|
||||
}
|
||||
|
||||
public static IEnumerable<GridColumnSettings> all =>
|
||||
ReflectionHelper.static_property_getters<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(pg => pg.get());
|
||||
ReflectionHelper.static_property_delegates_of_type<GridColumnSettings>(typeof(DefaultColumns))
|
||||
.Select(g => g());
|
||||
|
||||
static GridColumnSettings _mk(
|
||||
ColKey key,
|
||||
|
||||
@@ -73,10 +73,7 @@
|
||||
<DataTemplate>
|
||||
<TextBlock>
|
||||
<TextBlock.Inlines>
|
||||
<Run
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding security, Mode=OneWay}" />
|
||||
<Run Text="{Binding security, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<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 Style="{StaticResource TextBlock.Dark}">
|
||||
<TextBlock>
|
||||
<TextBlock.Inlines>
|
||||
<Run FontWeight="Bold" Text="{Binding security, Mode=OneWay}" />
|
||||
<Run Text="{Binding security, Mode=OneWay}" FontWeight="Bold"/>
|
||||
<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"/>
|
||||
|
||||
@@ -30,9 +30,6 @@ namespace mbts.analytics {
|
||||
public IObservable<IReadOnlyDictionary<uint, AccountTuple>> accounts_source =>
|
||||
_bus.subscribe(SparkTags.AccountsTag);
|
||||
|
||||
public IObservable<IReadOnlyDictionary<uint, SecurityMD>> security_source =>
|
||||
_bus.subscribe(SparkTags.SecuritiesTag);
|
||||
|
||||
public void save(ReportImmutable r) =>
|
||||
_bus.post(SparkTags.ReportBlackboardTags.Save, r);
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ namespace mbts.analytics {
|
||||
|
||||
public ComboReportCalculator(IBus bus, ReportImmutable report, TimeSpan period) {
|
||||
Log.Ui.info($"ComboReportCalculator init'ed for {report.Id}");
|
||||
var sec_tups = report.HasSecurityCriteria ? VolSurfaceSlideCalculator.get_sec_tups(report.SecurityCriteria) :
|
||||
new HashSet<bts.api.SecurityTuple>();
|
||||
_dispose = bus.subscribe(SparkTags.TradeLogTag)
|
||||
.CombineLatest(bus.subscribe(SparkTags.VolSurfaceNonVolInputTag))
|
||||
.BufferLatest(period)
|
||||
@@ -31,13 +29,6 @@ namespace mbts.analytics {
|
||||
IEnumerable<ITradeLogRow> all_trades,
|
||||
IReadOnlyDictionary<mbts.SecurityTuple, double> cpp_map) {
|
||||
var active_trades = all_trades.Where(t => t.is_active);
|
||||
active_trades = active_trades.Where(t => {
|
||||
foreach (var st in sec_tups)
|
||||
if (st.Symbol == t.symbol && st.Type == t.security_type)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
);
|
||||
var acc_trades = active_trades.Where(t => t.account.iequals(report.InternalAccount));
|
||||
var (out_data, _) = Log.Gen.record(
|
||||
null,
|
||||
|
||||
@@ -7,7 +7,6 @@ namespace mbts.analytics {
|
||||
using bts.utils;
|
||||
|
||||
using mbts.co2;
|
||||
using mbts.spark;
|
||||
using mbts.ui;
|
||||
using mbts.ui.shell;
|
||||
using mbts.ui.utility;
|
||||
@@ -17,20 +16,16 @@ namespace mbts.analytics {
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
class ComboReportConfigurationVM : DisposableViewModelBase {
|
||||
readonly DeferrableActionWrapper _refresh;
|
||||
readonly DelegateProperty<ReportImmutable> _result;
|
||||
readonly Property<SecurityCriteria?> _security_criteria;
|
||||
|
||||
int? _id;
|
||||
string? _name;
|
||||
mbts.SecurityTuple? _risk_terms;
|
||||
IReadOnlyDictionary<uint, SecurityMD> _security_md_map = new Dictionary<uint, SecurityMD>(0);
|
||||
|
||||
public ComboReportConfigurationVM() {
|
||||
_security_criteria = backing<SecurityCriteria?>(nameof(security_criteria));
|
||||
_result = backing(nameof(result), () => {
|
||||
var r = new Report();
|
||||
assign_to(r);
|
||||
@@ -43,7 +38,6 @@ namespace mbts.analytics {
|
||||
ErrorsChanged += (s, e) => commit_cmd.RaiseCanExecuteChanged();
|
||||
internal_account_selector.selected_item_changed += on_internal_account_changed;
|
||||
_validate();
|
||||
_dispose = _security_criteria.OnDispatcher().Subscribe(_ => _refresh.execute());
|
||||
|
||||
void on_internal_account_changed() {
|
||||
RaisePropertyChanged(nameof(internal_account));
|
||||
@@ -98,16 +92,6 @@ namespace mbts.analytics {
|
||||
|
||||
public IReadOnlyList<mbts.SecurityTuple> risk_terms_choices => security_tuples;
|
||||
|
||||
public IReadOnlyDictionary<uint, SecurityMD> security_md_map {
|
||||
get => _security_md_map;
|
||||
set => Set(ref _security_md_map, value);
|
||||
}
|
||||
|
||||
public SecurityCriteria? security_criteria {
|
||||
get => _security_criteria.Value;
|
||||
set => _security_criteria.set(value);
|
||||
}
|
||||
|
||||
public IReadOnlyList<UserSymbol> symbols { get; } =
|
||||
UserSymbol.get_all().OrderBy(us => new mbts.SecurityTuple(us)).ToList();
|
||||
|
||||
@@ -128,7 +112,6 @@ namespace mbts.analytics {
|
||||
}
|
||||
report.ReportName = name ?? string.Empty;
|
||||
report.InternalAccount = internal_account?.name ?? string.Empty;
|
||||
report.SecurityCriteria = security_criteria?.to_criteria() ?? new();
|
||||
|
||||
// risk terms
|
||||
report.RiskTermsName = risk_terms?.security_name ?? string.Empty;
|
||||
@@ -141,8 +124,6 @@ namespace mbts.analytics {
|
||||
name = report.ReportName;
|
||||
internal_account_selector.try_select(report.InternalAccount, true);
|
||||
risk_terms = new(report.RiskTermsType, report.RiskTermsName, report.RiskTermsVenue);
|
||||
security_criteria = report.HasSecurityCriteria ?
|
||||
report.SecurityCriteria.to_criteria() : null;
|
||||
_validate();
|
||||
}
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
x:ClassModifier="internal"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sp="clr-namespace:mbts.spark"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:c="clr-namespace:mbts.ui.controls"
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
Width="350"
|
||||
>
|
||||
<UserControl.Resources>
|
||||
@@ -25,7 +23,6 @@
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- name -->
|
||||
@@ -52,29 +49,5 @@
|
||||
SelectedItem="{Binding risk_terms}"
|
||||
ItemTemplate="{StaticResource SecurityTemplate}"
|
||||
/>
|
||||
|
||||
<!-- Securities -->
|
||||
<TextBlock Grid.Row="3" Margin="8,8,0,0" Tag="{Binding ElementName=PART_SecurityCriteria}">
|
||||
Securities
|
||||
</TextBlock>
|
||||
<c:ContractPickerPopup
|
||||
x:Name="PART_SecurityCriteria"
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Margin="8,8,8,0"
|
||||
VerticalAlignment="Stretch"
|
||||
CloseOnOK="True"
|
||||
SecurityMap="{Binding security_md_map}"
|
||||
SelectedCriteria="{Binding security_criteria}">
|
||||
<c:ContractPickerPopup.Header>
|
||||
<MultiBinding Converter="{x:Static cv:SecurityCriteriaTextConverter.Instance}">
|
||||
<Binding Path="security_criteria" />
|
||||
<Binding
|
||||
Path="DataContext.all_security_mds"
|
||||
RelativeSource="{RelativeSource AncestorType=sp:ContractPickerView}" />
|
||||
</MultiBinding>
|
||||
</c:ContractPickerPopup.Header>
|
||||
</c:ContractPickerPopup>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -8,17 +8,13 @@ namespace mbts.analytics {
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
class ComboReportSettingsVM : DisposableViewModelBase {
|
||||
public ComboReportSettingsVM(
|
||||
IObservable<IReadOnlyDictionary<uint, AccountTuple>> accounts_src,
|
||||
IObservable<IReadOnlyDictionary<uint, SecurityMD>> security_md_src) {
|
||||
IObservable<IReadOnlyDictionary<uint, AccountTuple>> accounts_src) {
|
||||
_dispose = Disposable.Create(
|
||||
accounts_src.OnDispatcher().Subscribe(accs => configuration_vm.internal_account_selector
|
||||
accounts_src.Subscribe(accs => configuration_vm.internal_account_selector
|
||||
.update_items(accs.Values.Cast<AccountTuple?>().Ordered())),
|
||||
security_md_src.OnDispatcher().Subscribe(
|
||||
smds => configuration_vm.security_md_map = smds),
|
||||
configuration_vm.observe_result().Subscribe(_ => RaisePropertyChanged(nameof(result))),
|
||||
configuration_vm.subscribe_has_errors().Subscribe(
|
||||
_ => commit_cmd.RaiseCanExecuteChanged()),
|
||||
|
||||
@@ -45,8 +45,7 @@ namespace mbts.analytics {
|
||||
}
|
||||
|
||||
Window mk_settings_win() {
|
||||
var vm = new ComboReportSettingsVM(
|
||||
model.accounts_source, model.security_source);
|
||||
var vm = new ComboReportSettingsVM(model.accounts_source.OnDispatcher());
|
||||
vm.configuration_vm.load_from(_data.report);
|
||||
var win = new ComboReportSettingsDialog {
|
||||
DataContext = vm
|
||||
|
||||
@@ -40,14 +40,11 @@ namespace mbts.analytics {
|
||||
// Support Data
|
||||
private HighPerformanceTimer _timer = new HighPerformanceTimer();
|
||||
private bool _compute_dirty = false;
|
||||
private HashSet<bts.api.SecurityTuple> _sec_tups;
|
||||
|
||||
internal SlideReportCalculator(bts.api.IBus bus, ReportImmutable report) {
|
||||
Log.Ui.info($"SlideReportCalculator cons report_id: {report.Id} report: {report.ToString()}");
|
||||
_bus = bus;
|
||||
_report = report;
|
||||
_sec_tups = _report.HasSecurityCriteria ? VolSurfaceSlideCalculator.get_sec_tups(_report.SecurityCriteria) :
|
||||
new HashSet<bts.api.SecurityTuple>();
|
||||
#nullable enable
|
||||
_empty_data =
|
||||
new SlideFullData(_report, Enumerable.Empty<SlideGreekUnitKey>(),
|
||||
@@ -147,12 +144,6 @@ namespace mbts.analytics {
|
||||
return false;
|
||||
if (String.Compare(t.account, _report.InternalAccount, true) != 0)
|
||||
return false;
|
||||
if (_report.HasSecurityCriteria) {
|
||||
foreach (var st in _sec_tups)
|
||||
if (st.Symbol == t.symbol && st.Type == t.security_type)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
// if (_ui_override.time_filter.filter == mbts.ui.TimeFilterTuple. &&
|
||||
// t.time_entered < _ui_override.time_filter.date_time)
|
||||
// return false;
|
||||
|
||||
@@ -103,6 +103,8 @@ namespace mbts.analytics {
|
||||
set => Set(ref _security_md_map, value);
|
||||
}
|
||||
|
||||
public bool show_security_criteria_param => false;
|
||||
|
||||
// internal account
|
||||
public SelectorVM<AccountTuple?, string> internal_account_selector { get; } =
|
||||
new(a => a?.name ?? string.Empty);
|
||||
|
||||
@@ -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" BasedOn="{StaticResource TextBlock.Dark}">
|
||||
<Style x:Key="ParameterLabel" TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
@@ -90,8 +90,6 @@
|
||||
<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>
|
||||
@@ -134,8 +132,6 @@
|
||||
<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}"
|
||||
@@ -215,6 +211,7 @@
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
Visibility="{Binding show_security_criteria_param, Converter={x:Static cv:BooleanToVisibilityConverter.Instance}}"
|
||||
Tag="{Binding ElementName=PART_SecurityCriteria}"
|
||||
Style="{StaticResource ParameterLabel}">
|
||||
Securities
|
||||
@@ -226,6 +223,7 @@
|
||||
CloseOnOK="True"
|
||||
SecurityMap="{Binding security_md_map}"
|
||||
SelectedCriteria="{Binding security_criteria}"
|
||||
Visibility="{Binding show_security_criteria_param, Converter={x:Static cv:BooleanToVisibilityConverter.Instance}}"
|
||||
Style="{StaticResource ParameterValue}">
|
||||
<c:ContractPickerPopup.Header>
|
||||
<MultiBinding Converter="{x:Static cv:SecurityCriteriaTextConverter.Instance}">
|
||||
@@ -257,8 +255,7 @@
|
||||
<TextBox
|
||||
x:Name="PART_Handles"
|
||||
Validation.ErrorTemplate="{x:Null}"
|
||||
Text="{Binding handles, Converter={x:Static cv:EnumerableDoubleStringConverter.Instance}}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
Text="{Binding handles, Converter={x:Static cv:EnumerableDoubleStringConverter.Instance}}" />
|
||||
<CheckBox
|
||||
Grid.Column="1"
|
||||
Margin="8,0,0,0"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
<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>
|
||||
@@ -27,12 +26,11 @@
|
||||
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 ListBoxItem.Dark}">
|
||||
BasedOn="{StaticResource {x:Type c:DraggableListBoxItem}}">
|
||||
<Setter Property="IsSelected" Value="{Binding is_selected}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
|
||||
@@ -68,12 +68,7 @@
|
||||
<c:HelpButton ToolTip="If unchecked, Price will only be displayed in the "All" section." />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,5,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="Tick Unit" />
|
||||
<TextBlock Grid.Row="1" Margin="0,5,0,0" Text="Tick Unit" VerticalAlignment="Center" />
|
||||
<c:TickUpDownDouble
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -81,12 +76,7 @@
|
||||
Margin="8,5,0,0"
|
||||
Value="{Binding price_tick_unit}" />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,5,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="Tick Base" />
|
||||
<TextBlock Grid.Row="2" Text="Tick Base" Margin="0,5,0,0" VerticalAlignment="Center" />
|
||||
<c:TickUpDownDouble
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
|
||||
@@ -550,22 +550,6 @@ namespace mbts.analytics {
|
||||
res[i] = a1[i] + a2[i];
|
||||
}
|
||||
|
||||
public static HashSet<bts.api.SecurityTuple> get_sec_tups(
|
||||
bts.api.domain.SecurityCriteriaImmutable sc) {
|
||||
var rv = new HashSet<bts.api.SecurityTuple>();
|
||||
foreach (var c in sc.Clauses)
|
||||
foreach (var s in c.Symbols)
|
||||
foreach (var e in c.Exchanges)
|
||||
foreach (var st in c.SecurityTypes) {
|
||||
var st_i = new bts.api.SecurityTuple();
|
||||
st_i.Symbol = s;
|
||||
st_i.Venue = e.to_venue();
|
||||
st_i.Type = st.to_security_type();
|
||||
rv.Add(st_i);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
<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"
|
||||
@@ -21,6 +20,7 @@
|
||||
<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,33 +69,10 @@
|
||||
</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"/>
|
||||
@@ -119,7 +96,6 @@
|
||||
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>
|
||||
@@ -213,8 +189,7 @@
|
||||
PopupAnimation="None"
|
||||
>
|
||||
<Border
|
||||
x:Name="dropDownBorder"
|
||||
Background="{u:BTSColor UI.ComboBox.dropdown_background}"
|
||||
x:Name="dropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
|
||||
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
|
||||
>
|
||||
@@ -301,9 +276,8 @@
|
||||
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
|
||||
>
|
||||
<Border
|
||||
x:Name="dropDownBorder"
|
||||
BorderThickness="0"
|
||||
Background="{u:BTSColor UI.ComboBox.dropdown_background}"
|
||||
x:Name="dropDownBorder" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
|
||||
BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
|
||||
>
|
||||
<ScrollViewer x:Name="DropDownScrollViewer">
|
||||
@@ -330,16 +304,12 @@
|
||||
Background="{TemplateBinding Background}" Style="{StaticResource ComboBoxToggleButton}"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
/>
|
||||
<Border x:Name="border" Background="Transparent" Margin="{TemplateBinding BorderThickness}">
|
||||
<Border x:Name="border" Background="{StaticResource TextBox.Static.Background}" Margin="{TemplateBinding BorderThickness}">
|
||||
<TextBox
|
||||
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}" />
|
||||
x:Name="PART_EditableTextBox" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}" Margin="{TemplateBinding Padding}"
|
||||
Style="{StaticResource ComboBoxEditableTextBox}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
/>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -366,17 +336,12 @@
|
||||
</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="{StaticResource ComboBox.Static.Foreground}"/>
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Padding" Value="6,3,1,3"/>
|
||||
@@ -384,7 +349,6 @@
|
||||
<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"/>
|
||||
@@ -394,16 +358,12 @@
|
||||
</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="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="Background" Value="#FFFFFFFF"/>
|
||||
<Setter Property="BorderBrush" Value="#FF707070"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type CheckBox}">
|
||||
@@ -491,17 +451,6 @@
|
||||
</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>
|
||||
@@ -532,42 +481,6 @@
|
||||
</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"
|
||||
|
||||
@@ -4,6 +4,7 @@ using mbts.ui.utility;
|
||||
using mbts.utils;
|
||||
|
||||
using Spark.Core.Reactive;
|
||||
using Spark.ViewModel.Commands;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -633,8 +634,9 @@ namespace mbts.ui.shell {
|
||||
|
||||
public abstract class DisposableViewModelBase : ViewModelBaseWithValidation, IPropertyChangedDemuxer, IDisposable, IWillLetYouKnowWhenIDispose {
|
||||
protected IDisposable _dispose = null;
|
||||
List<IDisposable> _observable_properties_backing;
|
||||
List<IDisposable> _observable_properties => _observable_properties_backing ?? (_observable_properties_backing = new List<IDisposable>());
|
||||
|
||||
readonly List<IDisposable> _internal_resources = new(0);
|
||||
|
||||
PropertyChangedDemuxer _property_changed_demuxer_backing;
|
||||
|
||||
IPropertyChangedDemuxer _property_changed_demuxer =>
|
||||
@@ -650,7 +652,7 @@ namespace mbts.ui.shell {
|
||||
|
||||
protected Property<T> backing<T>(string name, IObservable<T> source, T default_value = default(T)) {
|
||||
var prop = new ObservablePropertySink<T>(this, name, default_value);
|
||||
_observable_properties.Add(source.Subscribe(prop));
|
||||
_internal_resources.Add(source.Subscribe(prop));
|
||||
return prop;
|
||||
}
|
||||
|
||||
@@ -660,7 +662,7 @@ namespace mbts.ui.shell {
|
||||
/// </summary>
|
||||
protected Property<T> backing<T, TData>(string name, IObservable<TData> source, Func<TData, T> select, T default_value = default) {
|
||||
var prop = new ObservablePropertySink<T>(this, name, default_value);
|
||||
_observable_properties.Add(source.OnDispatcher().Subscribe(d => prop.set(select(d))));
|
||||
_internal_resources.Add(source.OnDispatcher().Subscribe(d => prop.set(select(d))));
|
||||
return prop;
|
||||
}
|
||||
|
||||
@@ -724,9 +726,35 @@ namespace mbts.ui.shell {
|
||||
return prop;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="ICommand"/> that automatically invokes the CanExecuteChanged event
|
||||
/// in response to notifications from <paramref name="source"/>
|
||||
/// </summary>
|
||||
protected ICommand observant_cmd<T>(
|
||||
Action<T> execute, Func<T, bool> can_execute, IObservable<T> source) {
|
||||
var cmd = ObservantCommand.create(execute, can_execute, out var obs);
|
||||
_internal_resources.Add(source.Subscribe(obs));
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="ICommand"/> that automatically invokes the CanExecuteChanged event
|
||||
/// in response to notifications from <paramref name="source"/>
|
||||
/// </summary>
|
||||
protected ICommand observant_cmd<T>(
|
||||
Func<T, Task> execute,
|
||||
Func<T, bool> can_execute,
|
||||
IObservable<T> source,
|
||||
bool allow_concurrent_executions = false) {
|
||||
var cmd = ObservantAsyncCommand.create(
|
||||
execute, can_execute, out var obs, allow_concurrent_executions);
|
||||
_internal_resources.Add(source.Subscribe(obs));
|
||||
return cmd;
|
||||
}
|
||||
|
||||
protected void attach<T, V>(SelectorProperty<T, V> selector_property, IObservable<IEnumerable<T>> items, IObservable<InlineUserProperty<T>> desired_item) {
|
||||
_observable_properties.Add(items.OnDispatcher().Subscribe(selector_property));
|
||||
_observable_properties.Add(desired_item.OnDispatcher().Subscribe(selector_property));
|
||||
_internal_resources.Add(items.OnDispatcher().Subscribe(selector_property));
|
||||
_internal_resources.Add(desired_item.OnDispatcher().Subscribe(selector_property));
|
||||
}
|
||||
|
||||
protected void set_dispose(IDisposable disposable) {
|
||||
@@ -761,7 +789,7 @@ namespace mbts.ui.shell {
|
||||
protected virtual void Dispose(bool disposing) { }
|
||||
public void Dispose() {
|
||||
Disposable.dispose(ref _dispose);
|
||||
Disposable.dispose(_observable_properties_backing);
|
||||
Disposable.dispose(_internal_resources);
|
||||
Disposable.dispose(ref _property_changed_demuxer_backing);
|
||||
Dispose(true);
|
||||
OnDisposed?.Invoke(true);
|
||||
|
||||
@@ -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.get_constructor(typeof(View), typeof(Model));
|
||||
var constructor = ReflectionHelper.FindApplicableConstructor(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,7 +6,8 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace mbts.ui {
|
||||
class ColorNotFoundException : Exception {
|
||||
public ColorNotFoundException(string name = null, Exception inner = null)
|
||||
: base($"The color '{name}' is not defined in BTSColors", inner) { }
|
||||
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) { }
|
||||
}
|
||||
}
|
||||
@@ -150,9 +150,6 @@
|
||||
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,105 +1,118 @@
|
||||
#nullable enable
|
||||
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;
|
||||
|
||||
namespace mbts.ui {
|
||||
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();
|
||||
[MarkupExtensionReturnType(typeof(object))]
|
||||
public class BTSColorExtension : MarkupExtension {
|
||||
|
||||
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; }
|
||||
|
||||
[ConstructorArgument("mixture")]
|
||||
public string? Mixture { get; set; }
|
||||
public int Lighten { get; set; }
|
||||
public int Darken { get; set; }
|
||||
public int Alpha { 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,80 +1,10 @@
|
||||
|
||||
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 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.SolidColorBrush to_brush(this BTSColor color) =>
|
||||
new(color);
|
||||
|
||||
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 => 0xff17223b;
|
||||
public static BTSColor header { get { return BTSCoreColors.base_blue; } }
|
||||
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 = 0xff76b7fa;
|
||||
ask = 0xffff6666;
|
||||
bid = new BTSColor(0x16, 0x7e, 0xd3);
|
||||
ask = BTSCoreColors.red_darker;
|
||||
_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 => BTSCoreColors.blue_light.with(0x70);
|
||||
public static BTSColor bid_alt { get { return BTSCoreColors.blue_light; } }
|
||||
public static BTSColor ask { get; }
|
||||
public static BTSColor ask_alt => 0x70ffb4b4;
|
||||
public static BTSColor ask_alt { get { return new BTSColor(255, 180, 180); } }
|
||||
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 => Colors.DarkSlateBlue.with(0x63);
|
||||
public static BTSColor grid_selection_background { get { return BTSCoreColors.gray_lighter; } }
|
||||
public static BTSColor grid_selection_border { get { return BTSCoreColors.blue_bright; } }
|
||||
|
||||
public static BTSColor grid_vertical_group_separator { get { return grid_line_dark; } }
|
||||
@@ -334,16 +334,12 @@ namespace mbts.ui {
|
||||
public static BTSColor expiration_seperator { get { return grid_line_dark; } }
|
||||
|
||||
[DisplayInfo(name = "Grid Default Background")]
|
||||
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;
|
||||
public static BTSColor default_column_background { get { return BTSCoreColors.blue_light; } }
|
||||
public static BTSColor light_column_background { get { return BTSCoreColors.white; } }
|
||||
|
||||
// input grid
|
||||
public static BTSColor input_grid_line { get { return BTSCoreColors.black; } }
|
||||
public static BTSColor input_cell_background => default_column_background;
|
||||
public static BTSColor input_cell_foreground => default_column_foreground;
|
||||
public static BTSColor input_cell_background { get { return BTSCoreColors.white; } }
|
||||
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); } }
|
||||
@@ -353,37 +349,28 @@ namespace mbts.ui {
|
||||
}
|
||||
|
||||
public static class Graph {
|
||||
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 BTSColor grid_line { get { return new BTSColor(64, 0, 0, 0); } }
|
||||
}
|
||||
|
||||
public static class UI {
|
||||
[DisplayInfo(name = "Shell Background")]
|
||||
// public static BTSColor default_background => 0xff242424;
|
||||
public static BTSColor default_background => 0xff242431;
|
||||
public static BTSColor default_background { get { return new BTSColor(0xf6, 0xf6, 0xf6); } }
|
||||
[DisplayInfo(name = "Shell Text")]
|
||||
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 default_text { get { return new BTSColor(0x22); } }
|
||||
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 => 0xff363636;
|
||||
public static BTSColor spark_menu_foreground => 0xffc6c6c6;
|
||||
public static BTSColor spark_menu_background { get { return new BTSColor(0xe9); } }
|
||||
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 => 0xff404040;
|
||||
public static BTSColor input_background { get { return new BTSColor(0xff); } }
|
||||
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 => 0x50ffffff;
|
||||
public static BTSColor input_selected_border => 0x803506f;
|
||||
public static BTSColor input_selected_background => 0x8003506f;
|
||||
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 text_prompt_foreground_color => 0x99999999;
|
||||
|
||||
public static BTSColor input_disabled_text => new BTSColor(0x87);
|
||||
@@ -395,18 +382,16 @@ 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 => 0x32ffffff;
|
||||
public static BTSColor normal_background_opaque => 0xff323232;
|
||||
public static BTSColor normal_background { get { return UI.input_background; } }
|
||||
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 => 0xffa6a6a6;
|
||||
public static BTSColor normal_glyph { get { return normal_text; } }
|
||||
public static BTSColor normal_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor normal_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -414,7 +399,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 => normal_glyph;
|
||||
public static BTSColor mouseover_glyph { get { return normal_text; } }
|
||||
public static BTSColor mouseover_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor mouseover_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -422,7 +407,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 => normal_glyph;
|
||||
public static BTSColor focused_glyph { get { return normal_text; } }
|
||||
public static BTSColor focused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor focused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -430,7 +415,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 => normal_glyph;
|
||||
public static BTSColor focused_dropdown_glyph { get { return normal_text; } }
|
||||
public static BTSColor focused_dropdown_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor focused_dropdown_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -438,7 +423,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 => normal_glyph;
|
||||
public static BTSColor unfocused_glyph { get { return normal_text; } }
|
||||
public static BTSColor unfocused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor unfocused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -446,7 +431,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 => normal_glyph;
|
||||
public static BTSColor selected_glyph { get { return normal_text; } }
|
||||
public static BTSColor selected_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor selected_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -454,7 +439,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 => normal_glyph;
|
||||
public static BTSColor disabled_glyph { get { return normal_text; } }
|
||||
public static BTSColor disabled_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor disabled_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -462,7 +447,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 => normal_glyph;
|
||||
public static BTSColor valid_glyph { get { return normal_text; } }
|
||||
public static BTSColor valid_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor valid_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -470,7 +455,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 => normal_glyph;
|
||||
public static BTSColor invalid_focused_glyph { get { return normal_text; } }
|
||||
public static BTSColor invalid_focused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor invalid_focused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -478,7 +463,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 => normal_glyph;
|
||||
public static BTSColor invalid_unfocused_glyph { get { return normal_text; } }
|
||||
public static BTSColor invalid_unfocused_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor invalid_unfocused_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -486,7 +471,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 => normal_glyph;
|
||||
public static BTSColor editable_glyph { get { return normal_text; } }
|
||||
public static BTSColor editable_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor editable_button_background { get { return UI.transparent; } }
|
||||
|
||||
@@ -494,66 +479,36 @@ 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 => normal_glyph;
|
||||
public static BTSColor uneditable_glyph { get { return normal_text; } }
|
||||
public static BTSColor uneditable_button_border { get { return UI.transparent; } }
|
||||
public static BTSColor uneditable_button_background { get { return UI.transparent; } }
|
||||
|
||||
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 BTSColor uncommitted_edit_background => new BTSColor
|
||||
}
|
||||
|
||||
public static class Button {
|
||||
//Note that the launcher menus use buttons with some custom styles
|
||||
|
||||
// Normal
|
||||
public static BTSColor normal_background => 0x32ffffff;
|
||||
public static BTSColor normal_border => 0x00ffffff;
|
||||
public static BTSColor normal_background { get { return new BTSColor(0xe1); } }
|
||||
public static BTSColor normal_border { get { return new BTSColor(0xAC); } }
|
||||
public static BTSColor normal_foreground { get { return UI.default_text; } }
|
||||
|
||||
// MouseOver
|
||||
public static BTSColor mouseover_background => 0x50ffffff;
|
||||
public static BTSColor mouseover_border => 0x00ffffff;
|
||||
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_foreground { get { return normal_foreground; } }
|
||||
|
||||
// Pressed
|
||||
public static BTSColor pressed_background => 0xff707070;
|
||||
public static BTSColor pressed_border => 0xff707070;
|
||||
public static BTSColor pressed_foreground => normal_foreground;
|
||||
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; } }
|
||||
|
||||
|
||||
// Disabled
|
||||
public static BTSColor disabled_background { get { return normal_background; } }
|
||||
public static BTSColor disabled_border { get { return normal_border; } }
|
||||
public static BTSColor disabled_foreground => 0xffa1a1a1;
|
||||
public static BTSColor disabled_foreground { get { return new BTSColor(0x87); } }
|
||||
public static Color disabled_foreground_color => disabled_foreground;
|
||||
public static Brush disabled_foreground_brush => disabled_foreground;
|
||||
|
||||
@@ -587,23 +542,12 @@ namespace mbts.ui {
|
||||
|
||||
|
||||
// IsDefault
|
||||
public static BTSColor IsDefault_background => 0x8003506f;
|
||||
public static BTSColor IsDefault_border => 0x00ffffff;
|
||||
public static BTSColor IsDefault_background { get { return accent1; } }
|
||||
public static BTSColor IsDefault_border { get { return new BTSColor(0); } }
|
||||
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")]
|
||||
@@ -612,10 +556,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 => 0xff919191;
|
||||
public static BTSColor form_content_border { get { return new BTSColor(0xcc, 0xcc, 0xcc); } }
|
||||
|
||||
[DisplayInfo(name = "Shell Dialog Skirt")]
|
||||
public static BTSColor dialog_skirt => 0xff363636;
|
||||
public static BTSColor dialog_skirt { get { return new BTSColor(0xe1, 0xe7, 0xeb); } }
|
||||
|
||||
[DisplayInfo(name = "BTS Success")]
|
||||
public static BTSColor success { get { return new BTSColor(67, 172, 106); } }
|
||||
@@ -693,10 +637,6 @@ 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; } }
|
||||
@@ -707,39 +647,10 @@ namespace mbts.ui {
|
||||
public static BTSColor positive_diff { get { return Color.FromRgb(0, 90, 50); } }
|
||||
}
|
||||
|
||||
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 class LadderSpecial {
|
||||
public static BTSColor passive_volume_bar { get; } = Colors.SlateBlue;
|
||||
public static BTSColor total_volume_bar { get; } = 0x009B69;
|
||||
|
||||
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;
|
||||
public static BTSColor default_column_background { get; } = 0xBABABA;
|
||||
}
|
||||
|
||||
// Style Guide Colors
|
||||
|
||||
@@ -59,11 +59,7 @@ 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
|
||||
@@ -97,8 +93,6 @@ 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
|
||||
@@ -113,8 +107,6 @@ 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
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#nullable enable
|
||||
namespace mbts.ui {
|
||||
using System.Windows.Media;
|
||||
|
||||
static class BTSDarkColors {
|
||||
public static Color light_background => Color.FromArgb(194, 40, 40, 40);
|
||||
public static Color background => Color.FromArgb(194, 20, 20, 20);
|
||||
public static Color dark_background => Color.FromArgb(210, 0, 0, 0);
|
||||
public static Color foreground => Color.FromRgb(236, 246, 255);
|
||||
public static Color bid_foreground => Color.FromRgb(118, 183, 250);
|
||||
public static Color ask_foreground => Color.FromRgb(255, 102, 102);
|
||||
public static Color selection_highlight => Color.FromArgb(96, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
// convert to a hashset for quicker lookups
|
||||
var exclude = new HashSet<string>(except_props);
|
||||
return new PropertyChangeDetector<T>(
|
||||
ReflectionHelper.properties<T>()
|
||||
ReflectionHelper.get_props<T>()
|
||||
.Where(p => !exclude.Contains(p.Name))
|
||||
.Select(p => p.Name)
|
||||
.ToArray());
|
||||
@@ -52,10 +52,9 @@
|
||||
readonly (string name, Action<T> initialize, Func<T, bool> refresh)[] _property_monitors;
|
||||
|
||||
public PropertyChangeDetector() {
|
||||
var num_props = ReflectionHelper.properties<T>().Count;
|
||||
_property_monitors = new (string, Action<T>, Func<T, bool>)[num_props];
|
||||
_property_monitors = new (string name, Action<T> initialize, Func<T, bool> refresh)[ReflectionHelper.get_props<T>().Count];
|
||||
int i = 0;
|
||||
foreach (var pad in ReflectionHelper.property_accessors<T>().Values) {
|
||||
foreach (var pad in ReflectionHelper.prop_accessors<T>().Values) {
|
||||
var (initialize, refresh) = pad.create_snapshot();
|
||||
_property_monitors[i++] = (pad.prop_info.Name, initialize, refresh);
|
||||
}
|
||||
@@ -65,7 +64,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.property_accessors<T>().TryGetValue(props[ppos++], out var pad)) {
|
||||
if (ReflectionHelper.prop_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,7 +3,6 @@
|
||||
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>
|
||||
@@ -17,26 +16,13 @@
|
||||
<Color x:Key="Control.AlphaMediumGrayColor2">#FF0000</Color>
|
||||
<Color x:Key="Control.DarkMediumGrayColor">#FF959595</Color>
|
||||
<Color x:Key="Control.DarkGrayColor">#707070</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}" />
|
||||
<Color x:Key="Text.Prompt.Foreground.Color">#FF999999</Color>
|
||||
|
||||
<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}" />
|
||||
@@ -56,28 +42,29 @@
|
||||
<SolidColorBrush x:Key="dialog_skirt" Color="{mbts:BTSColor Name=UI.dialog_skirt}" />
|
||||
|
||||
<!---TextBox-->
|
||||
<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>
|
||||
<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>
|
||||
|
||||
<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">#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>
|
||||
<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>
|
||||
|
||||
<!--CheckBox-->
|
||||
<Color x:Key="CheckBox.Static.ForegroundColor">#DDDDDD</Color>
|
||||
<Color x:Key="CheckBox.Static.ForegroundColor">#FF212121</Color>
|
||||
<Color x:Key="CheckBox.Static.BackgroundColor">#FFFFFFFF</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>
|
||||
<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>
|
||||
|
||||
<SolidColorBrush x:Key="CheckBox.Static.ForegroundBrush" Color="{StaticResource CheckBox.Static.ForegroundColor}"/>
|
||||
<SolidColorBrush x:Key="CheckBox.Static.BackgroundBrush" Color="{StaticResource CheckBox.Static.BackgroundColor}"/>
|
||||
@@ -96,59 +83,54 @@
|
||||
<Color x:Key="ComboBoxBorderDarkColor">#FF569DE5</Color>
|
||||
<Color x:Key="ComboBoxDisabledBorderColor">#FFD9D9D9</Color>
|
||||
|
||||
<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"/>
|
||||
<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"/>
|
||||
<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="#DDDDDD"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Background" Color="{StaticResource ComboBox.MouseOver.BackgroundColor}" />
|
||||
<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.Border" Color="{StaticResource ComboBoxBorderMediumColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="{StaticResource ComboBox.MouseOver.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.MouseOver.Editable.Border" Color="#FF7EB4EA"/>
|
||||
<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}" />
|
||||
<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.Pressed.Border" Color="{StaticResource ComboBoxBorderDarkColor}"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="{StaticResource ComboBox.Pressed.Editable.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Background" Color="#FFFFFFFF"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Border" Color="#FF569DE5"/>
|
||||
<SolidColorBrush x:Key="ComboBox.Pressed.Editable.Button.Background" Color="{StaticResource ComboBox.Pressed.Editable.Button.BackgroundColor}" />
|
||||
<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.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="{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.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.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>
|
||||
@@ -156,42 +138,10 @@
|
||||
<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,7 +1,6 @@
|
||||
<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"
|
||||
>
|
||||
@@ -11,7 +10,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="{u:BTSColor UI.ComboBox.normal_glyph}" />
|
||||
<Setter Property="BorderBrush" Value="Black"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="Padding" Value="3,0,0,0"/>
|
||||
<Setter Property="Template">
|
||||
@@ -76,11 +75,4 @@
|
||||
</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,27 +211,15 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
Margin="0,4,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="RGBA (Red, Green, Blue, Alpha)" />
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,4,0,0" Text="RGBA (Red, Green, Blue, Alpha)"/>
|
||||
<c:ActionMenu
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Right"
|
||||
ItemsSource="{Binding action_menu_items}"
|
||||
/>
|
||||
</Grid>
|
||||
|
||||
<!--R-->
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="R" />
|
||||
|
||||
<TextBlock Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" Margin="0,2,0,0" Text="R"/>
|
||||
<Slider Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding red, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -241,14 +229,8 @@
|
||||
Height="20"
|
||||
Text="{Binding red, Mode=TwoWay}"
|
||||
/>
|
||||
|
||||
<!--G-->
|
||||
<TextBlock
|
||||
Grid.Row="2"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="G" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" Margin="0,2,0,0" Text="G"/>
|
||||
<Slider Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding green, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -258,14 +240,8 @@
|
||||
Height="20"
|
||||
Text="{Binding green, Mode=TwoWay}"
|
||||
/>
|
||||
|
||||
<!--B-->
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Text="B"
|
||||
Foreground="{u:BTSColor UI.default_text}" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" Margin="0,2,0,0" Text="B"/>
|
||||
<Slider Grid.Column="1" Grid.Row="3" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding blue, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -273,15 +249,10 @@
|
||||
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.Row="4"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="A" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" Margin="0,2,0,0" Text="A"/>
|
||||
<Slider Grid.Column="1" Grid.Row="4" HorizontalAlignment="Stretch" Maximum="255" TickFrequency="1" Value="{Binding alpha, Mode=TwoWay}"/>
|
||||
<TextBox
|
||||
Grid.Column="2"
|
||||
@@ -292,17 +263,9 @@
|
||||
Text="{Binding alpha, Mode=TwoWay}"
|
||||
/>
|
||||
<!--HSL-->
|
||||
<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)" />
|
||||
<TextBlock Grid.Row="5" Grid.ColumnSpan="3" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,4,0,0" Text="HSL (Hue, Saturation, Lightness)"/>
|
||||
<!--H-->
|
||||
<TextBlock
|
||||
Grid.Row="6" Margin="0,2,0,0" Foreground="{u:BTSColor UI.default_text}" Text="H" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="6" Margin="0,2,0,0" 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"
|
||||
@@ -312,14 +275,8 @@
|
||||
Height="20"
|
||||
Text="{Binding hue, Mode=TwoWay, StringFormat='0.###'}"
|
||||
/>
|
||||
|
||||
<!--S-->
|
||||
<TextBlock
|
||||
Grid.Row="7"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="S" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="7" VerticalAlignment="Center" Margin="0,2,0,0" 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"
|
||||
@@ -329,15 +286,8 @@
|
||||
Height="20"
|
||||
Text="{Binding saturation, Mode=TwoWay, StringFormat='0.###'}"
|
||||
/>
|
||||
|
||||
<!--L-->
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Grid.Row="8"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{u:BTSColor UI.default_text}"
|
||||
Text="L" />
|
||||
<TextBlock Grid.Column="0" Grid.Row="8" VerticalAlignment="Center" Margin="0,2,0,0" 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,12 +8,16 @@
|
||||
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>
|
||||
<SolidColorBrush Color="{StaticResource ComboBox.Static.BackgroundColor}" />
|
||||
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundLightColor}" Offset="0.0"/>
|
||||
<GradientStop Color="{StaticResource ComboBoxBackgroundMediumColor}" Offset="1.0"/>
|
||||
</LinearGradientBrush>
|
||||
</c:PopupControl.Background>
|
||||
<c:PopupControl.BorderBrush>
|
||||
<SolidColorBrush Color="{StaticResource ComboBox.Static.BorderColor}"/>
|
||||
<SolidColorBrush Color="{StaticResource ComboBoxBorderLightColor}"/>
|
||||
</c:PopupControl.BorderBrush>
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager AttachToMembers="True">
|
||||
@@ -33,7 +37,8 @@
|
||||
<VisualState Name="Enabled"/>
|
||||
<VisualState Name="Disabled">
|
||||
<Storyboard>
|
||||
<ColorAnimation Storyboard.TargetProperty="(c:PopupControl.Background).(SolidColorBrush.Color)" Duration="0" To="{StaticResource ComboBox.MouseOver.BackgroundColor}"/>
|
||||
<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.BorderBrush).(SolidColorBrush.Color)" Duration="0" To="{StaticResource ComboBoxDisabledBorderColor}"/>
|
||||
<DoubleAnimation Storyboard.TargetProperty="(c:PopupControl.Opacity)" Duration="0" To="0.5"/>
|
||||
</Storyboard>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
<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 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.MergedDictionaries>
|
||||
<ResourceDictionary Source="/view/Colors.xaml"/>
|
||||
<ResourceDictionary Source="/view/Resources/Converters.xaml" />
|
||||
@@ -62,36 +60,19 @@
|
||||
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="{TemplateBinding Background}">
|
||||
<Border x:Name="DropDownBorder" Padding="4,6,4,6">
|
||||
<ScrollViewer 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="White">
|
||||
<Border x:Name="DropDownBorder" BorderThickness="1" BorderBrush="LightGray" CornerRadius="4" Margin="0,2,0,0">
|
||||
<ScrollViewer Margin="4,6,4,6" 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"
|
||||
Style="{DynamicResource CheckBox.Dark}" />
|
||||
<CheckBox Content="All" IsChecked="{Binding IsAllSelected, RelativeSource={RelativeSource TemplatedParent}}" VerticalContentAlignment="Center" />
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
IsItemsHost="True"
|
||||
KeyboardNavigation.DirectionalNavigation="Contained"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}" />
|
||||
<StackPanel Grid.Row="1" IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
@@ -108,7 +89,7 @@
|
||||
|
||||
<Style TargetType="c:ComboCheckBoxItem">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Padding" Value="4,1" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
@@ -134,8 +115,8 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{u:BTSColor UI.ComboBox.mouseover_background}" />
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{u:BTSColor UI.ComboBox.mouseover_border}" />
|
||||
<Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.MouseOver.Background}" />
|
||||
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.MouseOver.Border}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -147,10 +128,9 @@
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="MinHeight" Value="20" />
|
||||
<Setter Property="IsEditable" Value="False" />
|
||||
<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="BorderThickness" Value="1" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBox.Static.Background}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBox.Static.Border}"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="Template" Value="{StaticResource MultiSelectTemplate}" />
|
||||
|
||||
+2
-4
@@ -23,8 +23,7 @@ namespace mbts.ui.controls {
|
||||
public override FrameworkElement view_factory() {
|
||||
var v = new OrderTypeItem {
|
||||
FontFamily = font_family,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Stretch,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
VerticalContentAlignment = VerticalAlignment.Center
|
||||
};
|
||||
v.SetBinding(OrderTypeItem.BadgeFillProperty, _badge_fill_binding);
|
||||
@@ -37,8 +36,7 @@ namespace mbts.ui.controls {
|
||||
bind(FontFamilyProperty, nameof(font_family));
|
||||
bind(FontSizeProperty, nameof(font_size));
|
||||
bind(ForegroundProperty, nameof(font_brush));
|
||||
bind(BackgroundProperty, nameof(background_brush));
|
||||
bind(HorizontalContentAlignmentProperty, nameof(horizontal_alignment));
|
||||
bind(HorizontalAlignmentProperty, nameof(horizontal_alignment));
|
||||
bind(OrderTypeItem.WidthProperty, nameof(ActualWidth));
|
||||
return v;
|
||||
//
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ 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;
|
||||
@@ -31,7 +32,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_brush, horizontal_alignment, vertical_alignment, padding);
|
||||
_get_foreground(side), background, horizontal_alignment, vertical_alignment, padding);
|
||||
}
|
||||
|
||||
static Brush _get_foreground(Side side) {
|
||||
|
||||
@@ -23,39 +23,16 @@ 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_background = null,
|
||||
Func<TRowVM, Brush> get_foreground = null)
|
||||
Func<TRowVM, Brush> get_brush = null)
|
||||
: base() {
|
||||
_get_text = get_text;
|
||||
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);
|
||||
Func<TRowVM, Brush> get_default_background_brush = (TRowVM _) => this.background_brush;
|
||||
_get_background_brush = get_brush ?? get_default_background_brush;
|
||||
this.filter_model = filter;
|
||||
this.filter_template = filter_template;
|
||||
font_params_changed += refresh_glyph_context;
|
||||
@@ -72,37 +49,16 @@ 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,
|
||||
_get_foreground_brush(row),
|
||||
_get_background_brush(row),
|
||||
horizontal_alignment,
|
||||
vertical_alignment,
|
||||
padding);
|
||||
dc, glyph_context, font_size, _get_text(row), position, row_height,
|
||||
font_brush, _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_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 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 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.default_row_background}}"/>
|
||||
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.input_cell_background}}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
||||
<Setter Property="Background" Value="{u:Brush {u:BTSColor Grid.alternate_row_background}}"/>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
namespace mbts.ui.settings {
|
||||
using bts;
|
||||
using bts.proto;
|
||||
using bts.utils;
|
||||
using mbts.ui.converters;
|
||||
|
||||
@@ -20,12 +21,14 @@
|
||||
_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: BTSColors.Grid.grid_selection_background,
|
||||
background: BTSColors.Grid.default_column_background,
|
||||
font_color: BTSColors.Grid.default_column_foreground);
|
||||
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);
|
||||
|
||||
// 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)
|
||||
@@ -39,6 +42,15 @@
|
||||
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);
|
||||
@@ -60,7 +72,24 @@
|
||||
[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;
|
||||
@@ -76,6 +105,9 @@
|
||||
[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;
|
||||
@@ -83,6 +115,7 @@
|
||||
_font_weight = _default_font_weight;
|
||||
_font_color = _default_font_color;
|
||||
_background = _default_background;
|
||||
_enable_background_color = _default_enable_background_color;
|
||||
}
|
||||
|
||||
public GridSettings(
|
||||
@@ -93,7 +126,8 @@
|
||||
uint selection_highlight = 0,
|
||||
IEnumerable<GridColumnSettings> columns = null,
|
||||
IEnumerable<SortingCriteria> sorting_criteria = null,
|
||||
uint background = _default_background) {
|
||||
uint background = _default_background,
|
||||
bool enable_background_color = _default_enable_background_color) {
|
||||
//
|
||||
_font_family = font_family;
|
||||
_font_size = font_size;
|
||||
@@ -103,6 +137,7 @@
|
||||
_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;
|
||||
@@ -112,6 +147,7 @@
|
||||
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));
|
||||
@@ -122,16 +158,19 @@
|
||||
string font_family = null,
|
||||
double font_size = double.NaN,
|
||||
uint? background = null,
|
||||
uint? selection_highlight = null) =>
|
||||
bool? enable_background_color = null,
|
||||
uint? selection_highlight = null,
|
||||
uint? font_color = null) =>
|
||||
new GridSettings(
|
||||
font_family ?? _font_family,
|
||||
DoubleHelper.IsNaNOrInfinityOr(font_size, 0) ? _font_size : font_size,
|
||||
font_weight,
|
||||
_font_color,
|
||||
font_color ?? _font_color,
|
||||
selection_highlight ?? _selection_highlight,
|
||||
columns ?? _columns,
|
||||
sorting_criteria ?? _sorting_criteria,
|
||||
background ?? _background);
|
||||
background ?? _background,
|
||||
enable_background_color ?? _enable_background_color);
|
||||
|
||||
public GridSettings Clone() => with();
|
||||
|
||||
@@ -145,6 +184,7 @@
|
||||
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);
|
||||
@@ -161,6 +201,7 @@
|
||||
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;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations, _show_background_color;
|
||||
readonly OrdersModel _orders_model;
|
||||
readonly IReadOnlyDictionary<string, GridColumnSettingsFeatureFlags> _column_flags;
|
||||
|
||||
@@ -89,6 +89,7 @@ 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);
|
||||
@@ -105,8 +106,9 @@ 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() { bind_opacity_to_alpha = true };
|
||||
public ColorPickerPopupVM background_color { get; } = new ColorPickerPopupVM() { bind_opacity_to_alpha = true };
|
||||
public ColorPickerPopupVM selection_highlight { get; } = new ColorPickerPopupVM();
|
||||
public ColorPickerPopupVM background_color { get; } = new ColorPickerPopupVM();
|
||||
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 => true;
|
||||
public bool show_predicate_animations { get => _show_predicate_animations.Value; set => _show_predicate_animations.set(value); }
|
||||
@@ -138,8 +140,9 @@ 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: background_color.color.with(
|
||||
(byte)(background_color.opacity.within_range(0, 1) * 255.0)).rgb_color()),
|
||||
background: show_background_color ?
|
||||
background_color.color.with((byte)(background_color.opacity.within_range(0, 1) * 255.0)).rgb_color() :
|
||||
Colors.Transparent.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) =>
|
||||
@@ -151,7 +154,14 @@ 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;
|
||||
background_color.color = sd.general.background;
|
||||
_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());
|
||||
}
|
||||
_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,7 +25,6 @@
|
||||
<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>
|
||||
@@ -73,15 +72,20 @@
|
||||
</cv:KeyValue.Value>
|
||||
</cv:KeyValue>
|
||||
</cv:ValueMap>
|
||||
|
||||
<Style TargetType="CheckBox" BasedOn="{StaticResource CheckBox.Dark}"/>
|
||||
|
||||
<Style TargetType="c:ExpanderToggleButton" BasedOn="{StaticResource ExpanderToggleButton.Dark}"/>
|
||||
|
||||
<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="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>
|
||||
@@ -356,12 +360,7 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock>Header</TextBlock>
|
||||
<TextBox
|
||||
x:Name="display_name_text_box"
|
||||
Grid.Column="2"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
Text="{Binding display_name}"
|
||||
Style="{StaticResource TextBox.Dark}" />
|
||||
<TextBox x:Name="display_name_text_box" Grid.Column="2" ToolTipService.ShowOnDisabled="True" Text="{Binding display_name}"/>
|
||||
<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>
|
||||
@@ -370,36 +369,52 @@
|
||||
<ComboBox
|
||||
Grid.Row="6"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
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 HiddenVisibilityConverter}, RelativeSource={RelativeSource AncestorType=usp:GridSettingsView}}"
|
||||
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}"
|
||||
/>
|
||||
|
||||
<CheckBox
|
||||
Grid.Row="10"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding can_override_background_color}"
|
||||
IsChecked="{Binding is_background_color_overridden}">
|
||||
IsChecked="{Binding is_background_color_overridden}"
|
||||
Visibility="{Binding show_background_color, Converter={StaticResource BoolToVisibility}}">
|
||||
Override Background Color
|
||||
</CheckBox>
|
||||
|
||||
<StackPanel Grid.Row="10" Grid.Column="2">
|
||||
<StackPanel Grid.Row="10" Grid.Column="2" Visibility="{Binding show_background_color, Converter={StaticResource BoolToVisibility}}">
|
||||
<c:ColorPickerPopup
|
||||
Grid.Row="10"
|
||||
Grid.Column="2"
|
||||
DataContext="{Binding background_color_override}"
|
||||
Visibility="{Binding
|
||||
DataContext.is_background_color_overridden,
|
||||
Converter={StaticResource HiddenVisibilityConverter},
|
||||
Converter={StaticResource BooleanToVisibilityConverter},
|
||||
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>
|
||||
@@ -422,17 +437,24 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
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 HiddenVisibilityConverter}}"
|
||||
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}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -493,11 +515,12 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
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"
|
||||
@@ -505,7 +528,14 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
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}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -514,7 +544,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -536,11 +566,12 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
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"
|
||||
@@ -548,7 +579,14 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
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}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -557,7 +595,7 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -579,11 +617,12 @@
|
||||
<ComboBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
Visibility="{Binding is_font_weight_overridden, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
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"
|
||||
@@ -591,7 +630,14 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding font_color_override.color}"
|
||||
Palettes="{Binding font_color_override.palettes}"
|
||||
Visibility="{Binding is_font_color_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
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}"
|
||||
/>
|
||||
<CheckBox Grid.Row="4" VerticalAlignment="Top" IsChecked="{Binding is_background_overridden}">Override Background</CheckBox>
|
||||
<c:ColorPickerPopup
|
||||
@@ -600,7 +646,14 @@
|
||||
VerticalAlignment="Top"
|
||||
SelectedColor="{Binding background_override.color}"
|
||||
Palettes="{Binding background_override.palettes}"
|
||||
Visibility="{Binding is_background_overridden, Converter={StaticResource HiddenVisibilityConverter}}"
|
||||
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}"
|
||||
/>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
@@ -802,6 +855,11 @@
|
||||
/>
|
||||
</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"
|
||||
@@ -878,9 +936,9 @@
|
||||
<ColumnDefinition Width="{Binding Source={StaticResource HorizontalGap}}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<c:DragDropListBox Grid.RowSpan="3" MinWidth="200" MaxHeight="200" ItemsSource="{Binding columns}" SelectedItem="{Binding current_column}">
|
||||
<c:DragDropListBox Grid.RowSpan="3" MinWidth="200" MaxHeight="500" ItemsSource="{Binding columns}" SelectedItem="{Binding current_column}">
|
||||
<c:DragDropListBox.ItemContainerStyle>
|
||||
<Style TargetType="c:DraggableListBoxItem" BasedOn="{StaticResource ListBoxItem.Dark}">
|
||||
<Style TargetType="c:DraggableListBoxItem">
|
||||
<Setter Property="Cursor" Value="Arrow"/>
|
||||
</Style>
|
||||
</c:DragDropListBox.ItemContainerStyle>
|
||||
|
||||
@@ -18,6 +18,7 @@ using System.Linq;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
using FontFamily = System.Windows.Media.FontFamily;
|
||||
|
||||
@@ -40,7 +41,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;
|
||||
readonly Property<bool> _show_predicate_animations, _show_cell_predicate_animations, _show_background_color;
|
||||
readonly DeferrableActionWrapper _update;
|
||||
readonly IReadOnlyDictionary<string, GridColumnSettingsFeatureFlags> _column_flags;
|
||||
readonly Func<GridColumnSettings, ISimpleColumnVM> _column_factory;
|
||||
@@ -54,6 +55,7 @@ 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());
|
||||
@@ -88,6 +90,7 @@ 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); }
|
||||
@@ -123,7 +126,9 @@ namespace mbts.spark {
|
||||
font_color.color.rgb_color(),
|
||||
selection_highlight.color.rgb_color(),
|
||||
columns.Select(c => c.create()),
|
||||
background: background_color.color.argb_color());
|
||||
enable_background_color: show_background_color,
|
||||
background: (show_background_color ?
|
||||
background_color.color : Colors.Transparent).argb_color());
|
||||
|
||||
public void load_from(GridSettings value) {
|
||||
if (value == null)
|
||||
@@ -133,7 +138,10 @@ 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;
|
||||
background_color.color = value.background;
|
||||
_show_background_color.set(value.enable_background_color);
|
||||
if (value.enable_background_color) {
|
||||
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));
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
<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>
|
||||
@@ -11,9 +11,8 @@
|
||||
static class DataGridFilterHelper {
|
||||
public static IDisposable hook_all<TSource, TRow>(TSource source, ICollectionView rows) =>
|
||||
hook_filters(rows,
|
||||
ReflectionHelper.property_getters<TSource, IDataGridColumnFilter<TRow>>()
|
||||
.Cut2()
|
||||
.Curry(source)
|
||||
ReflectionHelper.property_delegates_of_type<TSource, IDataGridColumnFilter<TRow>>()
|
||||
.Select(f => f(source))
|
||||
.ExceptNull()
|
||||
.ToList());
|
||||
|
||||
|
||||
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user