aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Synchronization/Views/DirectSynchronizationView.xaml
blob: 39c21e3f5b2adc79cb813ff25f03f396b6fbc63f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #888888 } /* Comment.Hashbang */
.highlight .cm { color: #888888 } /* Comment.Multiline */
.highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */
.highlight .cpf { color: #888888 } /* Comment.PreprocFile */
.highlight .c1 { color: #888888 } /* Comment.Single */
.highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */
.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #aa0000 } /* Generic.Error */
.highlight .gh { color: #333333 } /* Generic.Heading */
.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #555555 } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #666666 } /* Generic.Subheading */
.highlight .gt { color: #aa0000 } /* Generic.Traceback */
.highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008800 } /* Keyword.Pseudo */
.highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */
.highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */
.highlight .na { color: #336699 } /* Name.Attribute */
.highlight .nb { color: #003388 } /* Name.Builtin */
.highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */
.highlight .no { color: #003366; font-weight: bold } /* Name.Constant */
.highlight .nd { color: #555555 } /* Name.Decorator */
.highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */
.highlight .nl { color: #336699; font-style: italic } /* Name.Label */
.highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */
.highlight .py { color: #336699; font-weight: bold } /* Name.Property */
.highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #336699 } /* Name.Variable */
.highlight .ow { color: #008800 } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */
.highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */
.highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */
.highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */
.highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */
.highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */
.highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */
.highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */
.highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */
.highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */
.highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */
.highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */
.highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */
.highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */
.highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */
.highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */
.highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */
.highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */
.highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */
.highlight .vc { color: #336699 } /* Name.Variable.Class */
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */
.highlight .vi { color: #3333bb } /* Name.Variable.Instance */
.highlight .vm { color: #336699 } /* Name.Variable.Magic */
.highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<UserControl x:Class="Tango.MachineStudio.Synchronization.Views.MenuView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Tango.MachineStudio.Synchronization.Views"
             xmlns:global="clr-namespace:Tango.MachineStudio.Synchronization"
             mc:Ignorable="d" 
             d:DesignHeight="720" d:DesignWidth="1280" DataContext="{x:Static global:ViewModelLocator.MenuViewVM}">
    <Grid>
        <Grid>
            <Viewbox MaxWidth="1600">
                <UniformGrid Columns="3">
                    <Grid VerticalAlignment="Center">
                        <StackPanel>
                            <StackPanel HorizontalAlignment="Center" Margin="0 0 0 30">
                                <TextBlock TextAlignment="Center" FontSize="25">Local Synchronization</TextBlock>
                                <TextBlock TextAlignment="Center" FontSize="14" Foreground="#303030">Synchronize two SQLite local database files.</TextBlock>
                            </StackPanel>
                            <Viewbox RenderOptions.BitmapScalingMode="Fant" Width="400">
                                <Grid Width="450">
                                    <StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="../Images/sqlite.png" Width="160"></Image>
                                            <Image Source="../Images/arrow_right.png" Width="100" RenderTransformOrigin="0.5,0.5"></Image>
                                            <Image Source="../Images/sqlite.png" Width="130"></Image>
                                        </StackPanel>

                                        <Button Command="{Binding StartLocalSyncCommand}" Height="80" Margin="0 20 0 0" HorizontalAlignment="Center" Padding="10" FontSize="20" Width="200">START</Button>
                                    </StackPanel>
                                </Grid>
                            </Viewbox>
                        </StackPanel>
                    </Grid>

                    <Grid VerticalAlignment="Center">
                        <StackPanel>
                            <StackPanel HorizontalAlignment="Center" Margin="0 0 0 30">
                                <TextBlock TextAlignment="Center" FontSize="25">Direct Remote Synchronization</TextBlock>
                                <TextBlock TextAlignment="Center" FontSize="14" Foreground="#303030">Connect and synchronized a Tango machine over the network.</TextBlock>
                            </StackPanel>
                            <Viewbox RenderOptions.BitmapScalingMode="Fant" Width="400">
                                <Grid Width="450">
                                    <StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="../Images/remote-db.png" Width="200"></Image>
                                            <Image Source="../Images/arrow_right.png" Width="100"></Image>
                                            <Image Source="../Images/machine-trans.png" Width="120"></Image>
                                        </StackPanel>

                                        <Button Command="{Binding StartDirectRemoteSyncCommand}" Height="80"  Margin="0 20 0 0" HorizontalAlignment="Center" Padding="10" FontSize="20" Width="200">START</Button>
                                    </StackPanel>
                                </Grid>
                            </Viewbox>
                        </StackPanel>
                    </Grid>

                    <Grid VerticalAlignment="Center">
                        <StackPanel>
                            <StackPanel HorizontalAlignment="Center" Margin="0 0 0 30">
                                <TextBlock TextAlignment="Center" FontSize="25">Semi Remote Synchronization</TextBlock>
                                <TextBlock TextAlignment="Center" FontSize="14" Foreground="#303030">Synchronize local SQLite database file with the remote Twine database.</TextBlock>
                            </StackPanel>
                            <Viewbox RenderOptions.BitmapScalingMode="Fant" Width="400">
                                <Grid Width="450">
                                    <StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <Image Source="../Images/remote-db.png" Width="200"></Image>
                                            <Image Source="../Images/arrow_right.png" Width="100"></Image>
                                            <Image Source="../Images/sqlite.png" Width="120"></Image>
                                        </StackPanel>

                                        <Button Command="{Binding StartRemoteSyncCommand}" Height="80" Margin="0 20 0 0" HorizontalAlignment="Center" Padding="10" FontSize="20" Width="200">START</Button>
                                    </StackPanel>
                                </Grid>
                            </Viewbox>
                        </StackPanel>
                    </Grid>

                </UniformGrid>
            </Viewbox>
        </Grid>
    </Grid>
</UserControl>
<Path.Data> <PathGeometry Figures="M 53.868 43.913 H 19.511 c -0.444 0 -0.875 -0.151 -1.221 -0.428 L 0.734 29.439 c -0.978 -0.783 -0.978 -2.271 0 -3.053 L 18.29 12.341 c 0.347 -0.277 0.777 -0.428 1.221 -0.428 h 34.356 c 1.081 0 1.958 0.877 1.958 1.958 v 28.084 c 0 1.081 -0.876 1.958 -1.957 1.958 z" FillRule="NonZero"/> </Path.Data> </Path> </Border> </VisualBrush.Visual> </VisualBrush> </UserControl.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="100" /> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Grid> <StackPanel Orientation="Horizontal" Margin="20"> <Button Style="{StaticResource MaterialDesignFlatButton}" Padding="0" Margin="0 5 0 0" VerticalAlignment="Center" Command="{Binding BackCommand}"> <materialDesign:PackIcon Kind="ArrowLeft" Foreground="#303030" ToolTip="Back" VerticalAlignment="Center" Width="40" Height="40"></materialDesign:PackIcon> </Button> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="30">Direct Database Synchronization</TextBlock> </StackPanel> </Grid> <Grid Margin="20" Grid.Row="1"> <GroupBox Header="Compare &amp; Synchronize"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="57*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition MaxWidth="250" /> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid> <Grid.RowDefinitions> <RowDefinition Height="1*"/> <RowDefinition Height="1*"/> </Grid.RowDefinitions> <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center" Margin="20 0 0 0"> <Image Source="../Images/remote-db.png" Width="100" Margin="10" Opacity="0.8" HorizontalAlignment="Left" RenderOptions.BitmapScalingMode="Fant"></Image> <TextBlock Background="{StaticResource badgeBackground}" Padding="5" Width="200" FontSize="14" HorizontalAlignment="Left">Remote Database</TextBlock> <StackPanel Orientation="Horizontal" Margin="0 5 0 0"> <fa:ImageAwesome Icon="Key" Width="16" Height="16"></fa:ImageAwesome> <autoComplete:AutoCompleteTextBox Margin="5 0 0 0" IsEnabled="{Binding IsWorking,Converter={StaticResource BooleanInverseConverter}}" Width="170" materialDesign:HintAssist.Hint="Enter machine serial number" DisplayMember="SerialNumber" Provider="{StaticResource ResourceKey=MachinesProvider}" SelectedItem="{Binding SelectedMachine,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"> <autoComplete:AutoCompleteTextBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding SerialNumber}"></TextBlock> </DataTemplate> </autoComplete:AutoCompleteTextBox.ItemTemplate> <autoComplete:AutoCompleteTextBox.LoadingContent> <TextBlock Text="Loading..." Margin="5" FontSize="14" /> </autoComplete:AutoCompleteTextBox.LoadingContent> </autoComplete:AutoCompleteTextBox> </StackPanel> </StackPanel> <StackPanel Margin="20 0 0 0" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1" > <Image Source="../Images/machine-trans.png" RenderOptions.BitmapScalingMode="Fant" Width="110"></Image> <TextBlock Margin="0 20 0 0"> <Run FontWeight="Bold">IP Address:</Run> <Run Text="{Binding ApplicationManager.ConnectedMachine.IPAddress,Mode=OneWay}"></Run> </TextBlock> <TextBlock Margin="0 5 0 0"> <Run FontWeight="Bold">Serial Number:</Run> <Run Text="{Binding ApplicationManager.ConnectedMachine.SerialNumber,Mode=OneWay}"></Run> </TextBlock> <TextBlock Margin="0 5 0 0"> <Run FontWeight="Bold">Organization:</Run> <Run Text="{Binding ApplicationManager.ConnectedMachine.Organization,Mode=OneWay}"></Run> </TextBlock> </StackPanel> </Grid> <Button Margin="20 10" Grid.Row="1" Width="200" Height="40" HorizontalAlignment="Left" Command="{Binding CompareCommand}"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">COMPARE</TextBlock> <fa:ImageAwesome Icon="LongArrowRight" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome> </StackPanel> </Button> <Grid Grid.Column="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="625*"/> <ColumnDefinition Width="347*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="20"/> <RowDefinition Height="205*"/> </Grid.RowDefinitions> <TextBlock Margin="10 5 0 0" FontSize="14">Differences</TextBlock> <ListBox Margin="10" Background="#F1F1F1" Grid.Row="1" ItemsSource="{Binding Differences}" SelectedItem="{Binding SelectedDifference,Mode=TwoWay}"> <ListBox.ItemTemplate> <DataTemplate> <Border Padding="10"> <StackPanel Orientation="Horizontal"> <fa:ImageAwesome Icon="Cog" Width="20" Height="20" Foreground="Gray"></fa:ImageAwesome> <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Text="{Binding Description}"> <TextBlock.Style> <Style TargetType="TextBlock"> <Setter Property="Foreground" Value="Red"></Setter> <Style.Triggers> <DataTrigger Binding="{Binding Action}" Value="ReplaceTableDataInSlave"> <Setter Property="Foreground" Value="#404040"></Setter> </DataTrigger> </Style.Triggers> </Style> </TextBlock.Style> </TextBlock> </StackPanel> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <TextBlock Margin="10 0 0 0" VerticalAlignment="Bottom" Grid.Column="1">SQL Command</TextBlock> <TextBox Grid.Column="1" Margin="10" Style="{x:Null}" BorderThickness="0" Foreground="Gray" FontSize="14" Text="{Binding SelectedDifference.Command,Mode=OneWay}" IsReadOnly="True" Background="#F1F1F1" Padding="5" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" AcceptsReturn="True" Grid.Row="1"></TextBox> </Grid> <Grid Grid.Row="1" Grid.Column="1"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal" Margin="0 0 20 0"> <TextBlock>Clear Machine Before Synchronization</TextBlock> <ToggleButton Margin="10 0 0 0" IsChecked="{Binding IsClearMachine}" Foreground="Red" Style="{StaticResource MaterialDesignSwitchToggleButton}" ></ToggleButton> </StackPanel> <Button Margin="10 10" Grid.Row="1" Width="160" Height="40" HorizontalAlignment="Right" Command="{Binding CommitAllCommand}"> <StackPanel Orientation="Horizontal"> <TextBlock VerticalAlignment="Center" Margin="10 0 10 0">SYNCHRONIZE</TextBlock> <fa:ImageAwesome Icon="SortAmountAsc" VerticalAlignment="Center" Foreground="{Binding RelativeSource={RelativeSource AncestorType=Button},Path=Foreground}" Width="16"></fa:ImageAwesome> </StackPanel> </Button> </StackPanel> </Grid> </Grid> </GroupBox> </Grid> <Grid Grid.Row="1" Visibility="{Binding ApplicationManager.IsMachineConnectedViaTCP,Converter={StaticResource BooleanToVisibilityInverseConverter}}"> <Grid.Background> <SolidColorBrush Color="White" Opacity="0.8"></SolidColorBrush> </Grid.Background> <TextBlock Foreground="Silver" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="40"> <TextBlock.Style> <Style TargetType="TextBlock"> <Style.Triggers> <EventTrigger RoutedEvent="Loaded"> <BeginStoryboard> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Duration="00:00:01" RepeatBehavior="Forever"> <LinearDoubleKeyFrame Value="0" KeyTime="00:00:00"></LinearDoubleKeyFrame> <LinearDoubleKeyFrame Value="1" KeyTime="00:00:0.5"></LinearDoubleKeyFrame> </DoubleAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </Style.Triggers> </Style> </TextBlock.Style> No Machine Connection </TextBlock> </Grid> </Grid> </UserControl>