From 78e2098513a51afb40e7621c36acc2a3c4899967 Mon Sep 17 00:00:00 2001 From: Kirill <117719052+KirillFirsof@users.noreply.github.com> Date: Sun, 17 Nov 2024 13:31:27 +0400 Subject: [PATCH] lab2 --- .../testComponent.Designer.cs | 0 .../Components/testComponent.cs | 25 +++++++ .../HierarchicalTreeView.Designer.cs | 0 .../HierarchicalTreeView.cs | 0 .../HierarchicalTreeView.resx | 0 .../SmartCheckedListBox.Designer.cs | 0 .../SmartCheckedListBox.cs | 0 .../SmartCheckedListBox.resx | 0 .../SmartTextBox.Designer.cs | 0 .../{ => VisualComponents}/SmartTextBox.cs | 0 .../{ => VisualComponents}/SmartTextBox.resx | 0 .../ValueOutOfRangeException.cs | 2 +- CheckedListBoxLibrary/testComponent.cs | 65 ------------------- 13 files changed, 26 insertions(+), 66 deletions(-) rename CheckedListBoxLibrary/{ => Components}/testComponent.Designer.cs (100%) create mode 100644 CheckedListBoxLibrary/Components/testComponent.cs rename CheckedListBoxLibrary/{ => VisualComponents}/HierarchicalTreeView.Designer.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/HierarchicalTreeView.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/HierarchicalTreeView.resx (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartCheckedListBox.Designer.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartCheckedListBox.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartCheckedListBox.resx (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartTextBox.Designer.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartTextBox.cs (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/SmartTextBox.resx (100%) rename CheckedListBoxLibrary/{ => VisualComponents}/ValueOutOfRangeException.cs (86%) delete mode 100644 CheckedListBoxLibrary/testComponent.cs diff --git a/CheckedListBoxLibrary/testComponent.Designer.cs b/CheckedListBoxLibrary/Components/testComponent.Designer.cs similarity index 100% rename from CheckedListBoxLibrary/testComponent.Designer.cs rename to CheckedListBoxLibrary/Components/testComponent.Designer.cs diff --git a/CheckedListBoxLibrary/Components/testComponent.cs b/CheckedListBoxLibrary/Components/testComponent.cs new file mode 100644 index 0000000..caa8b4e --- /dev/null +++ b/CheckedListBoxLibrary/Components/testComponent.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MyUserControls.Components +{ + public partial class testComponent : Component + { + public testComponent() + { + InitializeComponent(); + } + + public testComponent(IContainer container) + { + container.Add(this); + + InitializeComponent(); + } + } +} diff --git a/CheckedListBoxLibrary/HierarchicalTreeView.Designer.cs b/CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.Designer.cs similarity index 100% rename from CheckedListBoxLibrary/HierarchicalTreeView.Designer.cs rename to CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.Designer.cs diff --git a/CheckedListBoxLibrary/HierarchicalTreeView.cs b/CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.cs similarity index 100% rename from CheckedListBoxLibrary/HierarchicalTreeView.cs rename to CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.cs diff --git a/CheckedListBoxLibrary/HierarchicalTreeView.resx b/CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.resx similarity index 100% rename from CheckedListBoxLibrary/HierarchicalTreeView.resx rename to CheckedListBoxLibrary/VisualComponents/HierarchicalTreeView.resx diff --git a/CheckedListBoxLibrary/SmartCheckedListBox.Designer.cs b/CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.Designer.cs similarity index 100% rename from CheckedListBoxLibrary/SmartCheckedListBox.Designer.cs rename to CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.Designer.cs diff --git a/CheckedListBoxLibrary/SmartCheckedListBox.cs b/CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.cs similarity index 100% rename from CheckedListBoxLibrary/SmartCheckedListBox.cs rename to CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.cs diff --git a/CheckedListBoxLibrary/SmartCheckedListBox.resx b/CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.resx similarity index 100% rename from CheckedListBoxLibrary/SmartCheckedListBox.resx rename to CheckedListBoxLibrary/VisualComponents/SmartCheckedListBox.resx diff --git a/CheckedListBoxLibrary/SmartTextBox.Designer.cs b/CheckedListBoxLibrary/VisualComponents/SmartTextBox.Designer.cs similarity index 100% rename from CheckedListBoxLibrary/SmartTextBox.Designer.cs rename to CheckedListBoxLibrary/VisualComponents/SmartTextBox.Designer.cs diff --git a/CheckedListBoxLibrary/SmartTextBox.cs b/CheckedListBoxLibrary/VisualComponents/SmartTextBox.cs similarity index 100% rename from CheckedListBoxLibrary/SmartTextBox.cs rename to CheckedListBoxLibrary/VisualComponents/SmartTextBox.cs diff --git a/CheckedListBoxLibrary/SmartTextBox.resx b/CheckedListBoxLibrary/VisualComponents/SmartTextBox.resx similarity index 100% rename from CheckedListBoxLibrary/SmartTextBox.resx rename to CheckedListBoxLibrary/VisualComponents/SmartTextBox.resx diff --git a/CheckedListBoxLibrary/ValueOutOfRangeException.cs b/CheckedListBoxLibrary/VisualComponents/ValueOutOfRangeException.cs similarity index 86% rename from CheckedListBoxLibrary/ValueOutOfRangeException.cs rename to CheckedListBoxLibrary/VisualComponents/ValueOutOfRangeException.cs index c40b9ab..ad41c4e 100644 --- a/CheckedListBoxLibrary/ValueOutOfRangeException.cs +++ b/CheckedListBoxLibrary/VisualComponents/ValueOutOfRangeException.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace MyUserControls +namespace MyUserControls.VisualComponents { public class ValueOutOfRangeException : Exception { diff --git a/CheckedListBoxLibrary/testComponent.cs b/CheckedListBoxLibrary/testComponent.cs deleted file mode 100644 index b3965bc..0000000 --- a/CheckedListBoxLibrary/testComponent.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace MyUserControls.Components -{ - public partial class testComponent : Component - { - public testComponent() - { - InitializeComponent(); - _fileName = string.Empty; - } - - public testComponent(IContainer container) - { - container.Add(this); - InitializeComponent(); - _fileName = string.Empty; - } - - private string _fileName; - public string FileName - { - set - { - if (string.IsNullOrEmpty(value)) - { - return; - } - if (!value.EndsWith(".txt")) - { - throw new ArgumentException("No txt file"); - } - _fileName = value; - } - } - public bool SaveToFile(string[] texts) - { - CheckFileExsists(); - using var writer = new StreamWriter(_fileName, true); - foreach (var text in texts) - { - writer.WriteLine(text); - } - writer.Flush(); - return true; - } - private void CheckFileExsists() - { - if (string.IsNullOrEmpty(_fileName)) - { - throw new ArgumentNullException(_fileName); - } - if (!File.Exists(_fileName)) - { - throw new FileNotFoundException(_fileName); - } - } - } -}