FixSome_Lab07

This commit is contained in:
BroPlasmaNinja 2024-05-22 14:41:02 +04:00
parent e74c6e7396
commit 1d6303ac0d
2 changed files with 37 additions and 10 deletions

View File

@ -6,6 +6,10 @@
"AbsoluteMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|c:\\somegitstuff\\isebd-11_khatypov_k.r_fundamental\\projectliner\\projectliner\\formlinercollection.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|solutionrelative:projectliner\\formlinercollection.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|c:\\somegitstuff\\isebd-11_khatypov_k.r_fundamental\\projectliner\\projectliner\\nlog.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}",
"RelativeMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|solutionrelative:projectliner\\nlog.config||{FA3CD31E-987B-443A-9B81-186104E8DAC1}"
},
{
"AbsoluteMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|c:\\somegitstuff\\isebd-11_khatypov_k.r_fundamental\\projectliner\\projectliner\\collectiongenericobjects\\abstractcompany.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{7FB62E78-175F-490A-B5F2-2FF676947033}|ProjectLiner\\ProjectLiner.csproj|solutionrelative:projectliner\\collectiongenericobjects\\abstractcompany.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
@ -38,7 +42,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 3,
"SelectedChildIndex": 4,
"Children": [
{
"$type": "Bookmark",
@ -50,7 +54,20 @@
},
{
"$type": "Document",
"DocumentIndex": 3,
"DocumentIndex": 1,
"Title": "nlog.config",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\nlog.config",
"RelativeDocumentMoniker": "ProjectLiner\\nlog.config",
"ToolTip": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\nlog.config",
"RelativeToolTip": "ProjectLiner\\nlog.config",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000601|",
"WhenOpened": "2024-05-22T09:46:17.634Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "FormLinerConfig.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\FormLinerConfig.cs",
"RelativeDocumentMoniker": "ProjectLiner\\FormLinerConfig.cs",
@ -69,14 +86,14 @@
"RelativeDocumentMoniker": "ProjectLiner\\FormLinerCollection.cs",
"ToolTip": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\FormLinerCollection.cs",
"RelativeToolTip": "ProjectLiner\\FormLinerCollection.cs",
"ViewState": "AQIAAD8AAAAAAAAAAAAqwFIAAAA5AAAA",
"ViewState": "AQIAAOYAAAAAAAAAAAAAAPYAAAAgAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-05-22T09:31:35.635Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 2,
"Title": "AbstractCompany.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\CollectionGenericObjects\\AbstractCompany.cs",
"RelativeDocumentMoniker": "ProjectLiner\\CollectionGenericObjects\\AbstractCompany.cs",
@ -89,7 +106,7 @@
},
{
"$type": "Document",
"DocumentIndex": 4,
"DocumentIndex": 5,
"Title": "StorageCollection.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\CollectionGenericObjects\\StorageCollection.cs",
"RelativeDocumentMoniker": "ProjectLiner\\CollectionGenericObjects\\StorageCollection.cs",
@ -102,7 +119,7 @@
},
{
"$type": "Document",
"DocumentIndex": 6,
"DocumentIndex": 7,
"Title": "ICollectionGenericObjects.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\CollectionGenericObjects\\ICollectionGenericObjects.cs",
"RelativeDocumentMoniker": "ProjectLiner\\CollectionGenericObjects\\ICollectionGenericObjects.cs",
@ -115,7 +132,7 @@
},
{
"$type": "Document",
"DocumentIndex": 5,
"DocumentIndex": 6,
"Title": "ListGenericObjects.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\CollectionGenericObjects\\ListGenericObjects.cs",
"RelativeDocumentMoniker": "ProjectLiner\\CollectionGenericObjects\\ListGenericObjects.cs",
@ -128,7 +145,7 @@
},
{
"$type": "Document",
"DocumentIndex": 2,
"DocumentIndex": 3,
"Title": "MassiveGenericObjects.cs",
"DocumentMoniker": "C:\\SomeGitStuff\\ISEbd-11_Khatypov_K.R_fundamental\\ProjectLiner\\ProjectLiner\\CollectionGenericObjects\\MassiveGenericObjects.cs",
"RelativeDocumentMoniker": "ProjectLiner\\CollectionGenericObjects\\MassiveGenericObjects.cs",

View File

@ -32,6 +32,7 @@ public partial class FormLinerCollection : Form
{
FormLinerConfig form = new();
// TODO передать метод
_logger.LogInformation("Добавлен новый лайнер");
form.Show();
form.AddEvent(SetLiner);
}
@ -67,6 +68,7 @@ public partial class FormLinerCollection : Form
}
if (MessageBox.Show("Удалить объект?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
_logger.LogInformation("Удалили объект");
return;
}
int pos = Convert.ToInt32(maskedTextBox.Text); try
@ -131,10 +133,12 @@ public partial class FormLinerCollection : Form
CollectionType collectionType = CollectionType.None;
if (radioButtonMassive.Checked)
{
_logger.LogInformation("Добавили массив");
collectionType = CollectionType.Massive;
}
else if (radioButtonList.Checked)
{
_logger.LogInformation("Добавили лист");
collectionType = CollectionType.List;
}
_storageCollection.AddCollection(textBoxCollectionName.Text, collectionType);
@ -165,6 +169,8 @@ public partial class FormLinerCollection : Form
}
if (MessageBox.Show("Удалить коллекцию?", "Удаление", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
_logger.LogInformation("Удалили коллецию " + listBoxCollection.SelectedItem.ToString());
return;
}
_storageCollection.DelCollection(listBoxCollection.SelectedItem.ToString());
@ -229,16 +235,20 @@ public partial class FormLinerCollection : Form
{
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
if (_storageCollection.LoadData(openFileDialog.FileName))
try
{
_storageCollection.LoadData(openFileDialog.FileName);
MessageBox.Show("Загрузка прошла успешно",
"Результат", MessageBoxButtons.OK, MessageBoxIcon.Information);
_logger.LogInformation("Сохранение в файл: {filename}",
openFileDialog.FileName);
RerfreshListBoxItems();
}
else
catch(Exception ex)
{
MessageBox.Show("Не сохранилось", "Результат",
MessageBoxButtons.OK, MessageBoxIcon.Error);
_logger.LogError("Ошибка: {Message}", ex.Message);
}
}
}