mirror of
https://github.com/vdemydiuk/mtapi.git
synced 2026-08-16 20:28:09 +00:00
removed redundant old projects from repo
This commit is contained in:
@@ -1,30 +0,0 @@
|
|||||||
<Window x:Class="ConnectionsManager.AboutWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
Title="About" Height="130" Width="300"
|
|
||||||
WindowStyle="ToolWindow"
|
|
||||||
WindowStartupLocation="CenterOwner">
|
|
||||||
<Window.Resources>
|
|
||||||
<BitmapImage x:Key="MtApiIcon" UriSource="pack://application:,,,/ConnectionsManager;component/favicon.ico"/>
|
|
||||||
</Window.Resources>
|
|
||||||
<Grid>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Image Source="{StaticResource MtApiIcon}" Width="50" Height="50" HorizontalAlignment="Left" Margin="5"/>
|
|
||||||
<TextBlock Grid.Column="1" Text="Connection manager for MtApi" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Button Grid.Row="1" Content="OK" Margin="5"
|
|
||||||
Width="70" IsDefault="True" IsCancel="True"
|
|
||||||
DockPanel.Dock="Bottom"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for AboutWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class AboutWindow : Window
|
|
||||||
{
|
|
||||||
public AboutWindow(Window owner)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
this.Owner = owner;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
<Window x:Class="ConnectionsManager.AddProfileDialog"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
Title="Add new connection profile" Height="180" Width="300"
|
|
||||||
WindowStyle="ToolWindow"
|
|
||||||
WindowStartupLocation="CenterOwner">
|
|
||||||
<Grid x:Name="_MainLayout">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="0" Grid.Column="0" Text="Profile name" Margin="5"/>
|
|
||||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5"
|
|
||||||
Text="{Binding Path=ProfileName, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
TextChanged="TextBox_TextChanged"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Host" Margin="5"/>
|
|
||||||
<ComboBox Grid.Row="1" Grid.Column="1" Margin="5"
|
|
||||||
ItemsSource="{Binding HostList}"
|
|
||||||
SelectedItem="{Binding Host}"/>
|
|
||||||
|
|
||||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Port" Margin="5"/>
|
|
||||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="5"
|
|
||||||
Text="{Binding Path=Port, UpdateSourceTrigger=PropertyChanged}"
|
|
||||||
PreviewTextInput="TextBox_PreviewTextInput"
|
|
||||||
TextChanged="TextBox_TextChanged"/>
|
|
||||||
|
|
||||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="2" Margin="0,10,0,0"
|
|
||||||
Orientation="Horizontal"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
VerticalAlignment="Bottom">
|
|
||||||
<Button Content="OK" Width="70" Margin="4" IsDefault="True" Command="{Binding OkCommand}"/>
|
|
||||||
<Button Content="Cancel" Width="70" Margin="4" IsCancel="True"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Net;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for AddProfileDialog.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class AddProfileDialog : Window
|
|
||||||
{
|
|
||||||
// private const string PIPE_SERVER_NAME = "localhost(pipe)";
|
|
||||||
private const string LOCALHOST_NAME = "localhost";
|
|
||||||
|
|
||||||
public string ProfileName { get; set; }
|
|
||||||
|
|
||||||
public static readonly DependencyProperty HostProperty = DependencyProperty.Register("Host", typeof(string), typeof(AddProfileDialog));
|
|
||||||
public string Host
|
|
||||||
{
|
|
||||||
get { return (string)this.GetValue(HostProperty); }
|
|
||||||
set { this.SetValue(HostProperty, value); }
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Port { get; set; }
|
|
||||||
|
|
||||||
public DelegateCommand OkCommand { get; set; }
|
|
||||||
|
|
||||||
public List<string> HostList { get; set; }
|
|
||||||
|
|
||||||
public AddProfileDialog(Window owner)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
this.Owner = owner;
|
|
||||||
|
|
||||||
OkCommand = new DelegateCommand(ExecuteOk, CanExecuteOk);
|
|
||||||
_MainLayout.DataContext = this;
|
|
||||||
|
|
||||||
Loaded += (sender, e) => MoveFocus(new TraversalRequest(FocusNavigationDirection.Next));
|
|
||||||
|
|
||||||
IPHostEntry ips = Dns.GetHostEntry(Dns.GetHostName());
|
|
||||||
|
|
||||||
HostList = new List<string>();
|
|
||||||
HostList.Add(string.Empty);
|
|
||||||
HostList.Add(LOCALHOST_NAME);
|
|
||||||
|
|
||||||
if (ips != null)
|
|
||||||
{
|
|
||||||
foreach (IPAddress ipAddress in ips.AddressList)
|
|
||||||
{
|
|
||||||
HostList.Add(ipAddress.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Host = HostList.First();
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CanExecuteOk(object o)
|
|
||||||
{
|
|
||||||
return string.IsNullOrEmpty(ProfileName) == false
|
|
||||||
&& string.IsNullOrEmpty(Port) == false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ExecuteOk(object o)
|
|
||||||
{
|
|
||||||
this.DialogResult = true;
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsTextAllowed(string text)
|
|
||||||
{
|
|
||||||
Regex regex = new Regex("[^0-9]+");
|
|
||||||
return !regex.IsMatch(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = !IsTextAllowed(e.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
|
|
||||||
{
|
|
||||||
OkCommand.RaiseCanExecuteChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<Application x:Class="ConnectionsManager.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
StartupUri="MainWindow.xaml">
|
|
||||||
<Application.Resources>
|
|
||||||
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for App.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,168 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{C8751BA1-6A85-468C-87BD-758F37B8C0DD}</ProjectGuid>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>ConnectionsManager</RootNamespace>
|
|
||||||
<AssemblyName>ConnectionsManager</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>
|
|
||||||
</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<CodeAnalysisLogFile>bin\Debug\ConnectionsManager.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
|
||||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
|
||||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
|
||||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
|
||||||
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
|
||||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<CodeAnalysisLogFile>bin\Release\ConnectionsManager.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
|
|
||||||
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
|
|
||||||
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
|
||||||
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
|
|
||||||
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
|
|
||||||
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
|
|
||||||
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationIcon>favicon.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="System.Xaml">
|
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="WindowsBase" />
|
|
||||||
<Reference Include="PresentationCore" />
|
|
||||||
<Reference Include="PresentationFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ApplicationDefinition Include="App.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</ApplicationDefinition>
|
|
||||||
<Compile Include="AboutWindow.xaml.cs">
|
|
||||||
<DependentUpon>AboutWindow.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="AddProfileDialog.xaml.cs">
|
|
||||||
<DependentUpon>AddProfileDialog.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="DelegateCommand.cs" />
|
|
||||||
<Compile Include="ViewModel.cs" />
|
|
||||||
<Page Include="AboutWindow.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="AddProfileDialog.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="MainWindow.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Compile Include="App.xaml.cs">
|
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="MainWindow.xaml.cs">
|
|
||||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<None Include="app.config" />
|
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<AppDesigner Include="Properties\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\MTApiService\MTApiService.csproj">
|
|
||||||
<Project>{DE76D5C7-B99C-4467-8408-78173BDD84E0}</Project>
|
|
||||||
<Name>MTApiService</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Resource Include="favicon.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>copy $(TargetPath) $(SolutionDir)Release\</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Input;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
public class DelegateCommand : ICommand
|
|
||||||
{
|
|
||||||
private readonly Predicate<object> _canExecute;
|
|
||||||
private readonly Action<object> _execute;
|
|
||||||
|
|
||||||
public event EventHandler CanExecuteChanged;
|
|
||||||
|
|
||||||
public DelegateCommand(Action<object> execute)
|
|
||||||
: this(execute, null)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public DelegateCommand(Action<object> execute,
|
|
||||||
Predicate<object> canExecute)
|
|
||||||
{
|
|
||||||
_execute = execute;
|
|
||||||
_canExecute = canExecute;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool CanExecute(object parameter)
|
|
||||||
{
|
|
||||||
if (_canExecute == null)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _canExecute(parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Execute(object parameter)
|
|
||||||
{
|
|
||||||
_execute(parameter);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RaiseCanExecuteChanged()
|
|
||||||
{
|
|
||||||
if (CanExecuteChanged != null)
|
|
||||||
{
|
|
||||||
CanExecuteChanged(this, EventArgs.Empty);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<Window x:Class="ConnectionsManager.MainWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
Title="MtApi Connections Manager" Height="300" Width="440"
|
|
||||||
Loaded="Window_Loaded">
|
|
||||||
<Grid x:Name="_MainLayout">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Menu>
|
|
||||||
<MenuItem Header="Edit">
|
|
||||||
<MenuItem Header="Add Profile..." Command="{Binding AddProfileCommand}"/>
|
|
||||||
<MenuItem Header="Delete Profile" Command="{Binding DeleteProfileCommand}"/>
|
|
||||||
</MenuItem>
|
|
||||||
<MenuItem Header="Help">
|
|
||||||
<MenuItem Header="About" Command="{Binding ShowAboutCommand}"/>
|
|
||||||
</MenuItem>
|
|
||||||
</Menu>
|
|
||||||
|
|
||||||
<ListView Grid.Row="1"
|
|
||||||
ItemsSource="{Binding ConnectionProfiles}"
|
|
||||||
SelectionMode="Single"
|
|
||||||
SelectedItem="{Binding SelectedProfile}">
|
|
||||||
<ListView.View>
|
|
||||||
<GridView>
|
|
||||||
<GridViewColumn Width="140" Header="Profile" DisplayMemberBinding="{Binding Name}" />
|
|
||||||
<GridViewColumn Width="180" Header="Host" DisplayMemberBinding="{Binding Host}" />
|
|
||||||
<GridViewColumn Width="80" Header="Port" DisplayMemberBinding="{Binding Port}" />
|
|
||||||
</GridView>
|
|
||||||
</ListView.View>
|
|
||||||
</ListView>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MainWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class MainWindow : Window
|
|
||||||
{
|
|
||||||
private ViewModel _vm;
|
|
||||||
|
|
||||||
public MainWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
_vm = new ViewModel();
|
|
||||||
_MainLayout.DataContext = _vm;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
_vm.Initialize();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("ConnectionsManager")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("ConnectionsManager")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
|
||||||
//the line below to match the UICulture setting in the project file.
|
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// or application resource dictionaries)
|
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// app, or any theme specific resource dictionaries)
|
|
||||||
)]
|
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.1.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.1.0")]
|
|
||||||
-63
@@ -1,63 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.18034
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ConnectionsManager.Properties {
|
|
||||||
using System;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
internal class Resources {
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal Resources() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
|
||||||
get {
|
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ConnectionsManager.Properties.Resources", typeof(Resources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.18034
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace ConnectionsManager.Properties {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
|
||||||
|
|
||||||
public static Settings Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
<Settings />
|
|
||||||
</SettingsFile>
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using MTApiService;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace ConnectionsManager
|
|
||||||
{
|
|
||||||
class ViewModel : INotifyPropertyChanged
|
|
||||||
{
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
private ObservableCollection<MtConnectionProfile> _ConnectionProfiles = new ObservableCollection<MtConnectionProfile>();
|
|
||||||
public ObservableCollection<MtConnectionProfile> ConnectionProfiles
|
|
||||||
{
|
|
||||||
get { return _ConnectionProfiles; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public DelegateCommand AddProfileCommand { get; private set; }
|
|
||||||
public DelegateCommand DeleteProfileCommand { get; private set; }
|
|
||||||
public DelegateCommand ShowAboutCommand { get; private set; }
|
|
||||||
|
|
||||||
private MtConnectionProfile _SelectedProfile;
|
|
||||||
public MtConnectionProfile SelectedProfile
|
|
||||||
{
|
|
||||||
get { return _SelectedProfile; }
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_SelectedProfile = value;
|
|
||||||
OnPropertyChanged("SelectedProfile");
|
|
||||||
DeleteProfileCommand.RaiseCanExecuteChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Public Methods
|
|
||||||
public ViewModel()
|
|
||||||
{
|
|
||||||
AddProfileCommand = new DelegateCommand(ExecuteAddProfile);
|
|
||||||
DeleteProfileCommand = new DelegateCommand(ExecuteDeleteProfile, CanExecuteDeleteProfile);
|
|
||||||
ShowAboutCommand = new DelegateCommand(ExecuteShowAbout);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Initialize()
|
|
||||||
{
|
|
||||||
var profiles = MtRegistryManager.LoadConnectionProfiles();
|
|
||||||
if (profiles != null)
|
|
||||||
{
|
|
||||||
foreach(var prof in profiles)
|
|
||||||
{
|
|
||||||
ConnectionProfiles.Add(prof);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private Methods
|
|
||||||
private void ExecuteAddProfile(object o)
|
|
||||||
{
|
|
||||||
var dlg = new AddProfileDialog(App.Current.MainWindow);
|
|
||||||
var result = dlg.ShowDialog();
|
|
||||||
|
|
||||||
if (result == true)
|
|
||||||
{
|
|
||||||
var profile = new MtConnectionProfile(dlg.ProfileName);
|
|
||||||
profile.Host = dlg.Host;
|
|
||||||
profile.Port = int.Parse(dlg.Port);
|
|
||||||
|
|
||||||
MtRegistryManager.AddConnectionProfile(profile);
|
|
||||||
ConnectionProfiles.Add(profile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool CanExecuteDeleteProfile(object o)
|
|
||||||
{
|
|
||||||
return SelectedProfile != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ExecuteDeleteProfile(object o)
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show("Do you want to delete connection profile '" + SelectedProfile.Name + "' ?"
|
|
||||||
, "Question", MessageBoxButton.YesNo, MessageBoxImage.Question);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
MtRegistryManager.RemoveConnectionProfile(SelectedProfile.Name);
|
|
||||||
ConnectionProfiles.Remove(SelectedProfile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ExecuteShowAbout(object o)
|
|
||||||
{
|
|
||||||
var dlg = new AboutWindow(App.Current.MainWindow);
|
|
||||||
dlg.ShowDialog();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region INotifyPropertyChanged
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
|
|
||||||
protected virtual void OnPropertyChanged(string propertyName)
|
|
||||||
{
|
|
||||||
PropertyChangedEventHandler handler = PropertyChanged;
|
|
||||||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Fields
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<configuration>
|
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 894 B |
@@ -1,61 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Security.Cryptography;
|
|
||||||
using System.Text;
|
|
||||||
using System.Security;
|
|
||||||
|
|
||||||
namespace Licensing
|
|
||||||
{
|
|
||||||
public class DigitalSignatureHelper
|
|
||||||
{
|
|
||||||
public static String GeneratePrivateKey()
|
|
||||||
{
|
|
||||||
DSACryptoServiceProvider dsa = new DSACryptoServiceProvider();
|
|
||||||
return dsa.ToXmlString(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String GetPublicKey(String privateKey)
|
|
||||||
{
|
|
||||||
DSACryptoServiceProvider dsa = new DSACryptoServiceProvider();
|
|
||||||
dsa.FromXmlString(privateKey);
|
|
||||||
return dsa.ToXmlString(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static string CreateSignature(string inputData, String privateKey)
|
|
||||||
{
|
|
||||||
// create the crypto-service provider:
|
|
||||||
DSACryptoServiceProvider dsa = new DSACryptoServiceProvider();
|
|
||||||
|
|
||||||
// setup the dsa from the private key:
|
|
||||||
dsa.FromXmlString(privateKey);
|
|
||||||
|
|
||||||
byte[] data = UTF8Encoding.ASCII.GetBytes(inputData);
|
|
||||||
|
|
||||||
// get the signature:
|
|
||||||
byte[] signature = dsa.SignData(data);
|
|
||||||
|
|
||||||
return Convert.ToBase64String(signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static bool VerifySignature(string inputData, string signature, string publicKey)
|
|
||||||
{
|
|
||||||
// create the crypto-service provider:
|
|
||||||
DSACryptoServiceProvider dsa = new DSACryptoServiceProvider();
|
|
||||||
|
|
||||||
// setup the provider from the public key:
|
|
||||||
dsa.FromXmlString(publicKey);
|
|
||||||
|
|
||||||
// get the license terms data:
|
|
||||||
//byte[] data = Convert.FromBase64String(inputData);
|
|
||||||
byte[] data = UTF8Encoding.ASCII.GetBytes(inputData);
|
|
||||||
|
|
||||||
// get the signature data:
|
|
||||||
byte[] signatureData = Convert.FromBase64String(signature);
|
|
||||||
|
|
||||||
// verify that the license-terms match the signature data
|
|
||||||
if (dsa.VerifyData(data, signatureData) == false)
|
|
||||||
throw new SecurityException("Signature Not Verified!");
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{21FA6E21-EE5D-4A84-B0ED-E1D8876B41FB}</ProjectGuid>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Licensing</RootNamespace>
|
|
||||||
<AssemblyName>Licensing</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<StartupObject />
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="DigitalSignatureHelper.cs" />
|
|
||||||
<Compile Include="MainForm.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="MainForm.Designer.cs">
|
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="MainForm.resx">
|
|
||||||
<DependentUpon>MainForm.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\MTApiService\MTApiService.csproj">
|
|
||||||
<Project>{DE76D5C7-B99C-4467-8408-78173BDD84E0}</Project>
|
|
||||||
<Name>MTApiService</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
||||||
Generated
-326
@@ -1,326 +0,0 @@
|
|||||||
namespace Licensing
|
|
||||||
{
|
|
||||||
partial class MainForm
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing && (components != null))
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required method for Designer support - do not modify
|
|
||||||
/// the contents of this method with the code editor.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
this.textBoxPublicKey = new System.Windows.Forms.TextBox();
|
|
||||||
this.buttonGenerateKey = new System.Windows.Forms.Button();
|
|
||||||
this.buttonLoadKey = new System.Windows.Forms.Button();
|
|
||||||
this.buttonSaveKey = new System.Windows.Forms.Button();
|
|
||||||
this.textBoxPrivateKey = new System.Windows.Forms.TextBox();
|
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
|
||||||
this.textBoxAccountName = new System.Windows.Forms.TextBox();
|
|
||||||
this.textBoxAccountNumber = new System.Windows.Forms.TextBox();
|
|
||||||
this.buttonSign = new System.Windows.Forms.Button();
|
|
||||||
this.textBoxSignature = new System.Windows.Forms.TextBox();
|
|
||||||
this.buttonGetPublicKey = new System.Windows.Forms.Button();
|
|
||||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
|
||||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
|
||||||
this.clipboardCopyBtn = new System.Windows.Forms.Button();
|
|
||||||
this.buttonExportPublicKey = new System.Windows.Forms.Button();
|
|
||||||
this.groupBox3 = new System.Windows.Forms.GroupBox();
|
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
|
||||||
this.groupBox4 = new System.Windows.Forms.GroupBox();
|
|
||||||
this.saveToRegBtn = new System.Windows.Forms.Button();
|
|
||||||
this.buttonVerify = new System.Windows.Forms.Button();
|
|
||||||
this.buttonExportSignature = new System.Windows.Forms.Button();
|
|
||||||
this.readRegBtn = new System.Windows.Forms.Button();
|
|
||||||
this.groupBox1.SuspendLayout();
|
|
||||||
this.groupBox2.SuspendLayout();
|
|
||||||
this.groupBox3.SuspendLayout();
|
|
||||||
this.groupBox4.SuspendLayout();
|
|
||||||
this.SuspendLayout();
|
|
||||||
//
|
|
||||||
// textBoxPublicKey
|
|
||||||
//
|
|
||||||
this.textBoxPublicKey.Location = new System.Drawing.Point(6, 19);
|
|
||||||
this.textBoxPublicKey.Name = "textBoxPublicKey";
|
|
||||||
this.textBoxPublicKey.ReadOnly = true;
|
|
||||||
this.textBoxPublicKey.Size = new System.Drawing.Size(620, 20);
|
|
||||||
this.textBoxPublicKey.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// buttonGenerateKey
|
|
||||||
//
|
|
||||||
this.buttonGenerateKey.Location = new System.Drawing.Point(6, 45);
|
|
||||||
this.buttonGenerateKey.Name = "buttonGenerateKey";
|
|
||||||
this.buttonGenerateKey.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonGenerateKey.TabIndex = 2;
|
|
||||||
this.buttonGenerateKey.Text = "Generate";
|
|
||||||
this.buttonGenerateKey.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonGenerateKey.Click += new System.EventHandler(this.buttonGenerateKey_Click);
|
|
||||||
//
|
|
||||||
// buttonLoadKey
|
|
||||||
//
|
|
||||||
this.buttonLoadKey.Location = new System.Drawing.Point(168, 45);
|
|
||||||
this.buttonLoadKey.Name = "buttonLoadKey";
|
|
||||||
this.buttonLoadKey.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonLoadKey.TabIndex = 3;
|
|
||||||
this.buttonLoadKey.Text = "Load";
|
|
||||||
this.buttonLoadKey.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonLoadKey.Click += new System.EventHandler(this.buttonLoadKey_Click);
|
|
||||||
//
|
|
||||||
// buttonSaveKey
|
|
||||||
//
|
|
||||||
this.buttonSaveKey.Location = new System.Drawing.Point(87, 45);
|
|
||||||
this.buttonSaveKey.Name = "buttonSaveKey";
|
|
||||||
this.buttonSaveKey.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonSaveKey.TabIndex = 4;
|
|
||||||
this.buttonSaveKey.Text = "Save";
|
|
||||||
this.buttonSaveKey.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonSaveKey.Click += new System.EventHandler(this.buttonSaveKey_Click);
|
|
||||||
//
|
|
||||||
// textBoxPrivateKey
|
|
||||||
//
|
|
||||||
this.textBoxPrivateKey.Location = new System.Drawing.Point(6, 19);
|
|
||||||
this.textBoxPrivateKey.Name = "textBoxPrivateKey";
|
|
||||||
this.textBoxPrivateKey.ReadOnly = true;
|
|
||||||
this.textBoxPrivateKey.Size = new System.Drawing.Size(620, 20);
|
|
||||||
this.textBoxPrivateKey.TabIndex = 0;
|
|
||||||
//
|
|
||||||
// label4
|
|
||||||
//
|
|
||||||
this.label4.AutoSize = true;
|
|
||||||
this.label4.Location = new System.Drawing.Point(8, 48);
|
|
||||||
this.label4.Name = "label4";
|
|
||||||
this.label4.Size = new System.Drawing.Size(47, 13);
|
|
||||||
this.label4.TabIndex = 6;
|
|
||||||
this.label4.Text = "Number:";
|
|
||||||
//
|
|
||||||
// textBoxAccountName
|
|
||||||
//
|
|
||||||
this.textBoxAccountName.Location = new System.Drawing.Point(67, 19);
|
|
||||||
this.textBoxAccountName.Name = "textBoxAccountName";
|
|
||||||
this.textBoxAccountName.Size = new System.Drawing.Size(559, 20);
|
|
||||||
this.textBoxAccountName.TabIndex = 7;
|
|
||||||
//
|
|
||||||
// textBoxAccountNumber
|
|
||||||
//
|
|
||||||
this.textBoxAccountNumber.Location = new System.Drawing.Point(67, 45);
|
|
||||||
this.textBoxAccountNumber.Name = "textBoxAccountNumber";
|
|
||||||
this.textBoxAccountNumber.Size = new System.Drawing.Size(559, 20);
|
|
||||||
this.textBoxAccountNumber.TabIndex = 7;
|
|
||||||
//
|
|
||||||
// buttonSign
|
|
||||||
//
|
|
||||||
this.buttonSign.Location = new System.Drawing.Point(10, 45);
|
|
||||||
this.buttonSign.Name = "buttonSign";
|
|
||||||
this.buttonSign.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonSign.TabIndex = 8;
|
|
||||||
this.buttonSign.Text = "Sign";
|
|
||||||
this.buttonSign.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonSign.Click += new System.EventHandler(this.buttonSign_Click);
|
|
||||||
//
|
|
||||||
// textBoxSignature
|
|
||||||
//
|
|
||||||
this.textBoxSignature.Location = new System.Drawing.Point(10, 19);
|
|
||||||
this.textBoxSignature.Name = "textBoxSignature";
|
|
||||||
this.textBoxSignature.Size = new System.Drawing.Size(615, 20);
|
|
||||||
this.textBoxSignature.TabIndex = 10;
|
|
||||||
//
|
|
||||||
// buttonGetPublicKey
|
|
||||||
//
|
|
||||||
this.buttonGetPublicKey.Location = new System.Drawing.Point(6, 45);
|
|
||||||
this.buttonGetPublicKey.Name = "buttonGetPublicKey";
|
|
||||||
this.buttonGetPublicKey.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonGetPublicKey.TabIndex = 11;
|
|
||||||
this.buttonGetPublicKey.Text = "Get Key";
|
|
||||||
this.buttonGetPublicKey.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonGetPublicKey.Click += new System.EventHandler(this.buttonGetPublicKey_Click);
|
|
||||||
//
|
|
||||||
// groupBox1
|
|
||||||
//
|
|
||||||
this.groupBox1.Controls.Add(this.textBoxPrivateKey);
|
|
||||||
this.groupBox1.Controls.Add(this.buttonGenerateKey);
|
|
||||||
this.groupBox1.Controls.Add(this.buttonLoadKey);
|
|
||||||
this.groupBox1.Controls.Add(this.buttonSaveKey);
|
|
||||||
this.groupBox1.Location = new System.Drawing.Point(12, 12);
|
|
||||||
this.groupBox1.Name = "groupBox1";
|
|
||||||
this.groupBox1.Size = new System.Drawing.Size(632, 78);
|
|
||||||
this.groupBox1.TabIndex = 12;
|
|
||||||
this.groupBox1.TabStop = false;
|
|
||||||
this.groupBox1.Text = "Private Key";
|
|
||||||
//
|
|
||||||
// groupBox2
|
|
||||||
//
|
|
||||||
this.groupBox2.Controls.Add(this.clipboardCopyBtn);
|
|
||||||
this.groupBox2.Controls.Add(this.buttonExportPublicKey);
|
|
||||||
this.groupBox2.Controls.Add(this.textBoxPublicKey);
|
|
||||||
this.groupBox2.Controls.Add(this.buttonGetPublicKey);
|
|
||||||
this.groupBox2.Location = new System.Drawing.Point(12, 96);
|
|
||||||
this.groupBox2.Name = "groupBox2";
|
|
||||||
this.groupBox2.Size = new System.Drawing.Size(632, 77);
|
|
||||||
this.groupBox2.TabIndex = 13;
|
|
||||||
this.groupBox2.TabStop = false;
|
|
||||||
this.groupBox2.Text = "Public Key";
|
|
||||||
//
|
|
||||||
// clipboardCopyBtn
|
|
||||||
//
|
|
||||||
this.clipboardCopyBtn.Location = new System.Drawing.Point(169, 46);
|
|
||||||
this.clipboardCopyBtn.Name = "clipboardCopyBtn";
|
|
||||||
this.clipboardCopyBtn.Size = new System.Drawing.Size(113, 23);
|
|
||||||
this.clipboardCopyBtn.TabIndex = 13;
|
|
||||||
this.clipboardCopyBtn.Text = "Copy to Clipboard";
|
|
||||||
this.clipboardCopyBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.clipboardCopyBtn.Click += new System.EventHandler(this.clipboardCopyBtn_Click);
|
|
||||||
//
|
|
||||||
// buttonExportPublicKey
|
|
||||||
//
|
|
||||||
this.buttonExportPublicKey.Location = new System.Drawing.Point(88, 46);
|
|
||||||
this.buttonExportPublicKey.Name = "buttonExportPublicKey";
|
|
||||||
this.buttonExportPublicKey.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonExportPublicKey.TabIndex = 12;
|
|
||||||
this.buttonExportPublicKey.Text = "Export";
|
|
||||||
this.buttonExportPublicKey.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonExportPublicKey.Click += new System.EventHandler(this.buttonExportPublicKey_Click);
|
|
||||||
//
|
|
||||||
// groupBox3
|
|
||||||
//
|
|
||||||
this.groupBox3.Controls.Add(this.textBoxAccountName);
|
|
||||||
this.groupBox3.Controls.Add(this.label3);
|
|
||||||
this.groupBox3.Controls.Add(this.textBoxAccountNumber);
|
|
||||||
this.groupBox3.Controls.Add(this.label4);
|
|
||||||
this.groupBox3.Location = new System.Drawing.Point(12, 180);
|
|
||||||
this.groupBox3.Name = "groupBox3";
|
|
||||||
this.groupBox3.Size = new System.Drawing.Size(635, 81);
|
|
||||||
this.groupBox3.TabIndex = 14;
|
|
||||||
this.groupBox3.TabStop = false;
|
|
||||||
this.groupBox3.Text = "Account";
|
|
||||||
//
|
|
||||||
// label3
|
|
||||||
//
|
|
||||||
this.label3.AutoSize = true;
|
|
||||||
this.label3.Location = new System.Drawing.Point(8, 22);
|
|
||||||
this.label3.Name = "label3";
|
|
||||||
this.label3.Size = new System.Drawing.Size(38, 13);
|
|
||||||
this.label3.TabIndex = 5;
|
|
||||||
this.label3.Text = "Name:";
|
|
||||||
//
|
|
||||||
// groupBox4
|
|
||||||
//
|
|
||||||
this.groupBox4.Controls.Add(this.readRegBtn);
|
|
||||||
this.groupBox4.Controls.Add(this.saveToRegBtn);
|
|
||||||
this.groupBox4.Controls.Add(this.buttonVerify);
|
|
||||||
this.groupBox4.Controls.Add(this.buttonExportSignature);
|
|
||||||
this.groupBox4.Controls.Add(this.textBoxSignature);
|
|
||||||
this.groupBox4.Controls.Add(this.buttonSign);
|
|
||||||
this.groupBox4.Location = new System.Drawing.Point(13, 268);
|
|
||||||
this.groupBox4.Name = "groupBox4";
|
|
||||||
this.groupBox4.Size = new System.Drawing.Size(631, 76);
|
|
||||||
this.groupBox4.TabIndex = 15;
|
|
||||||
this.groupBox4.TabStop = false;
|
|
||||||
this.groupBox4.Text = "Signature";
|
|
||||||
//
|
|
||||||
// saveToRegBtn
|
|
||||||
//
|
|
||||||
this.saveToRegBtn.Location = new System.Drawing.Point(172, 45);
|
|
||||||
this.saveToRegBtn.Name = "saveToRegBtn";
|
|
||||||
this.saveToRegBtn.Size = new System.Drawing.Size(101, 23);
|
|
||||||
this.saveToRegBtn.TabIndex = 13;
|
|
||||||
this.saveToRegBtn.Text = "Save To Reg";
|
|
||||||
this.saveToRegBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.saveToRegBtn.Click += new System.EventHandler(this.saveToRegBtn_Click);
|
|
||||||
//
|
|
||||||
// buttonVerify
|
|
||||||
//
|
|
||||||
this.buttonVerify.Location = new System.Drawing.Point(550, 45);
|
|
||||||
this.buttonVerify.Name = "buttonVerify";
|
|
||||||
this.buttonVerify.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonVerify.TabIndex = 12;
|
|
||||||
this.buttonVerify.Text = "Verify";
|
|
||||||
this.buttonVerify.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonVerify.Click += new System.EventHandler(this.buttonVerify_Click);
|
|
||||||
//
|
|
||||||
// buttonExportSignature
|
|
||||||
//
|
|
||||||
this.buttonExportSignature.Location = new System.Drawing.Point(91, 45);
|
|
||||||
this.buttonExportSignature.Name = "buttonExportSignature";
|
|
||||||
this.buttonExportSignature.Size = new System.Drawing.Size(75, 23);
|
|
||||||
this.buttonExportSignature.TabIndex = 11;
|
|
||||||
this.buttonExportSignature.Text = "Export";
|
|
||||||
this.buttonExportSignature.UseVisualStyleBackColor = true;
|
|
||||||
this.buttonExportSignature.Click += new System.EventHandler(this.buttonExportSignature_Click);
|
|
||||||
//
|
|
||||||
// readRegBtn
|
|
||||||
//
|
|
||||||
this.readRegBtn.Location = new System.Drawing.Point(279, 45);
|
|
||||||
this.readRegBtn.Name = "readRegBtn";
|
|
||||||
this.readRegBtn.Size = new System.Drawing.Size(132, 23);
|
|
||||||
this.readRegBtn.TabIndex = 14;
|
|
||||||
this.readRegBtn.Text = "Read from Registry";
|
|
||||||
this.readRegBtn.UseVisualStyleBackColor = true;
|
|
||||||
this.readRegBtn.Click += new System.EventHandler(this.readRegBtn_Click);
|
|
||||||
//
|
|
||||||
// MainForm
|
|
||||||
//
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.ClientSize = new System.Drawing.Size(659, 351);
|
|
||||||
this.Controls.Add(this.groupBox4);
|
|
||||||
this.Controls.Add(this.groupBox3);
|
|
||||||
this.Controls.Add(this.groupBox2);
|
|
||||||
this.Controls.Add(this.groupBox1);
|
|
||||||
this.Name = "MainForm";
|
|
||||||
this.Text = "Liccensing";
|
|
||||||
this.groupBox1.ResumeLayout(false);
|
|
||||||
this.groupBox1.PerformLayout();
|
|
||||||
this.groupBox2.ResumeLayout(false);
|
|
||||||
this.groupBox2.PerformLayout();
|
|
||||||
this.groupBox3.ResumeLayout(false);
|
|
||||||
this.groupBox3.PerformLayout();
|
|
||||||
this.groupBox4.ResumeLayout(false);
|
|
||||||
this.groupBox4.PerformLayout();
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private System.Windows.Forms.TextBox textBoxPublicKey;
|
|
||||||
private System.Windows.Forms.Button buttonGenerateKey;
|
|
||||||
private System.Windows.Forms.Button buttonLoadKey;
|
|
||||||
private System.Windows.Forms.Button buttonSaveKey;
|
|
||||||
private System.Windows.Forms.TextBox textBoxPrivateKey;
|
|
||||||
private System.Windows.Forms.Label label4;
|
|
||||||
private System.Windows.Forms.TextBox textBoxAccountName;
|
|
||||||
private System.Windows.Forms.TextBox textBoxAccountNumber;
|
|
||||||
private System.Windows.Forms.Button buttonSign;
|
|
||||||
private System.Windows.Forms.TextBox textBoxSignature;
|
|
||||||
private System.Windows.Forms.Button buttonGetPublicKey;
|
|
||||||
private System.Windows.Forms.GroupBox groupBox1;
|
|
||||||
private System.Windows.Forms.GroupBox groupBox2;
|
|
||||||
private System.Windows.Forms.GroupBox groupBox3;
|
|
||||||
private System.Windows.Forms.Label label3;
|
|
||||||
private System.Windows.Forms.Button buttonExportPublicKey;
|
|
||||||
private System.Windows.Forms.GroupBox groupBox4;
|
|
||||||
private System.Windows.Forms.Button buttonExportSignature;
|
|
||||||
private System.Windows.Forms.Button buttonVerify;
|
|
||||||
private System.Windows.Forms.Button clipboardCopyBtn;
|
|
||||||
private System.Windows.Forms.Button saveToRegBtn;
|
|
||||||
private System.Windows.Forms.Button readRegBtn;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,352 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.IO;
|
|
||||||
using System.Security;
|
|
||||||
using MTApiService;
|
|
||||||
|
|
||||||
namespace Licensing
|
|
||||||
{
|
|
||||||
public partial class MainForm : Form
|
|
||||||
{
|
|
||||||
private bool mIsSaved = true;
|
|
||||||
|
|
||||||
public MainForm()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonGenerateKey_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
textBoxPrivateKey.Text = DigitalSignatureHelper.GeneratePrivateKey();
|
|
||||||
|
|
||||||
mIsSaved = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonGetPublicKey_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string privateKey = textBoxPrivateKey.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(privateKey) == false)
|
|
||||||
{
|
|
||||||
textBoxPublicKey.Text = DigitalSignatureHelper.GetPublicKey(privateKey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Private Key is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonSaveKey_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string privateKey = textBoxPrivateKey.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(privateKey) == false)
|
|
||||||
{
|
|
||||||
SaveFileDialog dlg = new SaveFileDialog();
|
|
||||||
|
|
||||||
dlg.Filter = "MetaTraderApi Key Files (*.mtk)|*.mtk";
|
|
||||||
dlg.Title = "Save MetaTraderApi Key File";
|
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (TextWriter file = new StreamWriter(dlg.FileName, true))
|
|
||||||
{
|
|
||||||
file.WriteLine(privateKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
mIsSaved = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var errorMsg = string.Format("Saving failed!\n{0}", ex.Message);
|
|
||||||
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Private Key is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonLoadKey_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (mIsSaved == false)
|
|
||||||
{
|
|
||||||
if (MessageBox.Show("Private Key is not saved. Continue?", "Private Key", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenFileDialog dlg = new OpenFileDialog();
|
|
||||||
|
|
||||||
dlg.Filter = "MetaTraderApi Key Files (*.mtk)|*.mtk";
|
|
||||||
dlg.Title = "Load MetaTraderApi Key File";
|
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
textBoxPrivateKey.Text = string.Empty;
|
|
||||||
textBoxPublicKey.Text = string.Empty;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (TextReader file = new StreamReader(dlg.FileName))
|
|
||||||
{
|
|
||||||
textBoxPrivateKey.Text = file.ReadLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
mIsSaved = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var errorMsg = string.Format("Saving failed!\n{0}", ex.Message);
|
|
||||||
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonSign_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string privateKey = textBoxPrivateKey.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(privateKey) == false)
|
|
||||||
{
|
|
||||||
string accountName = textBoxAccountName.Text;
|
|
||||||
string accountNumber = textBoxAccountNumber.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountName) == false)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(accountNumber) == false)
|
|
||||||
{
|
|
||||||
string inputData = accountName + accountNumber;
|
|
||||||
|
|
||||||
textBoxSignature.Text = DigitalSignatureHelper.CreateSignature(inputData, privateKey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountNumber is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountName is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Private Key is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonExportPublicKey_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string publicKey = textBoxPublicKey.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(publicKey) == false)
|
|
||||||
{
|
|
||||||
SaveFileDialog dlg = new SaveFileDialog();
|
|
||||||
|
|
||||||
dlg.Filter = "MetaTraderApi Key Files (*.mtk)|*.mtk";
|
|
||||||
dlg.Title = "Export MetaTraderApi Key File";
|
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (TextWriter file = new StreamWriter(dlg.FileName, true))
|
|
||||||
{
|
|
||||||
file.WriteLine(publicKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
mIsSaved = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var errorMsg = string.Format("Export failed!\n{0}", ex.Message);
|
|
||||||
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Public Key is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonExportSignature_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string signature = textBoxSignature.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(signature) == false)
|
|
||||||
{
|
|
||||||
SaveFileDialog dlg = new SaveFileDialog();
|
|
||||||
|
|
||||||
dlg.Filter = "MetaTraderApi Key (*.mta)|*.mta";
|
|
||||||
dlg.Title = "Export MetaTraderApi Key";
|
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (TextWriter file = new StreamWriter(dlg.FileName))
|
|
||||||
{
|
|
||||||
file.WriteLine(signature);
|
|
||||||
}
|
|
||||||
|
|
||||||
mIsSaved = true;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
var errorMsg = string.Format("Export failed!\n{0}", ex.Message);
|
|
||||||
MessageBox.Show(errorMsg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Signature is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buttonVerify_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string publicKey = textBoxPublicKey.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(publicKey) == false)
|
|
||||||
{
|
|
||||||
string signature = textBoxSignature.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(signature) == false)
|
|
||||||
{
|
|
||||||
string accountName = textBoxAccountName.Text;
|
|
||||||
string accountNumber = textBoxAccountNumber.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountName) == false)
|
|
||||||
{
|
|
||||||
if (string.IsNullOrEmpty(accountNumber) == false)
|
|
||||||
{
|
|
||||||
string inputData = accountName + accountNumber;
|
|
||||||
var verifyResult = false;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
verifyResult = DigitalSignatureHelper.VerifySignature(inputData, signature, publicKey);
|
|
||||||
}
|
|
||||||
catch (SecurityException ex)
|
|
||||||
{
|
|
||||||
MessageBox.Show(ex.Message, "Verify", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
verifyResult = false;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
string errorMsg = string.Format("Verify process failed!\n{0}", ex.Message);
|
|
||||||
MessageBox.Show(errorMsg, "Verify", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
verifyResult = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (verifyResult == true)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Signature good", "Verify", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountNumber is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountName is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Signature is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Public Key is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clipboardCopyBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
Clipboard.SetText(textBoxPublicKey.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void saveToRegBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string signature = textBoxSignature.Text;
|
|
||||||
string accountName = textBoxAccountName.Text;
|
|
||||||
string accountNumber = textBoxAccountNumber.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(signature))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Signature is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountName))
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountName is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountNumber))
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountNumber is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
SaveFileDialog dlg = new SaveFileDialog();
|
|
||||||
|
|
||||||
dlg.Filter = "Registry files (*.reg)|*.reg";
|
|
||||||
dlg.Title = "Registry files";
|
|
||||||
|
|
||||||
if (dlg.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
string key = MtRegistryManager.SaveSignatureKey(accountName, accountNumber, signature);
|
|
||||||
|
|
||||||
bool exported = MtRegistryManager.ExportKey(key, dlg.FileName);
|
|
||||||
|
|
||||||
if (exported)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Export successed.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.None);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
MessageBox.Show("Export failed!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void readRegBtn_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
string accountName = textBoxAccountName.Text;
|
|
||||||
string accountNumber = textBoxAccountNumber.Text;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountName))
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountName is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(accountNumber))
|
|
||||||
{
|
|
||||||
MessageBox.Show("AccountNumber is empty!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
string signature = MtRegistryManager.ReadSignatureKey(accountName, accountNumber);
|
|
||||||
textBoxSignature.Text = signature;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace Licensing
|
|
||||||
{
|
|
||||||
static class Program
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The main entry point for the application.
|
|
||||||
/// </summary>
|
|
||||||
[STAThread]
|
|
||||||
static void Main()
|
|
||||||
{
|
|
||||||
Application.EnableVisualStyles();
|
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
|
||||||
Application.Run(new MainForm());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("Licensing")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("DW")]
|
|
||||||
[assembly: AssemblyProduct("Licensing")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © DW 2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("2c3df81b-2285-44ff-a152-0111e25d9b1a")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
Reference in New Issue
Block a user