Skip to content

Commit

Permalink
#83 the common options now can show as <different options> in multi…
Browse files Browse the repository at this point in the history
…-edit.
  • Loading branch information
VShawn committed May 11, 2021
1 parent 9619d6e commit 23983ac
Show file tree
Hide file tree
Showing 43 changed files with 865 additions and 606 deletions.
1 change: 1 addition & 0 deletions PRM.Core/Languages/de-de.json
Expand Up @@ -152,6 +152,7 @@
"managementpage_edit_selected_confirm": "Sicher, um alle ausgewählten auf den neuen Wert zu aktualisieren: '",

// server editor
"server_editor_different_options": "<different options>",
"server_editor_group_title_common": "Allgemein",
"server_editor_group_title_connection": "Verbindung",
"server_editor_group_title_display": "Anzeige",
Expand Down
2 changes: 1 addition & 1 deletion PRM.Core/Languages/de-de.xaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PRM.Core/Languages/en-us.json
Expand Up @@ -152,6 +152,7 @@
"managementpage_edit_selected_confirm": "Sure to move all selected to new value: '",

// server editor
"server_editor_different_options": "<different options>",
"server_editor_group_title_common": "Common",
"server_editor_group_title_connection": "Connection",
"server_editor_group_title_display": "Display",
Expand Down
2 changes: 1 addition & 1 deletion PRM.Core/Languages/en-us.xaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions PRM.Core/Languages/zh-cn.json
Expand Up @@ -152,6 +152,7 @@
"managementpage_edit_selected_confirm": "确认要将所选项目变更为 '",

// server editor
"server_editor_different_options": "<不同的选项>",
"server_editor_group_title_common": "常规",
"server_editor_group_title_connection": "连接",
"server_editor_group_title_display": "显示",
Expand Down
2 changes: 1 addition & 1 deletion PRM.Core/Languages/zh-cn.xaml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions PRM.Core/Model/GlobalEventHelper.cs
Expand Up @@ -43,6 +43,9 @@ public static class GlobalEventHelper
/// </summary>
public static OnRequestGoToServerEditPageDelegate OnRequestGoToServerEditPage { get; set; } = null;

public delegate void OnRequestGoToServerMultipleEditPageDelegate(IEnumerable<ProtocolServerBase> servers, bool showAnimation = true);
public static OnRequestGoToServerMultipleEditPageDelegate OnRequestGoToServerMultipleEditPage { get; set; } = null;

public delegate void OnRequestUpdateServerDelegate(ProtocolServerBase server);
public static OnRequestUpdateServerDelegate OnRequestUpdateServer { get; set; } = null;

Expand Down
14 changes: 14 additions & 0 deletions PRM.Core/PRM.Core.csproj
Expand Up @@ -131,6 +131,12 @@
<Compile Include="Model\GlobalData.cs" />
<Compile Include="Model\GlobalEventHelper.cs" />
<Compile Include="Model\SystemConfig.KeywordMatch.cs" />
<Compile Include="Protocol\BaseClassForm\ProtocolServerWithAddrPortBaseForm.xaml.cs">
<DependentUpon>ProtocolServerWithAddrPortBaseForm.xaml</DependentUpon>
</Compile>
<Compile Include="Protocol\BaseClassForm\ProtocolServerWithAddrPortUserPwdBaseForm.xaml.cs">
<DependentUpon>ProtocolServerWithAddrPortUserPwdBaseForm.xaml</DependentUpon>
</Compile>
<Compile Include="Protocol\Putty\KittyPortableSessionConfigReader.cs" />
<Compile Include="Utils\DesktopResolutionWatcher.cs" />
<Compile Include="Model\SystemConfig.cs" />
Expand Down Expand Up @@ -409,6 +415,14 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Protocol\BaseClassForm\ProtocolServerWithAddrPortBaseForm.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Protocol\BaseClassForm\ProtocolServerWithAddrPortUserPwdBaseForm.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Protocol\FileTransmit\FTP\ProtocolServerFTPForm.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
Expand Down
2 changes: 1 addition & 1 deletion PRM.Core/Protocol/BaseClassForm/ProtocolServerFormBase.cs
@@ -1,6 +1,6 @@
using System.Windows.Controls;

