Skip to content

Commit

Permalink
Version 1.8.2.0 (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
BornToBeRoot authored Dec 11, 2018
1 parent b34ee35 commit 99f7a44
Show file tree
Hide file tree
Showing 167 changed files with 6,223 additions and 2,552 deletions.
2 changes: 1 addition & 1 deletion Choco/networkmanager.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>NETworkManager</id>
<version>1.8.0.0</version>
<version>1.8.1.0</version>
<owners>BornToBeRoot</owners>
<title>NETworkManager</title>
<authors>BornToBeRoot</authors>
Expand Down
4 changes: 2 additions & 2 deletions Choco/tools/chocolateyinstall.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

$ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/BornToBeRoot/NETworkManager/releases/download/v1.8.0.0/NETworkManager_v1.8.0.0_Setup.msi'
$url = 'https://github.com/BornToBeRoot/NETworkManager/releases/download/v1.8.1.0/NETworkManager_v1.8.1.0_Setup.msi'

$packageArgs = @{
packageName = $env:ChocolateyPackageName
Expand All @@ -11,7 +11,7 @@ $packageArgs = @{

softwareName = 'NETworkManager*'

checksum = 'F3470CA8626A0E2E8A7342D7EC6E1280B7955281B49F162B63215D1FB038AD67'
checksum = 'CB2F9B4B1A269965AC26D3C5FE7D76D4D2B7CAED59549CF8599F83E2032CCF37'
checksumType = 'sha256'

silentArgs = "/qn /norestart /l*v `"$($env:TEMP)\$($packageName).$($env:chocolateyPackageVersion).MsiInstall.log`""
Expand Down
File renamed without changes.
File renamed without changes
Binary file added Images/SplashScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/SplashScreen.xcf
Binary file not shown.
Binary file added Images/SplashScreen_large.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/SplashScreen_large.xcf
Binary file not shown.
6 changes: 6 additions & 0 deletions Source/NETworkManager.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=AES/@EntryIndexedValue">AES</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ARP/@EntryIndexedValue">ARP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CNAME/@EntryIndexedValue">CNAME</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CSV/@EntryIndexedValue">CSV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DES/@EntryIndexedValue">DES</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DNS/@EntryIndexedValue">DNS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=HTTP/@EntryIndexedValue">HTTP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=ID/@EntryIndexedValue">ID</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=IP/@EntryIndexedValue">IP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=JSON/@EntryIndexedValue">JSON</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=LAN/@EntryIndexedValue">LAN</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MAC/@EntryIndexedValue">MAC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=MD/@EntryIndexedValue">MD</s:String>
Expand All @@ -23,8 +25,12 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SNMPV/@EntryIndexedValue">SNMPV</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SSH/@EntryIndexedValue">SSH</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TCP/@EntryIndexedValue">TCP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TTL/@EntryIndexedValue">TTL</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TTY/@EntryIndexedValue">PuTTY</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TXT/@EntryIndexedValue">TXT</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue">UI</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VNC/@EntryIndexedValue">VNC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=XML/@EntryIndexedValue">XML</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=CIDR/@EntryIndexedValue">CIDR</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=DNS/@EntryIndexedValue">DNS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/XamlNaming/Abbreviations/=HTTP/@EntryIndexedValue">HTTP</s:String>
Expand Down
3 changes: 3 additions & 0 deletions Source/NETworkManager/Controls/DragablzTabHostWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
<Setter Property="Foreground" Value="{DynamicResource GrayBrush3}" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dragablz:DragablzItem}}, Path=IsMouseOver}" Value="True">
<Setter Property="Foreground" Value="{DynamicResource GrayBrush5}" />
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type dragablz:DragablzItem}}, Path=IsSelected}" Value="True">
<Setter Property="Foreground" Value="{DynamicResource AccentColorBrush}" />
</DataTrigger>
Expand Down
41 changes: 41 additions & 0 deletions Source/NETworkManager/Controls/MultiSelectScrollingDataGrid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Specialized;
using System.Windows;
using System.Windows.Controls;

namespace NETworkManager.Controls
{
public class MultiSelectScrollingDataGrid : DataGrid
{
public MultiSelectScrollingDataGrid()
{
SelectionChanged += DataGridMultiItemSelect_SelectionChanged;
}

private void DataGridMultiItemSelect_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
SelectedItemsList = SelectedItems;
}

public IList SelectedItemsList
{
get => (IList)GetValue(SelectedItemsListProperty);
set => SetValue(SelectedItemsListProperty, value);
}

public static readonly DependencyProperty SelectedItemsListProperty = DependencyProperty.Register("SelectedItemsList", typeof(IList), typeof(MultiSelectScrollingDataGrid), new PropertyMetadata(null));

protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
{
if (e.NewItems == null)
return;

var newItemCount = e.NewItems.Count;

if (newItemCount > 0)
ScrollIntoView(e.NewItems[newItemCount - 1]);

base.OnItemsChanged(e);
}
}
}
25 changes: 24 additions & 1 deletion Source/NETworkManager/Controls/RemoteDesktopControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@
<converters:BooleanToVisibilityCollapsedConverter x:Key="BooleanToVisibilityCollapsedConverter" />
</UserControl.Resources>
<Grid x:Name="RdpGrid" SizeChanged="RdpGrid_SizeChanged">
<WindowsFormsHost MaxWidth="{Binding RdpClientWidth, Mode=OneWay}" MaxHeight="{Binding RdpClientHeight, Mode=OneWay}" Visibility="{Binding IsConnected, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<WindowsFormsHost MaxWidth="{Binding RdpClientWidth, Mode=OneWay}" MaxHeight="{Binding RdpClientHeight, Mode=OneWay}">
<WindowsFormsHost.Style>
<Style TargetType="{x:Type WindowsFormsHost}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsConnected}" Value="False">
<Setter Property="Visibility" Value="Hidden" />
</DataTrigger>
<DataTrigger Binding="{Binding IsReconnecting}" Value="True">
<Setter Property="Visibility" Value="Hidden" />
</DataTrigger>
</Style.Triggers>
</Style>
</WindowsFormsHost.Style>
<mstsc:AxMsRdpClient9NotSafeForScripting x:Name="RdpClient" />
</WindowsFormsHost>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center" TextBlock.TextAlignment="Center" Visibility="{Binding IsConnected, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}">
Expand All @@ -32,5 +44,16 @@
<Button Grid.Row="3" Content="{x:Static localization:Strings.Reconnect}" Command="{Binding ReconnectCommand}" Visibility="{Binding IsConnecting, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}" IsDefault="True" IsEnabled="{Binding IsConnecting, Converter={StaticResource BooleanReverseConverter}}" Style="{StaticResource DefaultButton}"/>
<TextBlock Grid.Row="3" Text="{x:Static localization:Strings.ConnectingDots}" Style="{StaticResource MessageTextBlock}" Visibility="{Binding IsConnecting, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" />
</Grid>
<Grid VerticalAlignment="Center" HorizontalAlignment="Center" TextBlock.TextAlignment="Center" Visibility="{Binding IsReconnecting, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="20" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<mah:ProgressRing Grid.Row="0" Grid.RowSpan="2" Height="50" Width="50" />
<TextBlock Grid.Row="3" Text="{x:Static localization:Strings.ConnectingDots}" Style="{StaticResource MessageTextBlock}" />
</Grid>

</Grid>
</UserControl>
50 changes: 32 additions & 18 deletions Source/NETworkManager/Controls/RemoteDesktopControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Windows;
using System.Windows.Input;
using System;
using System.Windows.Threading;
using System.Threading.Tasks;
using NETworkManager.Utilities;

namespace NETworkManager.Controls
Expand All @@ -25,8 +25,6 @@ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName

private readonly RemoteDesktopSessionInfo _rdpSessionInfo;

private readonly DispatcherTimer _reconnectAdjustScreenTimer = new DispatcherTimer();

// Fix WindowsFormsHost width
private double _rdpClientWidth;
public double RdpClientWidth
Expand Down Expand Up @@ -98,6 +96,20 @@ public string DisconnectReason
OnPropertyChanged();
}
}

private bool _isReconnecting;
public bool IsReconnecting
{
get => _isReconnecting;
set
{
if (value == _isReconnecting)
return;

_isReconnecting = value;
OnPropertyChanged();
}
}
#endregion

#region Constructor, load
Expand All @@ -108,20 +120,17 @@ public RemoteDesktopControl(RemoteDesktopSessionInfo info)

_rdpSessionInfo = info;

_reconnectAdjustScreenTimer.Tick += ReconnectAdjustScreenTimer_Tick;
_reconnectAdjustScreenTimer.Interval = new TimeSpan(0, 0, 0, 0, 500);

Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
}

private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
// Connect after the control is drawn and only on the first init
if (!_initialized)
{
Connect();
_initialized = true;
}
if (_initialized)
return;

Connect();
_initialized = true;
}

private void Dispatcher_ShutdownStarted(object sender, EventArgs e)
Expand Down Expand Up @@ -357,18 +366,23 @@ private void RdpClient_OnDisconnected(object sender, AxMSTSCLib.IMsTscAxEvents_O

private void RdpGrid_SizeChanged(object sender, SizeChangedEventArgs e)
{
// Prevent with a timer, that the function (rdpClient.Reconnect()) is executed too often
if (IsConnected && _rdpSessionInfo.AdjustScreenAutomatically)
_reconnectAdjustScreenTimer.Start();
if (IsConnected && _rdpSessionInfo.AdjustScreenAutomatically && !IsReconnecting)
InitiateReconnection();
}

private void ReconnectAdjustScreenTimer_Tick(object sender, EventArgs e)
private async void InitiateReconnection()
{
// Stop timer
_reconnectAdjustScreenTimer.Stop();
IsReconnecting = true;

do
{
await Task.Delay(500);

} while (Mouse.LeftButton == MouseButtonState.Pressed);

// Reconnect with new resulution
ReconnectAdjustScreen();

IsReconnecting = false;
}
#endregion
}
Expand Down
21 changes: 0 additions & 21 deletions Source/NETworkManager/Controls/ScrollingDataGrid.cs

This file was deleted.

3 changes: 2 additions & 1 deletion Source/NETworkManager/Converters/AccentToStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Globalization;
using System.Windows.Data;
using NETworkManager.Models.Settings;

namespace NETworkManager.Converters
{
Expand All @@ -13,7 +14,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (!(value is Accent accent))
return "No valid accent passed!";

var name = Resources.Localization.Strings.ResourceManager.GetString(accent.Name);
var name = Resources.Localization.Strings.ResourceManager.GetString(accent.Name, LocalizationManager.Culture);

if (string.IsNullOrEmpty(name))
name = accent.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Globalization;
using System.Windows.Data;
using NETworkManager.Models.Settings;

namespace NETworkManager.Converters
{
Expand All @@ -13,7 +14,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (!(value is AppTheme theme))
return "No valid theme passed!";

var name = Resources.Localization.Strings.ResourceManager.GetString(theme.Name);
var name = Resources.Localization.Strings.ResourceManager.GetString(theme.Name, LocalizationManager.Culture);

if (string.IsNullOrEmpty(name))
name = theme.Name;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using System.Windows.Data;
using NETworkManager.Models.Settings;
using static NETworkManager.Utilities.AutoRefreshTime;

namespace NETworkManager.Converters
Expand All @@ -12,7 +13,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (!(value is TimeUnit timeUnit))
return "No valid time unit passed!";

var timeUnitTranslated = Resources.Localization.Strings.ResourceManager.GetString("TimeUnit_" + timeUnit);
var timeUnitTranslated = Resources.Localization.Strings.ResourceManager.GetString("TimeUnit_" + timeUnit, LocalizationManager.Culture);

return string.IsNullOrEmpty(timeUnitTranslated) ? timeUnit.ToString() : timeUnitTranslated;
}
Expand Down
9 changes: 2 additions & 7 deletions Source/NETworkManager/Converters/IPStatusToStringConverter.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
using System;
using System.Globalization;
using System.Net.NetworkInformation;
using System.Windows.Data;
using NETworkManager.Models.Settings;

namespace NETworkManager.Converters
{
public sealed class IPStatusToStringConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if(!(value is IPStatus ipStatus))
return "-/-";

var status = Resources.Localization.Strings.ResourceManager.GetString("IPStatus_" + ipStatus);

return string.IsNullOrEmpty(status) ? ipStatus.ToString() : status;
return LocalizationManager.TranslateIPStatus(value);
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
20 changes: 20 additions & 0 deletions Source/NETworkManager/Converters/PingStatusToBoolConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Globalization;
using System.Net.NetworkInformation;
using System.Windows.Data;

namespace NETworkManager.Converters
{
public sealed class PingStatusToBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value != null && (IPStatus) value == IPStatus.Success;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
11 changes: 1 addition & 10 deletions Source/NETworkManager/Converters/PingTimeToStringConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ public sealed class PingTimeToStringConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
var status = (IPStatus)values[0];


if (status != IPStatus.Success && status != IPStatus.TtlExpired)
return "-/-";

long.TryParse(values[1].ToString(), out var time);

return time == 0 ? "<1 ms" : $"{time} ms";

return Models.Network.Ping.TimeToString((IPStatus)values[0], (long)values[1]);
}

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Globalization;
using System.Windows.Data;
using NETworkManager.Models.Settings;
using static NETworkManager.Models.Network.PortInfo;

namespace NETworkManager.Converters
Expand All @@ -12,7 +13,7 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (!(value is PortStatus portStatus))
return "-/-";

var status = Resources.Localization.Strings.ResourceManager.GetString("PortState_" + portStatus);
var status = Resources.Localization.Strings.ResourceManager.GetString("PortState_" + portStatus, LocalizationManager.Culture);

return string.IsNullOrEmpty(status) ? portStatus.ToString() : status;
}
Expand Down
Loading

0 comments on commit 99f7a44

Please sign in to comment.