-
Notifications
You must be signed in to change notification settings - Fork 15
/
ConnectionDialog.xaml
86 lines (85 loc) · 4.74 KB
/
ConnectionDialog.xaml
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
80
81
82
83
84
85
86
<Window x:Class="OData4.LINQPadDriver.ConnectionDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:OData4.LINQPadDriver"
Title="Connection Details"
Background="{x:Static SystemColors.ControlBrush}"
Width="450"
WindowStartupLocation="CenterScreen"
SizeToContent="Height"
ResizeMode="NoResize">
<StackPanel Orientation="Vertical" Margin="4" >
<Label Margin="0 0 0 4">_URI</Label>
<TextBox Margin="0 0 0 4" Text="{Binding Uri}" Height="20" TabIndex="0"></TextBox>
<GroupBox Header="Log on details" Margin="0 0 0 4" Padding="4">
<StackPanel Orientation="Vertical">
<StackPanel.Resources>
<ui:EnumToBooleanConverter x:Key="EnumToBooleanConverter" />
</StackPanel.Resources>
<RadioButton Margin="0 0 0 4" IsChecked="{Binding Path=AuthenticationType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static ui:AuthenticationType.None}}" TabIndex="1">_No authentication</RadioButton>
<RadioButton Margin="0 0 0 4" IsChecked="{Binding Path=AuthenticationType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static ui:AuthenticationType.Windows}}" TabIndex="2">_Windows authentication</RadioButton>
<RadioButton Margin="0 0 0 4" IsChecked="{Binding Path=AuthenticationType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static ui:AuthenticationType.Basic}}" TabIndex="3" x:Name="BasicAuthentication">_Basic authentication</RadioButton>
<RadioButton Margin="0 0 0 4" IsChecked="{Binding Path=AuthenticationType, Converter={StaticResource EnumToBooleanConverter}, ConverterParameter={x:Static ui:AuthenticationType.ClientCertificate}}" TabIndex="4" x:Name="ClientCertificateAuthentication">_Client certificate authentication</RadioButton>
<StackPanel Margin="40 4 100 4" Orientation="Horizontal">
<StackPanel.Style>
<Style TargetType="StackPanel">
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=ClientCertificateAuthentication}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</StackPanel.Style>
<Label Content="Certificate file:" />
<TextBox Text="{Binding ClientCertificateFile}" HorizontalAlignment="Stretch" Width="190" />
</StackPanel>
<Grid Margin="40 4 100 4">
<Grid.Style>
<Style TargetType="Grid">
<Style.Triggers>
<DataTrigger Binding="{Binding IsChecked, ElementName=BasicAuthentication}" Value="False">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Column="0" Grid.Row="0">_User name</Label>
<TextBox Grid.Column="1" Grid.Row="0" Height="20" TabIndex="4" Text="{Binding UserName}"></TextBox>
<Label Grid.Column="0" Grid.Row="1">_Password</Label>
<PasswordBox Grid.Column="1" Grid.Row="1" Height="20" TabIndex="5" x:Name="PasswordBox" PasswordChanged="PasswordBox_OnPasswordChanged" />
<Label Grid.Column="0" Grid.Row="2">_Domain (optional)</Label>
<TextBox Grid.Column="1" Grid.Row="2" Height="20" TabIndex="5" Text="{Binding Domain}"></TextBox>
</Grid>
</StackPanel>
</GroupBox>
<CheckBox Margin="0 0 0 4" TabIndex="6" IsChecked="{Binding Persist}">_Remember this connection</CheckBox>
<Expander Header="_Advanced" Margin="0 0 0 4" TabIndex="7">
<StackPanel Margin="40 0 0 0">
<CheckBox Margin="6 4 0 0" TabIndex="8" IsChecked="{Binding AcceptInvalidCertificate}">Accept invalid certificates</CheckBox>
<CheckBox Margin="6 4 0 0" TabIndex="8" IsChecked="{Binding UseProxy}">Use LINQPad web proxy</CheckBox>
<GroupBox Header="Logging">
<StackPanel>
<CheckBox Margin="6,4,0,0" IsChecked="{Binding LogMethod}" TabIndex="11">Method</CheckBox>
<CheckBox Margin="6,4,0,0" IsChecked="{Binding LogHeaders}" TabIndex="12">Headers</CheckBox>
<Label TabIndex="10">
<Hyperlink Click="Hyperlink_Click">Custom Headers...</Hyperlink>
</Label>
</StackPanel>
</GroupBox>
</StackPanel>
</Expander>
<DockPanel Margin="0 10 0 0" LastChildFill="False" HorizontalAlignment="Right">
<Button IsDefault="True" Margin="4 0 0 0" Width="60" TabIndex="13" Click="OnOkClick">_OK</Button>
<Button IsCancel="True" Margin="4 0 0 0" Width="60" TabIndex="14">_Cancel</Button>
</DockPanel>
</StackPanel>
</Window>