8 Commits

63 changed files with 2654 additions and 249 deletions

View File

@@ -0,0 +1,65 @@
using Contracts.BindingModels;
using Contracts.BusinessLogicContracts;
using Contracts.StorageContracts;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BusinessLogic
{
public class AuthorLogic:IAuthorLogic
{
private readonly IAuthorStorage _authorStorage;
public AuthorLogic(IAuthorStorage authorStorage)
{
_authorStorage = authorStorage;
}
public void CreateOrUpdate(AuthorBindingModel model)
{
var element = _authorStorage.GetElement(
new AuthorBindingModel
{
FIO = model.FIO
});
if (element != null && element.Id != model.Id)
{
throw new Exception("Такой автор уже существует");
}
if (model.Id.HasValue)
{
_authorStorage.Update(model);
}
else
{
_authorStorage.Insert(model);
}
}
public void Delete(AuthorBindingModel model)
{
var element = _authorStorage.GetElement(new AuthorBindingModel { Id = model.Id });
if (element == null)
{
throw new Exception("Автор не найден");
}
_authorStorage.Delete(model);
}
public List<AuthorViewModel> Read(AuthorBindingModel model)
{
if (model == null)
{
return _authorStorage.GetFullList();
}
if (model.Id.HasValue)
{
return new List<AuthorViewModel> { _authorStorage.GetElement(model) };
}
return _authorStorage.GetFilteredList(model);
}
}
}

View File

@@ -0,0 +1,67 @@
using Contracts.BindingModels;
using Contracts.BusinessLogicContracts;
using Contracts.StorageContracts;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BusinessLogic
{
public class BookLogic : IBookLogic
{
private readonly IBookStorage _bookStorage;
public BookLogic(IBookStorage bookStorage)
{
_bookStorage = bookStorage;
}
public void CreateOrUpdate(BookBindingModel model)
{
var element = _bookStorage.GetElement(
new BookBindingModel
{
Name = model.Name,
Author = model.Author,
PicturePath = model.PicturePath,
PublicationDate = model.PublicationDate
});
if (element != null && element.Id != model.Id)
{
throw new Exception("Книга с таким названием уже существует");
}
if (model.Id.HasValue)
{
_bookStorage.Update(model);
}
else
{
_bookStorage.Insert(model);
}
}
public void Delete(BookBindingModel model)
{
var element = _bookStorage.GetElement(new BookBindingModel { Id = model.Id });
if (element == null)
{
throw new Exception("Книга не найдена");
}
_bookStorage.Delete(model);
}
public List<BookViewModel> Read(BookBindingModel model)
{
if (model == null)
{
return _bookStorage.GetFullList();
}
if (model.Id.HasValue)
{
return new List<BookViewModel> { _bookStorage.GetElement(model) };
}
return _bookStorage.GetFilteredList(model);
}
}
}

View File

@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Contracts\Contracts.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,10 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

View File

