Skip to content

Commit

Permalink
v 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinkmrMask committed Feb 27, 2021
1 parent f355106 commit c351b7b
Show file tree
Hide file tree
Showing 18 changed files with 799 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Program/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
9 changes: 9 additions & 0 deletions Program/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="WpfApp3.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfApp3"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions Program/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace WpfApp3
{
/// <summary>
/// Логика взаимодействия для App.xaml
/// </summary>
public partial class App : Application
{
}
}
15 changes: 15 additions & 0 deletions Program/Declarations.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace WpfApp3
{
public class Declarations
{
public string FileName { get; set; }
public string DocumentID { get; set; }
}
}
12 changes: 12 additions & 0 deletions Program/Information.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Window x:Class="WpfApp3.Information"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp3"
mc:Ignorable="d"
Title="Information" Height="450" Width="800">
<ScrollViewer>
<TextBlock x:Name="block"/>
</ScrollViewer>
</Window>
82 changes: 82 additions & 0 deletions Program/Information.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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.Xml;
using System.IO;
namespace WpfApp3
{
/// <summary>
/// Логика взаимодействия для Information.xaml
/// </summary>
public partial class Information : Window
{
public Information(string path)
{
InitializeComponent();
XmlDocument document = new XmlDocument();
document.Load("../../../Resources/"+path);

XmlElement root = document.DocumentElement;

block.Text += root.Name + "\n";

foreach (XmlElement item in root)
{
if (item.HasChildNodes)
{

if (item.Name == "RussianHolderAddress")
{
foreach (XmlNode son in item.ChildNodes)
{

block.Text += son.Name + " - " + son.InnerText + "\n";
}
}
else if (item.Name == "GeneralList")
{
block.Text += "<---------------------------------------------------------------------------------------------------->\n" + item.Name + "\n";
}
else block.Text += item.Name + " - " + item.InnerText + "\n";
}

foreach (XmlNode child in item.ChildNodes)
{
if (child != null)
{
if (child.HasChildNodes)
{

foreach (XmlNode son in child.ChildNodes)
{
if (son.Name != "#text")
{
if (son.Name == "ListNumber")
{
block.Text += "<---------------------------------------------------------------------------------------------------->\n";
}
block.Text += son.Name + " - " + son.InnerText + "\n";

}
}
}
}
}




}
}
}
}
30 changes: 30 additions & 0 deletions Program/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp3"
xmlns:Properties="clr-namespace:WpfApp3.Properties" x:Class="WpfApp3.MainWindow"
mc:Ignorable="d"
Title="" Height="450" Width="422.666">
<Grid>
<ScrollViewer Background="Transparent">


<DataGrid x:Name="Data" GridLinesVisibility="None" Background="White" RowBackground="Transparent" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button x:Name="btn" Background="Transparent" BorderBrush="Transparent" Click="Btn_Click">Информация</Button>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>


</ScrollViewer>
</Grid>

</Window>
100 changes: 100 additions & 0 deletions Program/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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;
using System.Xml;
using System.IO;

namespace WpfApp3
{
/// <summary>
/// Логика взаимодействия для MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{

List<string> FileNames = new List<string>();
List<string> ID = new List<string>();

private void sort()
{
GetId();
for(int i = 0; i < ID.Count-1;)
{
for(int j = i; j < ID.Count-1;)
{
if(ID[i] == ID[j + 1])
{
ID.Remove(ID[j + 1]);
FileNames.Remove(FileNames[j + 1]);
}
j++;
}
i++;
}
}
private void GetId()
{
GetFile();
foreach (string item in FileNames) ID.Add(GetName(item));

}
private string GetName(string name)
{
XmlDocument document = new XmlDocument();
document.Load("../../../Resources/" + name);

XmlElement root = document.DocumentElement;

foreach (XmlElement item in root)
{
if (item.HasChildNodes)
{

if (item.Name == "cat_ru:DocumentID")
{
return item.InnerText;
}
else return null;


}
else return null;
}
return null;
}
private void GetFile()
{

IEnumerable<string> allfiles = Directory.EnumerateFiles("../../../Resources/", "*.xml");
foreach (string filename in allfiles) FileNames.Add(filename.Remove(0, 19));
}
public MainWindow()
{
InitializeComponent();
sort();
List<Declarations> declarations = new List<Declarations>();
foreach (string item in FileNames)
declarations.Add(new Declarations { FileName = item, DocumentID = GetName(item)});
Data.ItemsSource = declarations;

}

private void Btn_Click(object sender, RoutedEventArgs e)
{
Declarations path = Data.SelectedItem as Declarations;
Information info = new Information(path.FileName);
info.Show();
}
}
}
55 changes: 55 additions & 0 deletions Program/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// Общие сведения об этой сборке предоставляются следующим набором
// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
// связанные со сборкой.
[assembly: AssemblyTitle("WpfApp3")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WpfApp3")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// из модели COM, установите атрибут ComVisible для этого типа в значение true.
[assembly: ComVisible(false)]

//Чтобы начать создание локализуемых приложений, задайте
//<UICulture>CultureYouAreCodingWith</UICulture> в файле .csproj
//в <PropertyGroup>. Например, при использовании английского (США)
//в своих исходных файлах установите <UICulture> в en-US. Затем отмените преобразование в комментарий
//атрибута NeutralResourceLanguage ниже. Обновите "en-US" в
//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
//(используется, если ресурс не найден на странице,
// или в словарях ресурсов приложения)
ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
//(используется, если ресурс не найден на странице,
// в приложении или в каких-либо словарях ресурсов для конкретной темы)
)]


// Сведения о версии для сборки включают четыре следующих значения:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Номер редакции
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading

0 comments on commit c351b7b

Please sign in to comment.