namespace PRM.Core.Protocol
namespace PRM.Core.Protocol.BaseClassForm
{
public abstract class ProtocolServerFormBase : UserControl
{
Expand Down
@@ -0,0 +1,60 @@
<baseClassForm:ProtocolServerFormBase x:Class="PRM.Core.Protocol.BaseClassForm.ProtocolServerWithAddrPortBaseForm"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:protocol="clr-namespace:PRM.Core.Protocol"
xmlns:controls="clr-namespace:PRM.Core.Resources.Controls"
xmlns:local="clr-namespace:PRM.Core.Protocol.VNC"
xmlns:passwordEx="clr-namespace:Shawn.Utils"
xmlns:baseClassForm="clr-namespace:PRM.Core.Protocol.BaseClassForm"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance protocol:ProtocolServerWithAddrPortBase}"
d:DesignHeight="1450" d:DesignWidth="800">
<StackPanel>
<StackPanel.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/PRM.Core;component/Utils/PasswordEx/PasswordBoxEx.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</StackPanel.Resources>

<StackPanel>

<TextBlock Style="{StaticResource EditorGroupTextBlockTitle}" Text="{DynamicResource server_editor_group_title_connection}"></TextBlock>

<Grid Style="{StaticResource EditorRowGrid}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource server_editor_connection_address}"></TextBlock>
<Grid Style="{StaticResource EditorRowGridInput}">
<TextBox Text="{Binding Address,UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource TextBoxWithPlaceHolder}"
Tag="e.g. 192.168.0.101"></TextBox>
</Grid>
<TextBlock Style="{StaticResource EditorRowGridTitle}" Width="60" Text="{DynamicResource server_editor_connection_port}"></TextBlock>
<Grid Style="{StaticResource EditorRowGridInput}">
<TextBox Width="50" Text="{Binding Port,UpdateSourceTrigger=PropertyChanged,ValidatesOnExceptions=True,NotifyOnValidationError=True}"
HorizontalAlignment="Left"
InputMethod.IsInputMethodEnabled="False"
InputScope="Number"
></TextBox>
</Grid>
</StackPanel>
</Grid>

<Grid Name="GridPwd">
<Grid.Style>
<Style TargetType="Grid" BasedOn="{StaticResource EditorRowGrid}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=CbUsePrivateKey,Path= IsChecked}" Value="True">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Setter Property="IsEnabled" Value="False"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
</StackPanel>
</StackPanel>
</baseClassForm:ProtocolServerFormBase>
@@ -0,0 +1,13 @@
namespace PRM.Core.Protocol.BaseClassForm
{
public partial class ProtocolServerWithAddrPortBaseForm : ProtocolServerFormBase
{
public readonly ProtocolServerBase Vm;
public ProtocolServerWithAddrPortBaseForm(ProtocolServerBase vm) : base(vm)
{
InitializeComponent();
Vm = vm;
DataContext = vm;
}
}
}
@@ -0,0 +1,68 @@
<baseClassForm:ProtocolServerFormBase x:Class="PRM.Core.Protocol.BaseClassForm.ProtocolServerWithAddrPortUserPwdBaseForm"
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:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:protocol="clr-namespace:PRM.Core.Protocol"
xmlns:controls="clr-namespace:PRM.Core.Resources.Controls"
xmlns:local="clr-namespace:PRM.Core.Protocol.VNC"
xmlns:passwordEx="clr-namespace:Shawn.Utils"
xmlns:baseClassForm="clr-namespace:PRM.Core.Protocol.BaseClassForm"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance protocol:ProtocolServerWithAddrPortUserPwdBase}"
d:DesignHeight="1450" d:DesignWidth="800">
<StackPanel>
<StackPanel.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/PRM.Core;component/Utils/PasswordEx/PasswordBoxEx.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</StackPanel.Resources>

<StackPanel>

<TextBlock Style="{StaticResource EditorGroupTextBlockTitle}" Text="{DynamicResource server_editor_group_title_connection}"></TextBlock>

<Grid Style="{StaticResource EditorRowGrid}">
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource server_editor_connection_address}"></TextBlock>
<Grid Style="{StaticResource EditorRowGridInput}">
<TextBox Text="{Binding Address,UpdateSourceTrigger=PropertyChanged}"
Style="{StaticResource TextBoxWithPlaceHolder}"
Tag="e.g. 192.168.0.101"></TextBox>
</Grid>
<TextBlock Style="{StaticResource EditorRowGridTitle}" Width="60" Text="{DynamicResource server_editor_connection_port}"></TextBlock>
<Grid Style="{StaticResource EditorRowGridInput}">
<!--TODO needs a number only text box -->
<TextBox MinWidth="50" Text="{Binding Port,UpdateSourceTrigger=PropertyChanged,ValidatesOnExceptions=True,NotifyOnValidationError=True}"
HorizontalAlignment="Left"
InputMethod.IsInputMethodEnabled="False"
InputScope="Number"
></TextBox>
</Grid>
</StackPanel>
</Grid>

<Grid Name="GridPwd">
<Grid.Style>
<Style TargetType="Grid" BasedOn="{StaticResource EditorRowGrid}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=CbUsePrivateKey,Path= IsChecked}" Value="True">
<Setter Property="Visibility" Value="Collapsed"></Setter>
<Setter Property="IsEnabled" Value="False"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource EditorRowGridTitle}" Text="{DynamicResource server_editor_connection_password}"></TextBlock>
<Grid Style="{StaticResource EditorRowGridInput}">
<PasswordBox passwordEx:PasswordBoxEx.Password="{Binding Password,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
Style="{StaticResource PasswordBoxEx}" />
</Grid>
</StackPanel>
</Grid>
</StackPanel>
</StackPanel>
</baseClassForm:ProtocolServerFormBase>
@@ -0,0 +1,13 @@
namespace PRM.Core.Protocol.BaseClassForm
{
public partial class ProtocolServerWithAddrPortUserPwdBaseForm : ProtocolServerFormBase
{
public readonly ProtocolServerBase Vm;
public ProtocolServerWithAddrPortUserPwdBaseForm(ProtocolServerBase vm) : base(vm)
{
InitializeComponent();
Vm = vm;
DataContext = vm;
}
}
}

0 comments on commit 23983ac

Please sign in to comment.