Skip to content

Commit

Permalink
Added the possibility to copy WiFi details (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Aug 17, 2022
1 parent 668ac62 commit 51b43b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 6 additions & 0 deletions InternetTest/InternetTest/Classes/WLANProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,10 @@ public class WLANProfile

[XmlElement(ElementName = "MSM")]
public MSM? MSM { get; set; }

public override string ToString() => $"{Properties.Resources.Authentication}: {MSM?.Security?.AuthEncryption?.Authentication}\n" +
$"{Properties.Resources.Key}: {MSM?.Security?.SharedKey?.KeyMaterial}\n" +
$"{Properties.Resources.Encryption}: {MSM?.Security?.AuthEncryption?.Encryption}\n" +
$"{Properties.Resources.ConnectionMode}: {(ConnectionMode == "auto" ? Properties.Resources.Automatic : ConnectionMode)}\n" +
$"{Properties.Resources.ConnectionType}: {ConnectionType switch { "ESS" => Properties.Resources.InfrastructureNetwork, "IBSS" => Properties.Resources.AdHocNetwork, _ => ConnectionType }}";
}
12 changes: 6 additions & 6 deletions InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
<TextBlock x:Name="AuthTxt" d:Text="OK" FontWeight="Bold" Grid.Column="1" Grid.Row="0" Margin="15,0,0,0" TextWrapping="Wrap"/>

<TextBlock Text="{x:Static lang:Resources.Key}" FontWeight="Bold" Grid.Row="1"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
<TextBlock x:Name="PasswordTxt" d:Text="123.21.43.65" FontWeight="Bold" Grid.Column="1" Grid.Row="1" Margin="15,0,0,0" TextWrapping="Wrap"/>
<Button Click="ShowKeyBtn_Click" Content="&#xF3FC;" Padding="5" FontFamily="../Fonts/#FluentSystemIcons-Regular" Grid.Column="1" x:Name="ShowKeyBtn" Background="Transparent" Style="{DynamicResource DefaultButton}" Margin="0,0,5,0"/>
<Button Click="CopyKeyBtn_Click" Content="&#xF32C;" Padding="5" FontFamily="../Fonts/#FluentSystemIcons-Regular" Grid.Column="1" x:Name="CopyKeyBtn" Background="Transparent" Style="{DynamicResource DefaultButton}" Margin="0,0,5,0"/>
</StackPanel>
<TextBlock Text="{x:Static lang:Resources.Encryption}" FontWeight="Bold" Grid.Row="2"/>
<StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1">
<TextBlock x:Name="PasswordTxt" d:Text="123.21.43.65" FontWeight="Bold" Grid.Column="1" Grid.Row="1" Margin="15,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center"/>
<Button Click="ShowKeyBtn_Click" Content="&#xF3FC;" Padding="5" FontFamily="../Fonts/#FluentSystemIcons-Regular" Grid.Column="1" x:Name="ShowKeyBtn" Background="Transparent" Style="{DynamicResource DefaultButton}" Margin="5,0,5,0" VerticalAlignment="Center"/>
<Button Click="CopyKeyBtn_Click" Content="&#xF32C;" Padding="5" FontFamily="../Fonts/#FluentSystemIcons-Regular" Grid.Column="1" x:Name="CopyKeyBtn" Background="Transparent" Style="{DynamicResource DefaultButton}" Margin="0,0,5,0" VerticalAlignment="Center"/>
</StackPanel>
<TextBlock Text="{x:Static lang:Resources.Encryption}" FontWeight="Bold" Grid.Row="2"/>
<TextBlock x:Name="EncryptionTxt" d:Text="123.21.43.65" FontWeight="Bold" Grid.Column="1" Grid.Row="2" Margin="15,0,0,0" TextWrapping="Wrap"/>

<TextBlock Text="{x:Static lang:Resources.ConnectionType}" FontWeight="Bold" Grid.Row="3"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private void InitUI()

private void CopyBtn_Click(object sender, RoutedEventArgs e)
{

Clipboard.SetDataObject(WLANProfile.ToString());
}

private void ExpanderBtn_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit 51b43b3

Please sign in to comment.