@@ -1,125 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Component_1
{
public partial class List_with_choice : UserControl
{
private event EventHandler? _checkedlistChanged;
private event Action? _errorOccured;
public string Error { get; private set; }
public String Element
{
get
{
if (checkedListBox1.SelectedItem != null) return checkedListBox1.SelectedItem.ToString();
else return string.Empty;
}
set
{
checkedListBox1.SelectedItem = value;
}
}
public event EventHandler Checkedlist
{
add { _checkedlistChanged += value; }
remove { _checkedlistChanged -= value; }
}
public event Action AnErrorOccurred
{
add { _errorOccured += value; }
remove { _errorOccured -= value; }
}
public List_with_choice()
{
InitializeComponent();
Error = string.Empty;
}
public void Fill_List(string str) //метод заполнения списка
{
if (str == null)
{
MessageBox.Show("Вы не ввели строку");
return;
}
string[] list = str.Split(' ');
foreach (string s in list)
{
checkedListBox1.Items.Add(s);
}
}
public void Clean_List() //метод очистки списка
{
checkedListBox1.Items.Clear();
}
private void button_Load_Click(object sender, EventArgs e)
{
string value = "";
if (InputBox("Заполнение списка", "Пожалуйста введите строку", ref value) == DialogResult.OK)
{
try
{
Fill_List(value);
_checkedlistChanged?.Invoke(this, e);
}
catch (Exception ex)
{
Error = ex.Message;
_errorOccured?.Invoke();
}
}
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
public static DialogResult InputBox(string title, string promptText, ref string value)//диалоговое окно
{
Form form = new Form();
Label label = new Label();
TextBox textBox = new TextBox();
Button buttonOk = new Button();
Button buttonCancel = new Button();
form.Text = title;
label.Text = promptText;
buttonOk.Text = "OK";
buttonCancel.Text = "Cancel";
buttonOk.DialogResult = DialogResult.OK;
buttonCancel.DialogResult = DialogResult.Cancel;
label.SetBounds(36, 36, 372, 13);
textBox.SetBounds(36, 86, 700, 20);
buttonOk.SetBounds(228, 160, 160, 60);
buttonCancel.SetBounds(400, 160, 160, 60);
label.AutoSize = true;
form.ClientSize = new Size(796, 307);
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.StartPosition = FormStartPosition.CenterScreen;
form.MinimizeBox = false;
form.MaximizeBox = false;
form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
form.AcceptButton = buttonOk;
form.CancelButton = buttonCancel;
DialogResult dialogResult = form.ShowDialog();
value = textBox.Text;
return dialogResult;
}
private void button_Clean_Click(object sender, EventArgs e)
{
Clean_List();
}
}
}

View File

@@ -1,15 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Component_1\Component_1.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,31 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Components", "Components.csproj", "{637B2B5F-8015-4DE8-B264-74F24B115812}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Component_1", "..\Component_1\Component_1.csproj", "{9E53BE81-4309-40C4-B6F8-0C80756EE09E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{637B2B5F-8015-4DE8-B264-74F24B115812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Release|Any CPU.ActiveCfg = Release|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Release|Any CPU.Build.0 = Release|Any CPU
{9E53BE81-4309-40C4-B6F8-0C80756EE09E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9E53BE81-4309-40C4-B6F8-0C80756EE09E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9E53BE81-4309-40C4-B6F8-0C80756EE09E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9E53BE81-4309-40C4-B6F8-0C80756EE09E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C28CD353-C746-4FFE-9D0D-D48764205D7B}
EndGlobalSection
EndGlobal

View File

@@ -1,10 +0,0 @@
namespace Components
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class AuthorBindingModel
{
public int? Id { get; set; }
public string FIO { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BindingModels
{
public class BookBindingModel
{
public int? Id { get; set; }
public string Name { get; set; } = string.Empty;
public string PicturePath { get; set; } = string.Empty;
public string Author { get; set; } = string.Empty;
public DateTime PublicationDate { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
using Contracts.BindingModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface IAuthorLogic
{
List<AuthorViewModel> Read(AuthorBindingModel model);
void CreateOrUpdate(AuthorBindingModel model);
void Delete(AuthorBindingModel model);
}
}

View File

@@ -0,0 +1,17 @@
using Contracts.BindingModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.BusinessLogicContracts
{
public interface IBookLogic
{
List<BookViewModel> Read(BookBindingModel model);
void CreateOrUpdate(BookBindingModel model);
void Delete(BookBindingModel model);
}
}

View File

@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,21 @@
using Contracts.BindingModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.StorageContracts
{
public interface IAuthorStorage
{
List<AuthorViewModel> GetFullList();
List<AuthorViewModel> GetFilteredList(AuthorBindingModel model);
AuthorViewModel GetElement(AuthorBindingModel model);
void Insert(AuthorBindingModel model);
void Update(AuthorBindingModel model);
void Delete(AuthorBindingModel model);
}
}

View File

@@ -0,0 +1,21 @@
using Contracts.BindingModels;
using Contracts.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.StorageContracts
{
public interface IBookStorage
{
List<BookViewModel> GetFullList();
List<BookViewModel> GetFilteredList(BookBindingModel model);
BookViewModel GetElement(BookBindingModel model);
void Insert(BookBindingModel model);
void Update(BookBindingModel model);
void Delete(BookBindingModel model);
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class AuthorViewModel
{
public int? Id { get; set; }
[DisplayName("Имя Автора")]
public string FIO { get; set; } = string.Empty;
}
}

View File

@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Contracts.ViewModels
{
public class BookViewModel {
public int? Id { get; set; }
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Автор")]
public string Author { get; set; } = string.Empty;
[DisplayName("Дата публикации")]
public DateTime PublicationDate { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Contracts\Contracts.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,120 @@
using Contracts.BindingModels;
using Contracts.StorageContracts;
using Contracts.ViewModels;
using DatabaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Implements
{
public class AuthorStorage:IAuthorStorage
{
public void Delete(AuthorBindingModel model)
{
var context = new LibraryDatabase();
var author = context.Authors.FirstOrDefault(rec => rec.Id == model.Id);
if (author != null)
{
context.Authors.Remove(author);
context.SaveChanges();
}
else
{
throw new Exception("Автор не найден");
}
}
public AuthorViewModel GetElement(AuthorBindingModel model)
{
if (model == null)
{
return null;
}
using var context = new LibraryDatabase();
var author = context.Authors
.ToList()
.FirstOrDefault(rec => rec.Id == model.Id || rec.FIO == model.FIO);
return author != null ? CreateModel(author) : null;
}
public List<AuthorViewModel> GetFilteredList(AuthorBindingModel model)
{
if (model == null)
{
return null;
}
using var context = new LibraryDatabase();
return context.Authors
.Where(rec => rec.FIO.Contains(model.FIO))
.Select(CreateModel)
.ToList();
}
public List<AuthorViewModel> GetFullList()
{
using var context = new LibraryDatabase();
return context.Authors
.Select(CreateModel)
.ToList();
}
public void Insert(AuthorBindingModel model)
{
var context = new LibraryDatabase();
var transaction = context.Database.BeginTransaction();
try
{
context.Authors.Add(CreateModel(model, new Author()));
context.SaveChanges();
transaction.Commit();
}
catch
{
transaction.Rollback();
throw;
}
}
public void Update(AuthorBindingModel model)
{
var context = new LibraryDatabase();
var transaction = context.Database.BeginTransaction();
try
{
var author = context.Authors.FirstOrDefault(rec => rec.Id == model.Id);
if (author == null)
{
throw new Exception("Автор не найден");
}
CreateModel(model, author);
context.SaveChanges();
transaction.Commit();
}
catch
{
transaction.Rollback();
throw;
}
}
private static Author CreateModel(AuthorBindingModel model, Author author)
{
author.FIO = model.FIO;
return author;
}
private static AuthorViewModel CreateModel(Author author)
{
return new AuthorViewModel
{
Id = author.Id,
FIO = author.FIO
};
}
}
}

View File

@@ -0,0 +1,124 @@
using Contracts.BindingModels;
using Contracts.StorageContracts;
using Contracts.ViewModels;
using DatabaseImplement.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Implements
{
public class BookStorage:IBookStorage
{
public void Delete(BookBindingModel model)
{
var context = new LibraryDatabase();
var book = context.Books.FirstOrDefault(rec => rec.Id == model.Id);
if (book != null)
{
context.Books.Remove(book);
context.SaveChanges();
}
else
{
throw new Exception("Книга не найдена");
}
}
public BookViewModel GetElement(BookBindingModel model)
{
if (model == null)
{
return null;
}
using var context = new LibraryDatabase();
var book = context.Books
.ToList()
.FirstOrDefault(rec => rec.Id == model.Id);
return book != null ? CreateModel(book) : null;
}
public List<BookViewModel> GetFilteredList(BookBindingModel model)
{
var context = new LibraryDatabase();
return context.Books
.Where(book => book.Name.Contains(model.Name) && book.Author.Contains(model.Author))
.ToList()
.Select(CreateModel)
.ToList();
}
public List<BookViewModel> GetFullList()
{
using (var context = new LibraryDatabase())
{
return context.Books
.ToList()
.Select(CreateModel)
.ToList();
}
}
public void Insert(BookBindingModel model)
{
var context = new LibraryDatabase();
var transaction = context.Database.BeginTransaction();
try
{
context.Books.Add(CreateModel(model, new Book()));
context.SaveChanges();
transaction.Commit();
}
catch
{
transaction.Rollback();
throw;
}
}
public void Update(BookBindingModel model)
{
var context = new LibraryDatabase();
var transaction = context.Database.BeginTransaction();
try
{
var book = context.Books.FirstOrDefault(rec => rec.Id == model.Id);
if (book == null)
{
throw new Exception("Книга не найдена");
}
CreateModel(model, book);
context.SaveChanges();
transaction.Commit();
}
catch
{
transaction.Rollback();
throw;
}
}
private static Book CreateModel(BookBindingModel model, Book book)
{
book.Name = model.Name;
book.PublicationDate = model.PublicationDate;
book.PicturePath = model.PicturePath;
book.Author = model.Author;
return book;
}
private BookViewModel CreateModel(Book book)
{
return new BookViewModel
{
Id = book.Id,
Name = book.Name,
Author = book.Author,
PublicationDate = book.PublicationDate
};
}
}
}

View File

@@ -0,0 +1,28 @@
using DatabaseImplement.Models;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement
{
public class LibraryDatabase:DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder
optionsBuilder)
{
if (optionsBuilder.IsConfigured == false)
{
optionsBuilder.UseSqlServer(@"Data Source=DESKTOP-7A1PHA0\SQLEXPRESS;
Initial Catalog=LibraryDatabase;
Integrated Security=True;MultipleActiveResultSets=True;;TrustServerCertificate=True");
}
base.OnConfiguring(optionsBuilder);
}
public virtual DbSet<Book> Books { set; get; }
public virtual DbSet<Author> Authors { set; get; }
}
}

View File

@@ -0,0 +1,75 @@
// <auto-generated />
using System;
using DatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DatabaseImplement.Migrations
{
[DbContext(typeof(LibraryDatabase))]
[Migration("20231116173444_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("DatabaseImplement.Models.Author", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Authors");
});
modelBuilder.Entity("DatabaseImplement.Models.Book", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PicturePath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("PublicationDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Books");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,54 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DatabaseImplement.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Authors",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
FIO = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Authors", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Books",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
PicturePath = table.Column<string>(type: "nvarchar(max)", nullable: false),
Author = table.Column<string>(type: "nvarchar(max)", nullable: false),
PublicationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Books", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Authors");
migrationBuilder.DropTable(
name: "Books");
}
}
}

View File

@@ -0,0 +1,72 @@
// <auto-generated />
using System;
using DatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace DatabaseImplement.Migrations
{
[DbContext(typeof(LibraryDatabase))]
partial class LibraryDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("DatabaseImplement.Models.Author", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Authors");
});
modelBuilder.Entity("DatabaseImplement.Models.Book", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Author")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("PicturePath")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("PublicationDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.ToTable("Books");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
public class Author
{
public int Id { get; set; }
[Required]
public string FIO { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DatabaseImplement.Models
{
public class Book
{
public int Id { get; set; }
[Required]
public string Name { get; set; }
[Required]
public string PicturePath { get; set; }
[Required]
public string Author { get; set; }
[Required]
public DateTime PublicationDate { get; set; }
}
}

View File

@@ -1,6 +1,6 @@
namespace Components
namespace Library
{
partial class Form1
partial class FormMain
{
/// <summary>
/// Required designer variable.
@@ -28,30 +28,12 @@
/// </summary>
private void InitializeComponent()
{
list_with_choice1 = new Component_1.List_with_choice();
SuspendLayout();
//
// list_with_choice1
//
list_with_choice1.Element = "";
list_with_choice1.Location = new Point(131, 60);
list_with_choice1.Name = "list_with_choice1";
list_with_choice1.Size = new Size(464, 248);
list_with_choice1.TabIndex = 0;
//
// Form1
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(list_with_choice1);
Name = "Form1";
Text = "Form1";
ResumeLayout(false);
this.components = new System.ComponentModel.Container();
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Text = "Form1";
}
#endregion
private Component_1.List_with_choice list_with_choice1;
}
}

10
Library/FormMain.cs Normal file
View File

@@ -0,0 +1,10 @@
namespace Library
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
}
}

120
Library/FormMain.resx Normal file
View File

@@ -0,0 +1,120 @@
<?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>

29
Library/Library.csproj Normal file
View File

@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CustomComponents" Version="1.0.0" />
<PackageReference Include="KOP_Labs" Version="1.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PDFsharp-MigraDoc" Version="1.50.5147" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
<PackageReference Include="ViewComponents" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BusinessLogic\BusinessLogic.csproj" />
<ProjectReference Include="..\Contracts\Contracts.csproj" />
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
</ItemGroup>
</Project>

17
Library/Program.cs Normal file
View File

@@ -0,0 +1,17 @@
namespace Library
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new FormMain());
}
}
}

29
TestView/Book.cs Normal file
View File

@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestView
{
public class Book
{
public string Genre;
public string Author;
public string Title;
public Book(string Genre, string Author, string Title)
{
this.Genre = Genre;
this.Author = Author;
this.Title = Title;
}
public Book()
{
Genre = string.Empty;
Author = string.Empty;
Title= string.Empty;
}
}
}

26
TestView/BookInfo.cs Normal file
View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestView
{
public class BookInfo
{
public string Redaction;
public string AuthorName;
public string AuthorSurname;
public string AuthorLife;
public string Title;
public BookInfo(string Redaction, string AuthorName, string AuthorSurname, string AuthorLife, string Title)
{
this.Redaction = Redaction;
this.AuthorName = AuthorName;
this.AuthorSurname = AuthorSurname;
this.AuthorLife = AuthorLife;
this.Title = Title;
}
}
}

280
TestView/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,280 @@
namespace TestView
{
partial class Form1
{
/// <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()
{
components = new System.ComponentModel.Container();
buttonAdd = new Button();
buttonClear = new Button();
buttonSelect = new Button();
list_with_choice = new ViewComponents.List_with_choice();
input_text = new ViewComponents.Input_text();
buttonDip = new Button();
buttonVal = new Button();
buttonCheck = new Button();
buttonIerarhy = new Button();
buttonAddBook = new Button();
buttonGetValue = new Button();
buttonGetIndex = new Button();
buttonSetIndex = new Button();
myTreeView = new ViewComponents.MyTreeView();
buttonPdfImages = new Button();
pdfImages1 = new ViewComponents.NotVisualComponents.PdfImages(components);
openFileDialog1 = new OpenFileDialog();
pdfTable1 = new ViewComponents.NotVisualComponents.PdfTable(components);
buttonTestPdfTable = new Button();
pieChartpdf1 = new ViewComponents.NotVisualComponents.PieChartPDF(components);
buttonChart = new Button();
SuspendLayout();
//
// buttonAdd
//
buttonAdd.Location = new Point(25, 137);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(94, 29);
buttonAdd.TabIndex = 1;
buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true;
buttonAdd.Click += buttonAdd_Click;
//
// buttonClear
//
buttonClear.Location = new Point(163, 137);
buttonClear.Name = "buttonClear";
buttonClear.Size = new Size(94, 29);
buttonClear.TabIndex = 2;
buttonClear.Text = "Очистить";
buttonClear.UseVisualStyleBackColor = true;
buttonClear.Click += buttonClear_Click;
//
// buttonSelect
//
buttonSelect.Location = new Point(60, 172);
buttonSelect.Name = "buttonSelect";
buttonSelect.Size = new Size(163, 29);
buttonSelect.TabIndex = 3;
buttonSelect.Text = "Выбранный элемент";
buttonSelect.UseVisualStyleBackColor = true;
buttonSelect.Click += buttonSelect_Click;
//
// list_with_choice
//
list_with_choice.Element = "";
list_with_choice.Location = new Point(25, 12);
list_with_choice.Name = "list_with_choice";
list_with_choice.Size = new Size(232, 119);
list_with_choice.TabIndex = 4;
list_with_choice.SelectedItemChange += list_with_choice_SelectedItemChange;
//
// input_text
//
input_text.Element = "Range exeption";
input_text.Location = new Point(312, 12);
input_text.MaxLen = -1;
input_text.MinLen = -1;
input_text.Name = "input_text";
input_text.Size = new Size(240, 119);
input_text.TabIndex = 5;
input_text.ItemChange += input_text_ItemChange;
//
// buttonDip
//
buttonDip.Location = new Point(312, 137);
buttonDip.Name = "buttonDip";
buttonDip.Size = new Size(94, 29);
buttonDip.TabIndex = 6;
buttonDip.Text = "Диапазон";
buttonDip.UseVisualStyleBackColor = true;
buttonDip.Click += buttonDip_Click;
//
// buttonVal
//
buttonVal.Location = new Point(458, 137);
buttonVal.Name = "buttonVal";
buttonVal.Size = new Size(94, 29);
buttonVal.TabIndex = 7;
buttonVal.Text = "Значение";
buttonVal.UseVisualStyleBackColor = true;
buttonVal.Click += buttonVal_Click;
//
// buttonCheck
//
buttonCheck.Location = new Point(360, 172);
buttonCheck.Name = "buttonCheck";
buttonCheck.Size = new Size(143, 29);
buttonCheck.TabIndex = 8;
buttonCheck.Text = " Проверка текста";
buttonCheck.UseVisualStyleBackColor = true;
buttonCheck.Click += buttonCheck_Click;
//
// buttonIerarhy
//
buttonIerarhy.Location = new Point(652, 32);
buttonIerarhy.Name = "buttonIerarhy";
buttonIerarhy.Size = new Size(168, 29);
buttonIerarhy.TabIndex = 10;
buttonIerarhy.Text = "Задать иерархию";
buttonIerarhy.UseVisualStyleBackColor = true;
buttonIerarhy.Click += buttonIerarhy_Click;
//
// buttonAddBook
//
buttonAddBook.Location = new Point(652, 67);
buttonAddBook.Name = "buttonAddBook";
buttonAddBook.Size = new Size(168, 29);
buttonAddBook.TabIndex = 11;
buttonAddBook.Text = "Добавить книги";
buttonAddBook.UseVisualStyleBackColor = true;
buttonAddBook.Click += buttonAddBook_Click;
//
// buttonGetValue
//
buttonGetValue.Location = new Point(652, 102);
buttonGetValue.Name = "buttonGetValue";
buttonGetValue.Size = new Size(168, 29);
buttonGetValue.TabIndex = 12;
buttonGetValue.Text = "Получить значение";
buttonGetValue.UseVisualStyleBackColor = true;
buttonGetValue.Click += buttonGetValue_Click;
//
// buttonGetIndex
//
buttonGetIndex.Location = new Point(652, 137);
buttonGetIndex.Name = "buttonGetIndex";
buttonGetIndex.Size = new Size(168, 29);
buttonGetIndex.TabIndex = 13;
buttonGetIndex.Text = "Получить индекс";
buttonGetIndex.UseVisualStyleBackColor = true;
buttonGetIndex.Click += buttonGetIndex_Click;
//
// buttonSetIndex
//
buttonSetIndex.Location = new Point(652, 172);
buttonSetIndex.Name = "buttonSetIndex";
buttonSetIndex.Size = new Size(168, 29);
buttonSetIndex.TabIndex = 14;
buttonSetIndex.Text = "Установить индекс";
buttonSetIndex.UseVisualStyleBackColor = true;
buttonSetIndex.Click += buttonSetIndex_Click;
//
// myTreeView
//
myTreeView.Location = new Point(629, 218);
myTreeView.Name = "myTreeView";
myTreeView.SelectedNodeIndex = -1;
myTreeView.Size = new Size(226, 204);
myTreeView.TabIndex = 8;
//
// buttonPdfImages
//
buttonPdfImages.Location = new Point(25, 434);
buttonPdfImages.Name = "buttonPdfImages";
buttonPdfImages.Size = new Size(197, 29);
buttonPdfImages.TabIndex = 15;
buttonPdfImages.Text = "Загрузить изображения";
buttonPdfImages.UseVisualStyleBackColor = true;
buttonPdfImages.Click += buttonPdfImages_Click;
//
// openFileDialog1
//
openFileDialog1.FileName = "openFileDialog1";
openFileDialog1.Multiselect = true;
//
// buttonTestPdfTable
//
buttonTestPdfTable.Location = new Point(282, 434);
buttonTestPdfTable.Name = "buttonTestPdfTable";
buttonTestPdfTable.Size = new Size(179, 29);
buttonTestPdfTable.TabIndex = 16;
buttonTestPdfTable.Text = "Создать таблицу";
buttonTestPdfTable.UseVisualStyleBackColor = true;
buttonTestPdfTable.Click += buttonTestPdfTable_Click;
//
// buttonChart
//
buttonChart.Location = new Point(534, 434);
buttonChart.Name = "buttonChart";
buttonChart.Size = new Size(171, 29);
buttonChart.TabIndex = 17;
buttonChart.Text = "Создать диаграмму";
buttonChart.UseVisualStyleBackColor = true;
buttonChart.Click += buttonChart_Click;
//
// Form1
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(899, 600);
Controls.Add(buttonChart);
Controls.Add(buttonTestPdfTable);
Controls.Add(buttonPdfImages);
Controls.Add(myTreeView);
Controls.Add(buttonSetIndex);
Controls.Add(buttonGetIndex);
Controls.Add(buttonGetValue);
Controls.Add(buttonAddBook);
Controls.Add(buttonIerarhy);
Controls.Add(buttonCheck);
Controls.Add(buttonVal);
Controls.Add(buttonDip);
Controls.Add(input_text);
Controls.Add(list_with_choice);
Controls.Add(buttonSelect);
Controls.Add(buttonClear);
Controls.Add(buttonAdd);
Name = "Form1";
Text = "Form1";
Load += Form1_Load;
ResumeLayout(false);
}
#endregion
private Button buttonAdd;
private Button buttonClear;
private Button buttonSelect;
private ViewComponents.List_with_choice list_with_choice;
private ViewComponents.Input_text input_text;
private Button buttonDip;
private Button buttonVal;
private Button buttonCheck;
private Button buttonIerarhy;
private Button buttonAddBook;
private Button buttonGetValue;
private Button buttonGetIndex;
private Button buttonSetIndex;
private ViewComponents.MyTreeView myTreeView;
private Button buttonPdfImages;
private ViewComponents.NotVisualComponents.PdfImages pdfImages1;
private OpenFileDialog openFileDialog1;
private ViewComponents.NotVisualComponents.PdfTable pdfTable1;
private Button buttonTestPdfTable;
private ViewComponents.NotVisualComponents.PieChartPDF pieChartpdf1;
private Button buttonChart;
}
}

168
TestView/Form1.cs Normal file
View File

@@ -0,0 +1,168 @@
using MigraDoc.DocumentObjectModel;
using System.IO;
using System.Windows.Forms;
using ViewComponents.Exeption;
using ViewComponents.NotVisualComponents;
namespace TestView
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void buttonAdd_Click(object sender, EventArgs e)
{
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
list_with_choice.Fill_List("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonClear_Click(object sender, EventArgs e)
{
list_with_choice.Clean_List();
}
private void buttonSelect_Click(object sender, EventArgs e)
{
MessageBox.Show(list_with_choice.Element ?? "null", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void list_with_choice_SelectedItemChange(string obj)
{
MessageBox.Show(obj, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonDip_Click(object sender, EventArgs e)
{
input_text.MinLen = 5;
input_text.MaxLen = 25;
MessageBox.Show($"Min: {input_text.MinLen}; Max: {input_text.MaxLen}");
}
private void buttonVal_Click(object sender, EventArgs e)
{
input_text.Element = "Sample text";
}
private void input_text_ItemChange(string obj)
{
MessageBox.Show(obj, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonCheck_Click(object sender, EventArgs e)
{
try
{
if (input_text.Element.Equals("Range exeption"))
throw new TextBoundsNotSetExeption("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>");
if (input_text.Element.Equals("Value exeption"))
throw new TextOutOfBoundsExeption("<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
MessageBox.Show(input_text.Element, "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
catch (TextBoundsNotSetExeption ex)
{
MessageBox.Show(ex.Message);
}
catch (TextOutOfBoundsExeption ex)
{
MessageBox.Show(ex.Message);
}
}
private void buttonIerarhy_Click(object sender, EventArgs e)
{
myTreeView.setHierarchy(new List<(string, bool)> { ("Genre", false), ("Author", false), ("Title", true) });
MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonAddBook_Click(object sender, EventArgs e)
{
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>.", <><CCB8><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"));
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>.", "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>"));
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1984"));
myTreeView.addItem(new Book("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"));
}
private void buttonGetValue_Click(object sender, EventArgs e)
{
Book? book = myTreeView.getSelecetedNodeValue<Book>();
if (book == null) return;
MessageBox.Show("<22><><EFBFBD><EFBFBD>: " + book.Genre + ", <20><><EFBFBD><EFBFBD><EFBFBD>: " + book.Author + ", <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: " + book.Title);
}
private void buttonGetIndex_Click(object sender, EventArgs e)
{
MessageBox.Show(myTreeView.SelectedNodeIndex.ToString());
}
private void buttonSetIndex_Click(object sender, EventArgs e)
{
myTreeView.SelectedNodeIndex = 1;
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void buttonPdfImages_Click(object sender, EventArgs e)
{
var res = openFileDialog1.ShowDialog(this);
if (res != DialogResult.OK) return;
var files = openFileDialog1.FileNames;
openFileDialog1.Dispose();
string path = "C:\\Users\\xarla\\OneDrive\\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\\test.pdf";
MessageBox.Show(path);
if (pdfImages1.CreatePdfDoc(new ImagesForPDF(path, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", files))) MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD>!");
else MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonTestPdfTable_Click(object sender, EventArgs e)
{
List<BookInfo> books = new List<BookInfo>
{
new BookInfo("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1809-1852", <><CCB8><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"),
new BookInfo("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1818-1883", "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>"),
new BookInfo("<22><><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1903-1950", "1984"),
new BookInfo("<22><><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "1965 - <20>.<2E>.", "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
};
List<(int, int)> merges = new List<(int, int)>();
merges.Add((2, 4));
List<int> heights = new List<int> { 10, 40, 60, 20, 25, 15, 20 };
string path = "C:\\Users\\xarla\\OneDrive\\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\\test.pdf";
List<(string, string)> headers = new List<(string, string)> { ("id", "Id"), ("Redaction", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
("", "<22><><EFBFBD><EFBFBD><EFBFBD>"), ("AuthorName", "<22><><EFBFBD>"),
("AuthorSurname", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"), ("AuthorLife", "<22><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>"),
("Title", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>") };
if (pdfTable1.createTable(new DataForPDFTable<BookInfo>(path, "test2", heights, merges, headers, books))) MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD>");
}
private void buttonChart_Click(object sender, EventArgs e)
{
string path = "C:\\Users\\xarla\\OneDrive\\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\\chart.pdf";
List<(double, string)> elements = new List<(double, string)>
{
(200, <><CCB8><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>"),
(157, "<22><><EFBFBD><EFBFBD>"),
(344, "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>"),
(588, "<22><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"),
(286, "<22><><EFBFBD><EFBFBD><EFBFBD> 2033")
};
if(pieChartpdf1.CreatePieChart(new DataForPDFPieChart(path, "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", DiagramLegendEnum.Top ,"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>", elements))) MessageBox.Show("<22><><EFBFBD><EFBFBD><EFBFBD>");
}
}
}

72
TestView/Form1.resx Normal file
View File

@@ -0,0 +1,72 @@
<root>
<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>
<metadata name="pdfImages1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>150, 17</value>
</metadata>
<metadata name="pdfTable1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>317, 17</value>
</metadata>
<metadata name="pieChartpdf1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>438, 17</value>
</metadata>
</root>

View File

@@ -1,4 +1,4 @@
namespace Components
namespace TestView
{
internal static class Program
{

31
TestView/TestView.csproj Normal file
View File

@@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>TestView</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DatabaseImplement\DatabaseImplement.csproj" />
<ProjectReference Include="..\ViewComponents\ViewComponents.csproj" />
</ItemGroup>
<ItemGroup>
<Compile Update="Program.cs">
<CustomToolNamespace></CustomToolNamespace>
</Compile>
</ItemGroup>
</Project>

55
TestView/TestView.sln Normal file
View File

@@ -0,0 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestView", "TestView.csproj", "{637B2B5F-8015-4DE8-B264-74F24B115812}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ViewComponents", "..\ViewComponents\ViewComponents.csproj", "{45A652EE-B79B-4F5B-BB2A-2A51F5BEA2F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contracts", "..\Contracts\Contracts.csproj", "{088EE607-4CC2-4F8D-8571-BA09A4A6A4B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BusinessLogic", "..\BusinessLogic\BusinessLogic.csproj", "{84504BF2-6F50-435D-B6D4-6A06D48331A0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseImplement", "..\DatabaseImplement\DatabaseImplement.csproj", "{D9EA1B1E-A8A9-4C13-BFC9-579832B878BF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Library", "..\Library\Library.csproj", "{B74E170A-9AB6-4A1A-9125-42B479DBFBF4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{637B2B5F-8015-4DE8-B264-74F24B115812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Debug|Any CPU.Build.0 = Debug|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Release|Any CPU.ActiveCfg = Release|Any CPU
{637B2B5F-8015-4DE8-B264-74F24B115812}.Release|Any CPU.Build.0 = Release|Any CPU
{45A652EE-B79B-4F5B-BB2A-2A51F5BEA2F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{45A652EE-B79B-4F5B-BB2A-2A51F5BEA2F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45A652EE-B79B-4F5B-BB2A-2A51F5BEA2F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45A652EE-B79B-4F5B-BB2A-2A51F5BEA2F1}.Release|Any CPU.Build.0 = Release|Any CPU
{088EE607-4CC2-4F8D-8571-BA09A4A6A4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{088EE607-4CC2-4F8D-8571-BA09A4A6A4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{088EE607-4CC2-4F8D-8571-BA09A4A6A4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{088EE607-4CC2-4F8D-8571-BA09A4A6A4B5}.Release|Any CPU.Build.0 = Release|Any CPU
{84504BF2-6F50-435D-B6D4-6A06D48331A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{84504BF2-6F50-435D-B6D4-6A06D48331A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84504BF2-6F50-435D-B6D4-6A06D48331A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84504BF2-6F50-435D-B6D4-6A06D48331A0}.Release|Any CPU.Build.0 = Release|Any CPU
{D9EA1B1E-A8A9-4C13-BFC9-579832B878BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9EA1B1E-A8A9-4C13-BFC9-579832B878BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9EA1B1E-A8A9-4C13-BFC9-579832B878BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9EA1B1E-A8A9-4C13-BFC9-579832B878BF}.Release|Any CPU.Build.0 = Release|Any CPU
{B74E170A-9AB6-4A1A-9125-42B479DBFBF4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B74E170A-9AB6-4A1A-9125-42B479DBFBF4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B74E170A-9AB6-4A1A-9125-42B479DBFBF4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B74E170A-9AB6-4A1A-9125-42B479DBFBF4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C28CD353-C746-4FFE-9D0D-D48764205D7B}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.Exeption
{
[Serializable]
public class TextBoundsNotSetExeption: ApplicationException
{
public TextBoundsNotSetExeption() : base() { }
public TextBoundsNotSetExeption(string message) : base(message) { }
public TextBoundsNotSetExeption(string message, Exception exception) : base(message, exception) { }
protected TextBoundsNotSetExeption(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.Exeption
{
[Serializable]
public class TextOutOfBoundsExeption: ApplicationException
{
public TextOutOfBoundsExeption() : base() { }
public TextOutOfBoundsExeption(string message) : base(message) { }
public TextOutOfBoundsExeption(string message, Exception exception) : base(message, exception) { }
protected TextOutOfBoundsExeption(SerializationInfo info, StreamingContext contex) : base(info, contex) { }
}
}

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public class DataForPDFPieChart
{
public string FilePath = string.Empty;
public string DocumentTitle = string.Empty;//заголовок документа
public string ChartTitle = string.Empty;//заголовок диаграммы
public DiagramLegendEnum diagLegend;
public string LegendName = string.Empty;
public List<(double,string)> Items;
public DataForPDFPieChart(string filePath, string documentTitle, string charttitle, DiagramLegendEnum diagLegend, string legendName, List<(double, string)> items)
{
FilePath = filePath;
DocumentTitle = documentTitle;
ChartTitle = charttitle;
this.diagLegend = diagLegend;
LegendName = legendName;
Items = items;
}
}
}

View File

@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public class DataForPDFTable<T>
{
public string FilePath = string.Empty;
public string DocumentTitle = string.Empty; //заголовок документа
public List<int> Heights; // высота строк
public List<(int, int)> Merges; // информаци о объединении ячеек
public List<(string, string)> Headers; //заголовки шапки таблицы
public List<T> Data;
public DataForPDFTable(string filePath, string documentTitle, List<int> heights, List<(int, int)> merges, List<(string, string)> headers, List<T> data)
{
FilePath = filePath;
DocumentTitle = documentTitle;
Heights = heights;
Merges = merges;
Headers = headers;
Data = data;
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public enum DiagramLegendEnum
{
Top = 0,
Bottom = 1,
Right = 2,
Left = 3,
}
}

View File

@@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public class ImagesForPDF
{
public ImagesForPDF(string filepath, string header, string[] imagepaths)
{
this.filepath = filepath;
this.header = header;
this.imagepaths = imagepaths;
}
public string filepath;
public string header;
public string[] imagepaths;
}
}

View File

@@ -0,0 +1,36 @@
namespace ViewComponents.NotVisualComponents
{
partial class PdfImages
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,73 @@
using MigraDoc.DocumentObjectModel;
using MigraDoc.Rendering;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ViewComponents.NotVisualComponents
{
public partial class PdfImages : Component
{
public PdfImages()
{
InitializeComponent();
}
public PdfImages(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public bool CreatePdfDoc (ImagesForPDF imagesForPDF)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
CheckFileExsists(imagesForPDF);
// создание документа
Document _document = new Document();
var style = _document.Styles["Normal"];
style.Font.Name = "Arial";
style.Font.Size = 25;
style = _document.Styles.AddStyle("NormalTitle", "Normal");
style.Font.Bold = true;
//добавление заголовка
var section = _document.AddSection();
var paragraph = section.AddParagraph(imagesForPDF.header);
paragraph.Format.Alignment = ParagraphAlignment.Center;
paragraph.Format.SpaceAfter = "2cm";
//добавление изображений
foreach (string path in imagesForPDF.imagepaths)
if (File.Exists(path)) section.AddImage(path);
//сохранение документа
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true);
renderer.Document = _document;
renderer.RenderDocument();
renderer.PdfDocument.Save(imagesForPDF.filepath);
return true;
}
private void CheckFileExsists(ImagesForPDF imagesForPDF)
{
if (string.IsNullOrEmpty(imagesForPDF.filepath) || string.IsNullOrEmpty(imagesForPDF.header) || imagesForPDF.imagepaths.Length == 0)
{
throw new ArgumentNullException();
}
if (!File.Exists(imagesForPDF.filepath))
{
throw new FileNotFoundException(imagesForPDF.filepath);
}
}
}
}

View File

@@ -0,0 +1,36 @@
namespace ViewComponents.NotVisualComponents
{
partial class PdfTable
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,177 @@
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Tables;
using MigraDoc.Rendering;
using PdfSharp.Pdf.Content.Objects;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public partial class PdfTable : Component
{
public PdfTable()
{
InitializeComponent();
}
public PdfTable(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public bool createTable<T>(DataForPDFTable<T> dataForPDF)
{
//проверки
if (dataForPDF.Merges.Count == 0 || dataForPDF.Heights.Count == 0 || dataForPDF.Headers.Count == 0
|| dataForPDF.Data.Count == 0 || string.IsNullOrEmpty(dataForPDF.FilePath)
|| string.IsNullOrEmpty(dataForPDF.DocumentTitle)) throw new ArgumentException("Недостаточно данных");
int[] cellsArray = new int[dataForPDF.Heights.Count];
foreach (var merge in dataForPDF.Merges)
{
if (merge.Item1 >= merge.Item2) throw new ArgumentException("Неправильно заполнены объединения строк");
for (int i = merge.Item1; i < merge.Item2; i++)
{
cellsArray[i]++;
}
}
foreach (int cell in cellsArray)
{
if (cell > 1) throw new ArgumentException("Объединения заходят друг на друга");
}
foreach ((string, string) el in dataForPDF.Headers)
if (string.IsNullOrEmpty(el.Item2)) throw new ArgumentException("Элементы шапки не могут быть пустыми");
//создание документа
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Document _document = new Document();
var style = _document.Styles["Normal"];
style = _document.Styles.AddStyle("NormalTitle", "Normal");
style.Font.Name = "Arial";
style.Font.Size = 25;
style.Font.Bold = true;
style = _document.Styles.AddStyle("Table", "Normal");
style.Font.Name = "Times New Roman";
style.Font.Size = 12;
//добавление заголовка
var section = _document.AddSection();
var paragraph = section.AddParagraph(dataForPDF.DocumentTitle);
paragraph.Format.Alignment = ParagraphAlignment.Center;
paragraph.Format.SpaceAfter = "2cm";
paragraph.Style = "NormalTitle";
//добавление таблицы
Table table = section.AddTable();
table.Style = "Table";
table.Borders.Width = 0.25;
Column column;
for (int i = 0; i < dataForPDF.Data.Count + 2; i++)
{
column = table.AddColumn();
column.Format.Alignment = ParagraphAlignment.Center;
}
// создание шапки и заполнение контентом
int mergeRange = 0; //размерность слияния
int mergeIndex = 0; //стартовый индекс начала слияния
Row row;
for (int i = 0; i < dataForPDF.Headers.Count; i++)
{
//если элемент шапки группируются по строкам
if (dataForPDF.Merges.Select(x => x.Item1).Contains(mergeIndex))
{
mergeRange = dataForPDF.Merges.Find(x => x.Item1 == mergeIndex).Item2 - mergeIndex;
mergeIndex = dataForPDF.Merges.Find(x => x.Item1 == mergeIndex).Item2 + 1;
//стилизация ячейки. в этом блоке кода (до цикла) создаётся объединяющая ячейка
row = table.AddRow();
row.Height = dataForPDF.Heights[i];
row.Format.Alignment = ParagraphAlignment.Center;
row.Format.Font.Bold = true;
row.Cells[0].AddParagraph(dataForPDF.Headers[i].Item2);
row.Cells[0].VerticalAlignment = VerticalAlignment.Center;
row.Cells[0].MergeDown = mergeRange;
//с этого места создаются дочерние ячейки
for (int k = 0; k<mergeRange; k++)
{
i++;
row.Cells[1].AddParagraph(dataForPDF.Headers[i].Item2);
AddTheContent<T>(dataForPDF.Data, table, dataForPDF.Headers[i].Item1, row.Index, 2);
row.Cells[1].VerticalAlignment = VerticalAlignment.Center;
row = table.AddRow();
row.Height = dataForPDF.Heights[i];
row.Format.Font.Bold = true;
row.Format.Alignment = ParagraphAlignment.Center;
}
i++;
row.Cells[1].AddParagraph(dataForPDF.Headers[i].Item2);
AddTheContent<T>(dataForPDF.Data, table, dataForPDF.Headers[i].Item1, row.Index, 2);
row.Cells[1].VerticalAlignment = VerticalAlignment.Center;
}
else //если элемент шапки не группируется по строкам
{
//стилизация ячейки
row = table.AddRow();
row.Height = dataForPDF.Heights[i];
row.Format.Font.Bold = true;
row.Format.Alignment = ParagraphAlignment.Center;
row.Cells[0].AddParagraph(dataForPDF.Headers[i].Item2);
row.Cells[0].VerticalAlignment = VerticalAlignment.Center;
row.Cells[0].MergeRight = 1;
AddTheContent<T>(dataForPDF.Data, table, dataForPDF.Headers[i].Item1, row.Index, 2);
mergeIndex++;
}
}
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true);
renderer.Document = _document;
renderer.RenderDocument();
renderer.PdfDocument.Save(dataForPDF.FilePath);
return true;
}
//метод заполнения таблицы контентом, заполнение происходит построчно.
public void AddTheContent<T>(List<T> items, Table table, string header, int row_index, int cell_index)
{
foreach (Row r in table.Rows)
{
for (int i = 0; i<items.Count; i++)
{
if (r.Index == row_index && row_index == 0) r.Cells[cell_index+i].AddParagraph((i+1).ToString());
else if(row_index!=0 && r.Index == row_index)
{
T item = items[i];
var type = typeof(T);
var fields = type.GetFields();
var field = fields.FirstOrDefault(x => x.Name.Equals(header));
r.Cells[cell_index + i].AddParagraph(field.GetValue(item).ToString());
r.Cells[cell_index + i].VerticalAlignment = VerticalAlignment.Center;
}
}
}
}
}
}

View File

@@ -0,0 +1,36 @@
namespace ViewComponents.NotVisualComponents
{
partial class PieChartPDF
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}

View File

@@ -0,0 +1,85 @@
using MigraDoc.DocumentObjectModel;
using MigraDoc.DocumentObjectModel.Shapes.Charts;
using MigraDoc.Rendering;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewComponents.NotVisualComponents
{
public partial class PieChartPDF : Component
{
public PieChartPDF()
{
InitializeComponent();
}
public PieChartPDF(IContainer container)
{
container.Add(this);
InitializeComponent();
}
public bool CreatePieChart(DataForPDFPieChart dataForPDFPie)
{
// проверки
if (string.IsNullOrEmpty(dataForPDFPie.FilePath) || string.IsNullOrEmpty(dataForPDFPie.DocumentTitle) || string.IsNullOrEmpty(dataForPDFPie.ChartTitle)
|| string.IsNullOrEmpty(dataForPDFPie.LegendName)
|| dataForPDFPie.Items.Count == 0) throw new ArgumentException("Недостаточно данных");
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Document _document = new Document();
var section = _document.AddSection();
var paragraph = section.AddParagraph(dataForPDFPie.DocumentTitle);
paragraph.Format.Alignment = ParagraphAlignment.Center;
paragraph.Format.SpaceAfter = "2cm";
Chart chart = section.AddChart(ChartType.Pie2D);
chart.Width = Unit.FromCentimeter(16);
chart.Height = Unit.FromCentimeter(12);
chart.HeaderArea.AddParagraph(dataForPDFPie.ChartTitle); // заголовок диаграммы
Series series = chart.SeriesCollection.AddSeries();
series.Name = dataForPDFPie.LegendName; // название сериии
XSeries xseries = chart.XValues.AddXSeries();
foreach ((double, string) el in dataForPDFPie.Items) // заполнение серии
{
series.Add(el.Item1);
xseries.Add(el.Item2);
}
switch (dataForPDFPie.diagLegend) // позиция легенды
{
case DiagramLegendEnum.Top:
chart.TopArea.AddLegend();
break;
case DiagramLegendEnum.Bottom:
chart.BottomArea.AddLegend();
break;
case DiagramLegendEnum.Right:
chart.RightArea.AddLegend();
break;
case DiagramLegendEnum.Left:
chart.LeftArea.AddLegend();
break;
}
chart.DataLabel.Type = DataLabelType.Percent;
chart.DataLabel.Position = DataLabelPosition.OutsideEnd;
PdfDocumentRenderer renderer = new PdfDocumentRenderer(true);
renderer.Document = _document;
renderer.RenderDocument();
renderer.PdfDocument.Save(dataForPDFPie.FilePath);
return true;
}
}
}

View File

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PDFsharp-MigraDoc" Version="1.50.5147" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Compile Update="VisualComponents\Input_text.cs">
<SubType>UserControl</SubType>
<CustomToolNamespace>TestView</CustomToolNamespace>
</Compile>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,58 @@
namespace ViewComponents
{
partial class Input_text
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
textBox1 = new TextBox();
SuspendLayout();
//
// textBox1
//
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
textBox1.Location = new Point(19, 25);
textBox1.Name = "textBox1";
textBox1.Size = new Size(154, 27);
textBox1.TabIndex = 0;
textBox1.TextChanged += textBox1_TextChanged;
//
// Input_text
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
Controls.Add(textBox1);
Name = "Input_text";
Size = new Size(192, 79);
ResumeLayout(false);
PerformLayout();
}
#endregion
private TextBox textBox1;
}
}

View File

@@ -0,0 +1,48 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ViewComponents.Exeption;
namespace ViewComponents
{
public partial class Input_text : UserControl
{
public Input_text()
{
InitializeComponent();
}
public event Action<string?> ItemChange;
public int MinLen { get; set; } = -1;
public int MaxLen { get; set; } = -1;
public string Element
{
get
{
if (MinLen < 0 || MaxLen < 0) return "Range exeption";
if (textBox1.Text.Length < MinLen || textBox1.Text.Length > MaxLen) return "Value exeption";
return textBox1.Text;
}
set
{
if (MinLen >= 0 && MaxLen >= 0 && value != null && value.Length >= MinLen && value.Length <= MaxLen) textBox1.Text = value;
}
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
ItemChange?.Invoke(textBox1.Text);
}
}
}

View File

@@ -1,4 +1,4 @@
namespace Component_1
namespace ViewComponents
{
partial class List_with_choice
{
@@ -29,58 +29,30 @@
private void InitializeComponent()
{
checkedListBox1 = new CheckedListBox();
button_Load = new Button();
button_Clean = new Button();
SuspendLayout();
//
// checkedListBox1
//
checkedListBox1.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
checkedListBox1.Dock = DockStyle.Fill;
checkedListBox1.FormattingEnabled = true;
checkedListBox1.Location = new Point(85, 23);
checkedListBox1.Location = new Point(0, 0);
checkedListBox1.Name = "checkedListBox1";
checkedListBox1.Size = new Size(201, 92);
checkedListBox1.Size = new Size(208, 150);
checkedListBox1.TabIndex = 0;
checkedListBox1.SelectedIndexChanged += checkedListBox1_SelectedIndexChanged;
//
// button_Load
//
button_Load.Anchor = AnchorStyles.Bottom;
button_Load.Location = new Point(6, 146);
button_Load.Name = "button_Load";
button_Load.Size = new Size(161, 29);
button_Load.TabIndex = 1;
button_Load.Text = "Заполнить список";
button_Load.UseVisualStyleBackColor = true;
button_Load.Click += button_Load_Click;
//
// button_Clean
//
button_Clean.Anchor = AnchorStyles.Bottom;
button_Clean.Location = new Point(203, 146);
button_Clean.Name = "button_Clean";
button_Clean.Size = new Size(153, 29);
button_Clean.TabIndex = 2;
button_Clean.Text = "Очистить список";
button_Clean.UseVisualStyleBackColor = true;
button_Clean.Click += button_Clean_Click;
//
// List_with_choice
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
Controls.Add(button_Clean);
Controls.Add(button_Load);
Controls.Add(checkedListBox1);
Name = "List_with_choice";
Size = new Size(371, 198);
Size = new Size(208, 150);
ResumeLayout(false);
}
#endregion
private CheckedListBox checkedListBox1;
private Button button_Load;
private Button button_Clean;
}
}

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ViewComponents
{
public partial class List_with_choice : UserControl
{
public List_with_choice()
{
InitializeComponent();
}
public event Action<string?> SelectedItemChange;
public string? Element
{
get
{
if (checkedListBox1.SelectedItem != null) return checkedListBox1.SelectedItem.ToString();
else return string.Empty;
}
set
{
if (value != null && checkedListBox1.Items.Contains(value)) checkedListBox1.SelectedItem = value;
}
}
public void Fill_List(string str) //метод заполнения списка
{
if (str == null)
{
return;
}
checkedListBox1.Items.Add(str);
}
public void Clean_List() //метод очистки списка
{
checkedListBox1.Items.Clear();
}
private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
SelectedItemChange?.Invoke(checkedListBox1.SelectedItem.ToString());
}
}
}

View File

@@ -0,0 +1,55 @@
namespace ViewComponents
{
partial class MyTreeView
{
/// <summary>
/// Обязательная переменная конструктора.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Освободить все используемые ресурсы.
/// </summary>
/// <param name="disposing">истинно, если управляемый ресурс должен быть удален; иначе ложно.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Код, автоматически созданный конструктором компонентов
/// <summary>
/// Требуемый метод для поддержки конструктора — не изменяйте
/// содержимое этого метода с помощью редактора кода.
/// </summary>
private void InitializeComponent()
{
treeView = new TreeView();
SuspendLayout();
//
// treeView
//
treeView.Location = new Point(13, 18);
treeView.Name = "treeView";
treeView.Size = new Size(176, 148);
treeView.TabIndex = 0;
//
// MyTreeView
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
Controls.Add(treeView);
Name = "MyTreeView";
Size = new Size(204, 192);
ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TreeView treeView;
}
}

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace ViewComponents
{
public partial class MyTreeView : UserControl
{
public MyTreeView()
{
InitializeComponent();
}
private List<(string, bool)> hierarchy = new List<(string, bool)>();
public int SelectedNodeIndex
{
get
{
return treeView.SelectedNode?.Index ?? -1;
}
set
{
if (treeView.SelectedNode == null) treeView.SelectedNode = value >= 0 && value < treeView.Nodes.Count ? treeView.Nodes[value] : treeView.SelectedNode;
else treeView.SelectedNode = value >= 0 && value < treeView.SelectedNode.Nodes.Count ? treeView.SelectedNode.Nodes[value] : treeView.SelectedNode;
}
}
public T? getSelecetedNodeValue<T>()
{
if (treeView.SelectedNode == null || treeView.SelectedNode.Nodes.Count > 0) return default(T);
TreeNode? node = treeView.SelectedNode;
var type = typeof(T);
var fields = type.GetFields();
var item = Activator.CreateInstance(type);
while (node != null)
{
var field = fields.FirstOrDefault(x => x.Name == node.Name);
if (field != null)
{
field.SetValue(item, node.Text);
}
node = node.Parent;
}
return item != null ? (T)item : default(T);
}
public void setHierarchy(List<(string, bool)> fields)
{
hierarchy = fields;
}
public void addItem<T>(T item)
{
var type = typeof(T);
var fields = type.GetFields();
TreeNodeCollection nodes = treeView.Nodes;
for (int i = 0; i < hierarchy.Count; i++)
{
var field = fields.FirstOrDefault(x => x.Name.Equals(hierarchy[i].Item1));
if (field is not null)
{
var node = nodes.Find(field.Name, false).FirstOrDefault(x => x.Text == field.GetValue(item).ToString());
if (node is not null && !hierarchy[i].Item2)
{
nodes = node.Nodes;
}
else
{
TreeNode newNode = nodes.Add(field.Name, field.GetValue(item).ToString());
nodes = newNode.Nodes;
}
}
}
}
}
}

View File

@@ -0,0 +1,60 @@
<root>
<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>

10
nuget.config Normal file
View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="ComponentsForKOP" value="C:\ComponentsForKOP" />
</packageSources>
<activePackageSource>
<!-- this tells that all of them are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>

0
nuget.config.bak Normal file
View File