commit 2405c7be22c0778a84eeb5ff1a4919c0d35d3b68 Author: Eugen Höglinger Date: Wed May 29 13:31:21 2024 +0200 Initialized diff --git a/.vs/TabControlWithDataGridViews.git/v17/.suo b/.vs/TabControlWithDataGridViews.git/v17/.suo new file mode 100644 index 0000000..2a019f1 Binary files /dev/null and b/.vs/TabControlWithDataGridViews.git/v17/.suo differ diff --git a/.vs/TabControlWithDataGridViews.git/v17/DocumentLayout.json b/.vs/TabControlWithDataGridViews.git/v17/DocumentLayout.json new file mode 100644 index 0000000..b05090c --- /dev/null +++ b/.vs/TabControlWithDataGridViews.git/v17/DocumentLayout.json @@ -0,0 +1,48 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|c:\\cad\\git-workrepository\\visualstudio\\_user control\\tabcontrolswithdatagridviews.git\\tabcontrolswithdatagridviews\\usercontrol1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", + "RelativeMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|solutionrelative:tabcontrolswithdatagridviews\\usercontrol1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 1, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedHeight": 200, + "SelectedChildIndex": 3, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "UserControl1.cs [Entwurf]", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\UserControl1.cs", + "RelativeDocumentMoniker": "TabControlsWithDataGridViews\\UserControl1.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\UserControl1.cs [Entwurf]", + "RelativeToolTip": "TabControlsWithDataGridViews\\UserControl1.cs [Entwurf]", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-03T08:54:50.218Z", + "EditorCaption": " [Entwurf]" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/.vs/TabControlsWithDataGridViews.git/FileContentIndex/81f8a4cc-443d-4b39-b6c8-2943f970f140.vsidx b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/81f8a4cc-443d-4b39-b6c8-2943f970f140.vsidx new file mode 100644 index 0000000..7252987 Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/81f8a4cc-443d-4b39-b6c8-2943f970f140.vsidx differ diff --git a/.vs/TabControlsWithDataGridViews.git/FileContentIndex/9aa516d0-7e2b-4bc3-91cc-2c36f11825d9.vsidx b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/9aa516d0-7e2b-4bc3-91cc-2c36f11825d9.vsidx new file mode 100644 index 0000000..4a1b847 Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/9aa516d0-7e2b-4bc3-91cc-2c36f11825d9.vsidx differ diff --git a/.vs/TabControlsWithDataGridViews.git/FileContentIndex/a642fc4b-0ce0-4fa3-84e3-433422cd3e80.vsidx b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/a642fc4b-0ce0-4fa3-84e3-433422cd3e80.vsidx new file mode 100644 index 0000000..9e10c10 Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/a642fc4b-0ce0-4fa3-84e3-433422cd3e80.vsidx differ diff --git a/.vs/TabControlsWithDataGridViews.git/FileContentIndex/c1c84aab-0aea-4a9e-8c2e-4e6af279354a.vsidx b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/c1c84aab-0aea-4a9e-8c2e-4e6af279354a.vsidx new file mode 100644 index 0000000..44545ea Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/c1c84aab-0aea-4a9e-8c2e-4e6af279354a.vsidx differ diff --git a/.vs/TabControlsWithDataGridViews.git/FileContentIndex/f65e7e4a-afc7-4dec-a79c-c64879c7f921.vsidx b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/f65e7e4a-afc7-4dec-a79c-c64879c7f921.vsidx new file mode 100644 index 0000000..ae94a5c Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/FileContentIndex/f65e7e4a-afc7-4dec-a79c-c64879c7f921.vsidx differ diff --git a/.vs/TabControlsWithDataGridViews.git/v17/.suo b/.vs/TabControlsWithDataGridViews.git/v17/.suo new file mode 100644 index 0000000..3e12e04 Binary files /dev/null and b/.vs/TabControlsWithDataGridViews.git/v17/.suo differ diff --git a/.vs/TabControlsWithDataGridViews.git/v17/DocumentLayout.json b/.vs/TabControlsWithDataGridViews.git/v17/DocumentLayout.json new file mode 100644 index 0000000..3c93dc1 --- /dev/null +++ b/.vs/TabControlsWithDataGridViews.git/v17/DocumentLayout.json @@ -0,0 +1,119 @@ +{ + "Version": 1, + "WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\tabcontrolswithdatagridviews\\tabcontrolswithdatagridviews.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|solutionrelative:tabcontrolswithdatagridviews\\tabcontrolswithdatagridviews.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\tabcontrolswithdatagridviews\\tabcontrolswithdatagridviews.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", + "RelativeMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|solutionrelative:tabcontrolswithdatagridviews\\tabcontrolswithdatagridviews.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" + }, + { + "AbsoluteMoniker": "D:0:0:{47DB0405-1331-455C-ACAE-A2C2FF02B162}|HE-Test_Dll\\HE-Test_Dll.csproj|c:\\cad\\git-workrepository\\visualstudio\\_user control\\tabcontrolswithdatagridviews.git\\he-test_dll\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form", + "RelativeMoniker": "D:0:0:{47DB0405-1331-455C-ACAE-A2C2FF02B162}|HE-Test_Dll\\HE-Test_Dll.csproj|solutionrelative:he-test_dll\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form" + }, + { + "AbsoluteMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\tabcontrolswithdatagridviews\\tabcontrolwithdatagridview.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}|TabControlsWithDataGridViews\\TabControlsWithDataGridViews.csproj|solutionrelative:tabcontrolswithdatagridviews\\tabcontrolwithdatagridview.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{47DB0405-1331-455C-ACAE-A2C2FF02B162}|HE-Test_Dll\\HE-Test_Dll.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\he-test_dll\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{47DB0405-1331-455C-ACAE-A2C2FF02B162}|HE-Test_Dll\\HE-Test_Dll.csproj|solutionrelative:he-test_dll\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 1, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedHeight": 200, + "SelectedChildIndex": 6, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{e506b91c-c606-466a-90a9-123d1d1e12b3}" + }, + { + "$type": "Bookmark", + "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" + }, + { + "$type": "Document", + "DocumentIndex": 4, + "Title": "Form1.cs", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\Form1.cs", + "RelativeDocumentMoniker": "HE-Test_Dll\\Form1.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\Form1.cs", + "RelativeToolTip": "HE-Test_Dll\\Form1.cs", + "ViewState": "AQIAAAYAAAAAAAAAAAAAAGgAAABcAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-06T10:49:04.025Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Form1.cs [Entwurf]", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\Form1.cs", + "RelativeDocumentMoniker": "HE-Test_Dll\\Form1.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\Form1.cs [Entwurf]", + "RelativeToolTip": "HE-Test_Dll\\Form1.cs [Entwurf]", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-06T10:09:33.322Z", + "EditorCaption": " [Entwurf]" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "TabControlsWithDataGridViews.cs", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "RelativeDocumentMoniker": "TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "RelativeToolTip": "TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "ViewState": "AQIAAG0AAAAAAAAAAAAowIkAAABeAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-03T09:00:19.318Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "TabControlsWithDataGridViews.cs [Entwurf]", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "RelativeDocumentMoniker": "TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs [Entwurf]", + "RelativeToolTip": "TabControlsWithDataGridViews\\TabControlsWithDataGridViews.cs [Entwurf]", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-03T09:00:14.305Z", + "EditorCaption": " [Entwurf]" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "TabControlWithDataGridView.cs", + "DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlWithDataGridView.cs", + "RelativeDocumentMoniker": "TabControlsWithDataGridViews\\TabControlWithDataGridView.cs", + "ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\TabControlWithDataGridView.cs", + "RelativeToolTip": "TabControlsWithDataGridViews\\TabControlWithDataGridView.cs", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAK8BAABUAAAA", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2024-05-06T11:52:35.939Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Daten/CDs - Kopie/CD 1/01 Song 1_1.txt b/Daten/CDs - Kopie/CD 1/01 Song 1_1.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 2/01 Song 1_2.txt b/Daten/CDs - Kopie/CD 2/01 Song 1_2.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 3/01 Song 1_3.txt b/Daten/CDs - Kopie/CD 3/01 Song 1_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 3/02 Song 2_3.txt b/Daten/CDs - Kopie/CD 3/02 Song 2_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 3/03 Song 3_3.txt b/Daten/CDs - Kopie/CD 3/03 Song 3_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 3/04 Song 4_3.txt b/Daten/CDs - Kopie/CD 3/04 Song 4_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs - Kopie/CD 4/01 Song 1_4.txt b/Daten/CDs - Kopie/CD 4/01 Song 1_4.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 1/01 Song 1_1.txt b/Daten/CDs/CD 1/01 Song 1_1.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 2/01 Song 1_2.txt b/Daten/CDs/CD 2/01 Song 1_2.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 3/01 Song 1_3.txt b/Daten/CDs/CD 3/01 Song 1_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 3/02 Song 2_3.txt b/Daten/CDs/CD 3/02 Song 2_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 3/03 Song 3_3.txt b/Daten/CDs/CD 3/03 Song 3_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 3/04 Song 4_3.txt b/Daten/CDs/CD 3/04 Song 4_3.txt new file mode 100644 index 0000000..e69de29 diff --git a/Daten/CDs/CD 4/01 Song 1_4.txt b/Daten/CDs/CD 4/01 Song 1_4.txt new file mode 100644 index 0000000..e69de29 diff --git a/HE-Test_Dll/.vs/HE-Test_Dll.csproj.dtbcache.json b/HE-Test_Dll/.vs/HE-Test_Dll.csproj.dtbcache.json new file mode 100644 index 0000000..b294b37 --- /dev/null +++ b/HE-Test_Dll/.vs/HE-Test_Dll.csproj.dtbcache.json @@ -0,0 +1 @@ +{"RootPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll","ProjectFileName":"HE-Test_Dll.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Form1.cs"},{"SourceFile":"Form1.Designer.cs"},{"SourceFile":"Program.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Deployment.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\bin\\Debug\\HE-Test_Dll.exe","OutputItemRelativePath":"HE-Test_Dll.exe"},{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\HE-Test_Dll\\bin\\Debug\\HE-Test_Dll.pdb","OutputItemRelativePath":"HE-Test_Dll.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file diff --git a/HE-Test_Dll/App.config b/HE-Test_Dll/App.config new file mode 100644 index 0000000..ecdcf8a --- /dev/null +++ b/HE-Test_Dll/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/HE-Test_Dll/Form1.Designer.cs b/HE-Test_Dll/Form1.Designer.cs new file mode 100644 index 0000000..552c85a --- /dev/null +++ b/HE-Test_Dll/Form1.Designer.cs @@ -0,0 +1,116 @@ +namespace HE_Test_Dll +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.groupBoxProgramInfo = new System.Windows.Forms.GroupBox(); + this.labelProgramInfo = new System.Windows.Forms.Label(); + this.groupBoxDLLInfo = new System.Windows.Forms.GroupBox(); + this.labelDLLInfo = new System.Windows.Forms.Label(); + this.tabControlsWithDataGridViews = new Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews(); + this.groupBoxProgramInfo.SuspendLayout(); + this.groupBoxDLLInfo.SuspendLayout(); + this.SuspendLayout(); + // + // groupBoxProgramInfo + // + this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo); + this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 472); + this.groupBoxProgramInfo.Name = "groupBoxProgramInfo"; + this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66); + this.groupBoxProgramInfo.TabIndex = 11; + this.groupBoxProgramInfo.TabStop = false; + this.groupBoxProgramInfo.Text = "Programm Information"; + // + // labelProgramInfo + // + this.labelProgramInfo.AutoSize = true; + this.labelProgramInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.labelProgramInfo.Location = new System.Drawing.Point(7, 20); + this.labelProgramInfo.Name = "labelProgramInfo"; + this.labelProgramInfo.Size = new System.Drawing.Size(16, 13); + this.labelProgramInfo.TabIndex = 0; + this.labelProgramInfo.Text = "..."; + // + // groupBoxDLLInfo + // + this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo); + this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 472); + this.groupBoxDLLInfo.Name = "groupBoxDLLInfo"; + this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66); + this.groupBoxDLLInfo.TabIndex = 12; + this.groupBoxDLLInfo.TabStop = false; + this.groupBoxDLLInfo.Text = "DLL Information"; + // + // labelDLLInfo + // + this.labelDLLInfo.AutoSize = true; + this.labelDLLInfo.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.labelDLLInfo.Location = new System.Drawing.Point(7, 20); + this.labelDLLInfo.Name = "labelDLLInfo"; + this.labelDLLInfo.Size = new System.Drawing.Size(16, 13); + this.labelDLLInfo.TabIndex = 0; + this.labelDLLInfo.Text = "..."; + // + // tabControlsWithDataGridViews + // + this.tabControlsWithDataGridViews.Location = new System.Drawing.Point(12, 12); + this.tabControlsWithDataGridViews.MinimumSize = new System.Drawing.Size(760, 440); + this.tabControlsWithDataGridViews.Name = "tabControlsWithDataGridViews"; + this.tabControlsWithDataGridViews.Size = new System.Drawing.Size(760, 440); + this.tabControlsWithDataGridViews.TabIndex = 13; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 550); + this.Controls.Add(this.tabControlsWithDataGridViews); + this.Controls.Add(this.groupBoxProgramInfo); + this.Controls.Add(this.groupBoxDLLInfo); + this.Name = "Form1"; + this.Text = "Test_TabControlsWithDataGridViews"; + this.Load += new System.EventHandler(this.Form1_Load); + this.groupBoxProgramInfo.ResumeLayout(false); + this.groupBoxProgramInfo.PerformLayout(); + this.groupBoxDLLInfo.ResumeLayout(false); + this.groupBoxDLLInfo.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + private System.Windows.Forms.GroupBox groupBoxProgramInfo; + private System.Windows.Forms.Label labelProgramInfo; + private System.Windows.Forms.GroupBox groupBoxDLLInfo; + private System.Windows.Forms.Label labelDLLInfo; + private Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews tabControlsWithDataGridViews; + private Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews tabControlsWithDataGridViews1; + } +} + diff --git a/HE-Test_Dll/Form1.cs b/HE-Test_Dll/Form1.cs new file mode 100644 index 0000000..0c7edd0 --- /dev/null +++ b/HE-Test_Dll/Form1.cs @@ -0,0 +1,140 @@ +using Eugen.ESystem.Windows.Forms; +using System; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace HE_Test_Dll +{ + public partial class Form1 : Form + { + #region Version und Copyright + // Version und Copyright + string programName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + string programVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = System.Reflection.Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + //string startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + //return startYear.Remove(0, startYear.LastIndexOf(" ") + 1); + string startYear = ""; + if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © ")) + { + startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", ""); + while (startYear.StartsWith(" ")) + { + startYear = startYear.Remove(0, 1); + } + startYear = startYear.Remove(startYear.IndexOf(" ")); + return startYear; + } + else + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + //return String.Concat(((AssemblyCopyrightAttribute)attributes[0]).Copyright, "-", currentYear); + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear)); + } + } + #endregion + + #region Programm-Info + /// + /// Contains the name of the program file + /// + public static string ProgramName { set; get; } + + /// + /// Contains the version of the program file + /// + public static string ProgramVersion { set; get; } + + /// + /// Contains the copyright notice + /// + public static string Copyright { set; get; } + + private void SetProgramInfo() + { + //Name, Version und Copyright setzen + ProgramName = programName; + ProgramVersion = programVersion; + Copyright = copyright; + } + #endregion + + public Form1() + { + SetProgramInfo(); + InitializeComponent(); + + SetControl(); // Creates the control with the DataGridViews. Must be called here, otherwise the values are set too late. + } + + private void Form1_Load(object sender, EventArgs e) + { + labelProgramInfo.Text = String.Concat(ProgramName, "\r\n", ProgramVersion, "\r\n", Copyright); // Zeigt die Programm-Information an + + labelDLLInfo.Text = String.Concat(TabControlsWithDataGridViews.DllName, "\r\n", TabControlsWithDataGridViews.DllVersion, "\r\n", TabControlsWithDataGridViews.Copyright); // Zeigt die DLL-Information an + } + + private void SetControl() + { + TabControlsWithDataGridViews.TabTitle = "CD "; // Sets the titles of the DataGridView + TabControlsWithDataGridViews.Column1Title = "Number"; // Set the title of the first column + TabControlsWithDataGridViews.Column2Title = "Title"; // Set the title of the second column + TabControlsWithDataGridViews.MoveToButtonTitle = "Move To CD "; // Sets the titles of the Move To buttons + + // Sets the root directory in which the data are located + TabControlsWithDataGridViews.DataPath = "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\Daten\\CDs"; + + TabControlsWithDataGridViews.Extension = ".txt"; // Sets the extension of the used files + } + + private void buttonShowInfo_Click(object sender, EventArgs e) + { + // + // Diese Zeilen gehört in das Programm kopiert + // + // Aufruf des Informationsfensters + var info = new TabControlsWithDataGridViews(); + info.Show(); + // + // + } + } +} diff --git a/HE-Test_Dll/Form1.resx b/HE-Test_Dll/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HE-Test_Dll/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HE-Test_Dll/HE-Test_Dll.csproj b/HE-Test_Dll/HE-Test_Dll.csproj new file mode 100644 index 0000000..60d8a47 --- /dev/null +++ b/HE-Test_Dll/HE-Test_Dll.csproj @@ -0,0 +1,92 @@ + + + + + Debug + AnyCPU + {47DB0405-1331-455C-ACAE-A2C2FF02B162} + WinExe + HE_Test_Dll + HE-Test_Dll + v4.7.2 + 512 + true + false + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\ControlPanelControl.git\ControlPanelControl\bin\Debug\heconpan.dll + + + False + ..\TabControlsWithDataGridViews\bin\Debug\hetcwdgv.dll + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/HE-Test_Dll/Program.cs b/HE-Test_Dll/Program.cs new file mode 100644 index 0000000..8da5eee --- /dev/null +++ b/HE-Test_Dll/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace HE_Test_Dll +{ + internal static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/HE-Test_Dll/Properties/AssemblyInfo.cs b/HE-Test_Dll/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..eb6deb5 --- /dev/null +++ b/HE-Test_Dll/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("HE_Test_Dll")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HE_Test_Dll")] +[assembly: AssemblyCopyright("Copyright © 2022 by Eugen Höglinger")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("47db0405-1331-455c-acae-a2c2ff02b162")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.*")] +//[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HE-Test_Dll/Properties/Resources.Designer.cs b/HE-Test_Dll/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d12015c --- /dev/null +++ b/HE-Test_Dll/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +using System; + +namespace Properties +{ + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/HE-Test_Dll/Properties/Resources.resx b/HE-Test_Dll/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/HE-Test_Dll/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/HE-Test_Dll/Properties/Settings.Designer.cs b/HE-Test_Dll/Properties/Settings.Designer.cs new file mode 100644 index 0000000..7a134d5 --- /dev/null +++ b/HE-Test_Dll/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/HE-Test_Dll/Properties/Settings.settings b/HE-Test_Dll/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/HE-Test_Dll/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe b/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe new file mode 100644 index 0000000..5773414 Binary files /dev/null and b/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe differ diff --git a/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe.config b/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe.config new file mode 100644 index 0000000..ecdcf8a --- /dev/null +++ b/HE-Test_Dll/bin/Debug/HE-Test_Dll.exe.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/HE-Test_Dll/bin/Debug/HE-Test_Dll.pdb b/HE-Test_Dll/bin/Debug/HE-Test_Dll.pdb new file mode 100644 index 0000000..3a1bb3d Binary files /dev/null and b/HE-Test_Dll/bin/Debug/HE-Test_Dll.pdb differ diff --git a/HE-Test_Dll/bin/Debug/de/heconpan.resources.dll b/HE-Test_Dll/bin/Debug/de/heconpan.resources.dll new file mode 100644 index 0000000..45ec766 Binary files /dev/null and b/HE-Test_Dll/bin/Debug/de/heconpan.resources.dll differ diff --git a/HE-Test_Dll/bin/Debug/en/heconpan.resources.dll b/HE-Test_Dll/bin/Debug/en/heconpan.resources.dll new file mode 100644 index 0000000..85c50d2 Binary files /dev/null and b/HE-Test_Dll/bin/Debug/en/heconpan.resources.dll differ diff --git a/HE-Test_Dll/bin/Debug/heconpan.dll b/HE-Test_Dll/bin/Debug/heconpan.dll new file mode 100644 index 0000000..05ac46f Binary files /dev/null and b/HE-Test_Dll/bin/Debug/heconpan.dll differ diff --git a/HE-Test_Dll/bin/Debug/heconpan.pdb b/HE-Test_Dll/bin/Debug/heconpan.pdb new file mode 100644 index 0000000..7241730 Binary files /dev/null and b/HE-Test_Dll/bin/Debug/heconpan.pdb differ diff --git a/HE-Test_Dll/bin/Debug/hetcwdgv.dll b/HE-Test_Dll/bin/Debug/hetcwdgv.dll new file mode 100644 index 0000000..7c7963c Binary files /dev/null and b/HE-Test_Dll/bin/Debug/hetcwdgv.dll differ diff --git a/HE-Test_Dll/bin/Debug/hetcwdgv.pdb b/HE-Test_Dll/bin/Debug/hetcwdgv.pdb new file mode 100644 index 0000000..6601e5d Binary files /dev/null and b/HE-Test_Dll/bin/Debug/hetcwdgv.pdb differ diff --git a/HE-Test_Dll/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/HE-Test_Dll/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/HE-Test_Dll/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..c06c4c0 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..d83be49 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/HE-Test_Dll/obj/Debug/HE-Test_.1DB734D7.Up2Date b/HE-Test_Dll/obj/Debug/HE-Test_.1DB734D7.Up2Date new file mode 100644 index 0000000..e69de29 diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.AssemblyReference.cache b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.AssemblyReference.cache new file mode 100644 index 0000000..a0219b4 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.AssemblyReference.cache differ diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.CoreCompileInputs.cache b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..6d85d68 --- /dev/null +++ b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4fdad2e37df2d42e4acec494a733142a746bd680feed415b59a167b506ff7127 diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.FileListAbsolute.txt b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..d5d76cc --- /dev/null +++ b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.FileListAbsolute.txt @@ -0,0 +1,17 @@ +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\HE-Test_Dll.exe.config +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\HE-Test_Dll.exe +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\HE-Test_Dll.pdb +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\hetcwdgv.pdb +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_Dll.csproj.AssemblyReference.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE_Test_Dll.Form1.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE_Test_Dll.Properties.Resources.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_Dll.csproj.GenerateResource.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_Dll.csproj.CoreCompileInputs.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_.1DB734D7.Up2Date +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_Dll.exe +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\obj\Debug\HE-Test_Dll.pdb +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\hetcwdgv.dll +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\heconpan.dll +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\heconpan.pdb +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\de\heconpan.resources.dll +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\HE-Test_Dll\bin\Debug\en\heconpan.resources.dll diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.GenerateResource.cache b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.GenerateResource.cache new file mode 100644 index 0000000..1a19451 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE-Test_Dll.csproj.GenerateResource.cache differ diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.exe b/HE-Test_Dll/obj/Debug/HE-Test_Dll.exe new file mode 100644 index 0000000..5773414 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE-Test_Dll.exe differ diff --git a/HE-Test_Dll/obj/Debug/HE-Test_Dll.pdb b/HE-Test_Dll/obj/Debug/HE-Test_Dll.pdb new file mode 100644 index 0000000..3a1bb3d Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE-Test_Dll.pdb differ diff --git a/HE-Test_Dll/obj/Debug/HE_Test_Dll.Form1.resources b/HE-Test_Dll/obj/Debug/HE_Test_Dll.Form1.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE_Test_Dll.Form1.resources differ diff --git a/HE-Test_Dll/obj/Debug/HE_Test_Dll.Properties.Resources.resources b/HE-Test_Dll/obj/Debug/HE_Test_Dll.Properties.Resources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/HE-Test_Dll/obj/Debug/HE_Test_Dll.Properties.Resources.resources differ diff --git a/HE-Test_Dll/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll b/HE-Test_Dll/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll new file mode 100644 index 0000000..1bb5b5c Binary files /dev/null and b/HE-Test_Dll/obj/Debug/TempPE/Properties.Resources.Designer.cs.dll differ diff --git a/HEAD b/HEAD new file mode 100644 index 0000000..cb089cd --- /dev/null +++ b/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/TabControlsWithDataGridViews.git.sln b/TabControlsWithDataGridViews.git.sln new file mode 100644 index 0000000..02769ee --- /dev/null +++ b/TabControlsWithDataGridViews.git.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.9.34728.123 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TabControlsWithDataGridViews", "TabControlsWithDataGridViews\TabControlsWithDataGridViews.csproj", "{A4B2147B-532C-474C-BFBA-D4AB7E6E820E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HE-Test_Dll", "HE-Test_Dll\HE-Test_Dll.csproj", "{47DB0405-1331-455C-ACAE-A2C2FF02B162}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A4B2147B-532C-474C-BFBA-D4AB7E6E820E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4B2147B-532C-474C-BFBA-D4AB7E6E820E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4B2147B-532C-474C-BFBA-D4AB7E6E820E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4B2147B-532C-474C-BFBA-D4AB7E6E820E}.Release|Any CPU.Build.0 = Release|Any CPU + {47DB0405-1331-455C-ACAE-A2C2FF02B162}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47DB0405-1331-455C-ACAE-A2C2FF02B162}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47DB0405-1331-455C-ACAE-A2C2FF02B162}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47DB0405-1331-455C-ACAE-A2C2FF02B162}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {420D3514-448D-4AF0-A7EB-33D5DB8C5459} + EndGlobalSection +EndGlobal diff --git a/TabControlsWithDataGridViews/.vs/TabControlsWithDataGridViews.csproj.dtbcache.json b/TabControlsWithDataGridViews/.vs/TabControlsWithDataGridViews.csproj.dtbcache.json new file mode 100644 index 0000000..2b961d9 --- /dev/null +++ b/TabControlsWithDataGridViews/.vs/TabControlsWithDataGridViews.csproj.dtbcache.json @@ -0,0 +1 @@ +{"RootPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews","ProjectFileName":"TabControlsWithDataGridViews.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Properties\\AppResources.Designer.cs"},{"SourceFile":"Properties\\AppResources_de.Designer.cs"},{"SourceFile":"Properties\\AppResources_en.Designer.cs"},{"SourceFile":"TabControlsWithDataGridViews.cs"},{"SourceFile":"TabControlsWithDataGridViews.Designer.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.7.2.AssemblyAttributes.cs"}],"References":[{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.7.2\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\bin\\Debug\\hetcwdgv.dll","OutputItemRelativePath":"hetcwdgv.dll"},{"OutputItemFullPath":"C:\\CAD\\Git-WorkRepository\\VisualStudio\\_USER CONTROL\\TabControlsWithDataGridViews.git\\TabControlsWithDataGridViews\\bin\\Debug\\hetcwdgv.pdb","OutputItemRelativePath":"hetcwdgv.pdb"}],"CopyToOutputEntries":[]} \ No newline at end of file diff --git a/TabControlsWithDataGridViews/Move.cs b/TabControlsWithDataGridViews/Move.cs new file mode 100644 index 0000000..51123e1 --- /dev/null +++ b/TabControlsWithDataGridViews/Move.cs @@ -0,0 +1,193 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using static System.Net.WebRequestMethods; + +namespace Eugen.ESystem.Windows.Forms +{ + internal class Move + { + /// + /// Set the Data directory path + /// + public string DataPath { private get; set; } // Data directory + + /// + /// The file extension you are looking for, e.g. .mp3 + /// + public string Extension { set; get; } + + /// + /// Set the used dataGridView Control + /// + public DataGridView UsedDataGridView { private get; set; } // The used dataGridView Control + + /// + /// Set the number of the selected dataGridView + /// + public int SelectedDataGridViewIndex { private get; set; } // Number of the selected dataGridView + + /// + /// Get the number of the row selected in the DataGridView + /// + public int SelectedRow { get; private set; } // The number of the row selected in the DataGridView + + /// + /// Set or get the title of 'TabPage' + /// + public string TabTitle { set; get; } // Title of the TabPage + + /// + /// Set or get the current 'TabControl' + /// + public TabControl DynamicTabControl { set; get; } // Current tabControl + + /// + /// Set or get the current tab name + /// + public string CurrentTabName { get; set; } // Name of the current tabPagel + + /// + /// Gets whether the display needs to be updated or not + /// + public bool UpdateDisplay { get; private set; } // Specifies whether the display is updated or not + + public void ToTab(int number) + { + List folders = new List(); + string currentFolder = ""; + string destinationFolder = ""; + string currentFile = ""; + string destinationFile = ""; + string tempFile = ""; + string rowSelectedValue = ""; + string fileSelected = ""; + int selectedFileIndex = 0; + + UpdateDisplay = false; + + // Determine selected row + if (UsedDataGridView.SelectedRows.Count > 0) + { + SelectedRow = UsedDataGridView.SelectedRows[0].Index; + } + + if (DynamicTabControl.SelectedIndex != number) + { + folders = GetFolders(DataPath); + + for (int i = 0; i < folders.Count; i++) + { + if (i == number) + { + currentFolder = folders[DynamicTabControl.SelectedIndex]; + destinationFolder = folders[number]; + break; + } + } + + rowSelectedValue = UsedDataGridView.Rows[SelectedRow].Cells[1].Value.ToString(); // Value of the selected row + + foreach (string file in Directory.GetFiles(currentFolder)) + { + if (Path.GetFileNameWithoutExtension(file) == rowSelectedValue) + { + fileSelected = file; + selectedFileIndex = Convert.ToInt32(Path.GetFileName(fileSelected).Remove(Path.GetFileName(fileSelected).IndexOf(" "))); + currentFile = Path.GetFileName(file); + tempFile = "00" + currentFile.Remove(0, currentFile.IndexOf(" ")); + } + } + + // If the file name begins with the line number, rename the line number in the file name to '00' and move the file it the destination folder + System.IO.File.Move(fileSelected, destinationFolder + "\\" + tempFile); + + // If the selected file was not the last one, then rename/renumber the files that come after it + IsSelFileNotTheLastRenameIt(currentFolder, fileSelected, selectedFileIndex); + + // Only include files with the correct extension in the list to determine the number of files + destinationFile = GetDestinationFileList(destinationFolder, tempFile); + + System.IO.File.Move(destinationFolder + "\\" + tempFile, destinationFolder + "\\" + destinationFile); + + UpdateDisplay = true; + } + } + + #region Private Methodes + private List GetFolders(string dataPath) + { + List folders = Directory.GetDirectories(dataPath).ToList(); + + for (int i = 0; i < folders.Count; i++) + { + if (!folders[i].Remove(0, folders[i].LastIndexOf("\\") + 1).StartsWith(TabTitle)) + { + folders.Remove(folders[i]); + } + } + + return folders; + } + + private void IsSelFileNotTheLastRenameIt(string currentFolder, string fileSelected, int selectedFileIndex) + { + List files = new List(); + + foreach (string file in Directory.GetFiles(currentFolder)) + { + if (Path.GetExtension(file) == Extension) + { + files.Add(file); + } + } + + if (files.Count + 1 > Convert.ToInt32(Path.GetFileName(fileSelected).Remove(Path.GetFileName(fileSelected).IndexOf(" ")))) + { + // Rename the files that come after the selected file + string fileName = ""; + + for (int i = selectedFileIndex - 1; i < files.Count; i++) + { + fileName = Path.GetFileName(files[i]); + + if (i < 10) + { + System.IO.File.Move(currentFolder + "\\" + fileName, currentFolder + "\\0" + (i + 1).ToString() + fileName.Remove(0, fileName.IndexOf(" "))); + } + else + { + System.IO.File.Move(currentFolder + "\\" + fileName, currentFolder + "\\" + (i + 1).ToString() + fileName.Remove(0, fileName.IndexOf(" "))); + } + } + } + } + + private string GetDestinationFileList(string destinationFolder, string tempFile) + { + List files = new List(); + + foreach (string file in Directory.GetFiles(destinationFolder)) + { + if (Path.GetExtension(file) == Extension) + { + files.Add(file); + } + } + + if (files.Count < 10) + { + return "0" + files.Count + tempFile.Remove(0, tempFile.IndexOf(" ")); + } + else + { + return files.Count + tempFile.Remove(0, tempFile.IndexOf(" ")); + } + } + #endregion + } +} diff --git a/TabControlsWithDataGridViews/MoveRow.cs b/TabControlsWithDataGridViews/MoveRow.cs new file mode 100644 index 0000000..893f9e9 --- /dev/null +++ b/TabControlsWithDataGridViews/MoveRow.cs @@ -0,0 +1,192 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Eugen.ESystem.Windows.Forms +{ + internal class MoveRow + { + /// + /// Set the Data directory path + /// + public string DataPath { private get; set; } // Data directory + + /// + /// Set the used dataGridView Control + /// + public DataGridView UsedDataGridView { private get; set; } // The used dataGridView Control + + /// + /// Set the number of the selected dataGridView + /// + public int SelectedDataGridViewIndex { private get; set; } // Number of the selected dataGridView + + /// + /// Get the number of the row selected in the DataGridView + /// + public int SelectedRow { get; private set; } // The number of the row selected in the DataGridView + + /// + /// Gets whether the display needs to be updated or not + /// + public bool UpdateDisplay { get; private set; } // Specifies whether the display is updated or not + + /// + /// Moves the selected row up one row + /// + public void Up() + { + UpdateDisplay = false; + + // Determine selected row + if (UsedDataGridView.SelectedRows.Count > 0) + { + SelectedRow = UsedDataGridView.SelectedRows[0].Index; + } + + // If the selected row is not the first row, then move it up + if (SelectedRow > 0) + { + string rowSelected = UsedDataGridView.Rows[SelectedRow].Cells[1].Value.ToString(); // Value of the selected row + string rowAboutIt = UsedDataGridView.Rows[SelectedRow - 1].Cells[1].Value.ToString(); // Value about of the selected row + + string folderSelected = ""; + string fileSelected = ""; + string fileAboutIt = ""; + + foreach (string folder in Directory.GetDirectories(DataPath)) + { + if (folder.EndsWith((SelectedDataGridViewIndex + 1).ToString())) + { + folderSelected = folder; + } + } + + if (!String.IsNullOrEmpty(folderSelected)) + { + foreach (string file in Directory.GetFiles(folderSelected)) + { + if (Path.GetFileNameWithoutExtension(file) == rowSelected) + { + fileSelected = file; + } + + if (Path.GetFileNameWithoutExtension(file) == rowAboutIt) + { + fileAboutIt = file; + } + } + + // If the file name begins with the line number, rename the line number in the file name to '00' + File.Move(fileSelected, fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + + if (SelectedRow + 1 < 10) + { + File.Move(fileAboutIt, fileAboutIt.Remove(fileAboutIt.LastIndexOf("\\") + 1) + "0" + (SelectedRow + 1).ToString() + Path.GetFileName(fileAboutIt).Remove(0, Path.GetFileName(fileAboutIt).IndexOf(" "))); + } + else + { + File.Move(fileAboutIt, fileAboutIt.Remove(fileAboutIt.LastIndexOf("\\") + 1) + (SelectedRow + 1).ToString() + Path.GetFileName(fileAboutIt).Remove(0, Path.GetFileName(fileAboutIt).IndexOf(" "))); + } + + if (SelectedRow < 10) + { + File.Move(fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" ")), fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "0" + SelectedRow.ToString() + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + } + else + { + File.Move(fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" ")), fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + SelectedRow.ToString() + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + } + + UpdateDisplay = true; + } + } + } + + /// + /// Moves the selected row down one row + /// + public void Down() + { + UpdateDisplay = false; + + // Determine selected row + if (UsedDataGridView.SelectedRows.Count > 0) + { + SelectedRow = UsedDataGridView.SelectedRows[0].Index; + } + + // If the selected row is not the last row, then move it down + int usedRows = 0; + + for (int i = 0; i < UsedDataGridView.Rows.Count; i++) + { + if (UsedDataGridView.Rows[i].Cells[0].Value == null) + { + usedRows = i; + break; + } + } + + if (SelectedRow < usedRows - 1) + { + string rowSelected = UsedDataGridView.Rows[SelectedRow].Cells[1].Value.ToString(); // Value of the selected row + string rowBelow = UsedDataGridView.Rows[SelectedRow + 1].Cells[1].Value.ToString(); // Value about of the selected row + + string folderSelected = ""; + string fileSelected = ""; + string fileBelow = ""; + + foreach (string folder in Directory.GetDirectories(DataPath)) + { + if (folder.EndsWith((SelectedDataGridViewIndex + 1).ToString())) + { + folderSelected = folder; + } + } + + if (!String.IsNullOrEmpty(folderSelected)) + { + foreach (string file in Directory.GetFiles(folderSelected)) + { + if (Path.GetFileNameWithoutExtension(file) == rowSelected) + { + fileSelected = file; + } + + if (Path.GetFileNameWithoutExtension(file) == rowBelow) + { + fileBelow = file; + } + } + + File.Move(fileSelected, fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + + if (SelectedRow - 1 < 10) + { + File.Move(fileBelow, fileBelow.Remove(fileBelow.LastIndexOf("\\") + 1) + "0" + (SelectedRow + 1).ToString() + Path.GetFileName(fileBelow).Remove(0, Path.GetFileName(fileBelow).IndexOf(" "))); + } + else + { + File.Move(fileBelow, fileBelow.Remove(fileBelow.LastIndexOf("\\") + 1) + (SelectedRow + 1).ToString() + Path.GetFileName(fileBelow).Remove(0, Path.GetFileName(fileBelow).IndexOf(" "))); + } + + if (SelectedRow < 10) + { + File.Move(fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" ")), fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "0" + (SelectedRow + 2).ToString() + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + } + else + { + File.Move(fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + "00" + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" ")), fileSelected.Remove(fileSelected.LastIndexOf("\\") + 1) + (SelectedRow + 2).ToString() + Path.GetFileName(fileSelected).Remove(0, Path.GetFileName(fileSelected).IndexOf(" "))); + } + + UpdateDisplay = true; + } + } + } + } +} diff --git a/TabControlsWithDataGridViews/MoveTab.cs b/TabControlsWithDataGridViews/MoveTab.cs new file mode 100644 index 0000000..e3f3cd4 --- /dev/null +++ b/TabControlsWithDataGridViews/MoveTab.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Eugen.ESystem.Windows.Forms +{ + internal class MoveTab + { + /// + /// Set the Data directory path + /// + public string DataPath { private get; set; } // Data directory + + /// + /// Set or get the title of 'TabPage' + /// + public string TabTitle { set; get; } // Title of the TabPage + + /// + /// Set or get the current 'TabControl' + /// + public TabControl DynamicTabControl { set; get; } // Current TabControl + + /// + /// Set or get the current tab index + /// + public int CurrentTabIndex { get; set; } // Index of the current tabPage + + /// + /// Set or get the current tab name + /// + public string CurrentTabName { get; set; } // Name of the current tabPagel + + /// + /// Gets whether the display needs to be updated or not + /// + public bool UpdateDisplay { get; private set; } // Specifies whether the display is updated or not + + List folders = new List(); + string currentFolder = ""; + string destinationFolder = ""; + + public void Left() + { + UpdateDisplay = false; + + if (CurrentTabIndex > 0) + { + folders = GetFolders(DataPath); + + for (int i = 0; i < folders.Count; i++) + { + if (i == CurrentTabIndex) + { + currentFolder = folders[i]; + destinationFolder = folders[i - 1]; + break; + } + } + + string tempFolder = currentFolder + "###"; + Directory.Move(destinationFolder, tempFolder); + Directory.Move(currentFolder, destinationFolder); + Directory.Move(tempFolder, currentFolder); + + UpdateDisplay = true; + } + } + + public void Right() + { + UpdateDisplay = false; + + if (CurrentTabIndex < DynamicTabControl.TabCount) + { + folders = GetFolders(DataPath); + + for (int i = 0; i < folders.Count; i++) + { + if (i == CurrentTabIndex) + { + currentFolder = folders[i]; + destinationFolder = folders[i + 1]; + break; + } + } + + string tempFolder = currentFolder + "###"; + Directory.Move(destinationFolder, tempFolder); + Directory.Move(currentFolder, destinationFolder); + Directory.Move(tempFolder, currentFolder); + + UpdateDisplay = true; + } + } + + private List GetFolders(string dataPath) + { + List folders = Directory.GetDirectories(dataPath).ToList(); + + for (int i = 0; i < folders.Count; i++) + { + if (!folders[i].Remove(0, folders[i].LastIndexOf("\\") + 1).StartsWith(TabTitle)) + { + folders.Remove(folders[i]); + } + } + + return folders; + } + } +} diff --git a/TabControlsWithDataGridViews/Properties/AppResources.Designer.cs b/TabControlsWithDataGridViews/Properties/AppResources.Designer.cs new file mode 100644 index 0000000..6fd7537 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Eugen.ESystem.Windows.Forms.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AppResources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AppResources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Eugen.ESystem.Windows.Forms.Properties.AppResources", typeof(AppResources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/TabControlsWithDataGridViews/Properties/AppResources.resx b/TabControlsWithDataGridViews/Properties/AppResources.resx new file mode 100644 index 0000000..4fdb1b6 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TabControlsWithDataGridViews/Properties/AppResources_de.Designer.cs b/TabControlsWithDataGridViews/Properties/AppResources_de.Designer.cs new file mode 100644 index 0000000..83db83b --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources_de.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Eugen.ESystem.Windows.Forms.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AppResources_de { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AppResources_de() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Eugen.ESystem.Windows.Forms.Properties.AppResources_de", typeof(AppResources_de).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/TabControlsWithDataGridViews/Properties/AppResources_de.resx b/TabControlsWithDataGridViews/Properties/AppResources_de.resx new file mode 100644 index 0000000..4fdb1b6 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources_de.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TabControlsWithDataGridViews/Properties/AppResources_en.Designer.cs b/TabControlsWithDataGridViews/Properties/AppResources_en.Designer.cs new file mode 100644 index 0000000..a3ec3e6 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources_en.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Eugen.ESystem.Windows.Forms.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class AppResources_en { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal AppResources_en() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Eugen.ESystem.Windows.Forms.Properties.AppResources_en", typeof(AppResources_en).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/TabControlsWithDataGridViews/Properties/AppResources_en.resx b/TabControlsWithDataGridViews/Properties/AppResources_en.resx new file mode 100644 index 0000000..4fdb1b6 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AppResources_en.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TabControlsWithDataGridViews/Properties/AssemblyInfo.cs b/TabControlsWithDataGridViews/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..22fccd6 --- /dev/null +++ b/TabControlsWithDataGridViews/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("TabControlsWithDataGridViews")] +[assembly: AssemblyDescription("Creates and manages a 'TabControl' with 'TabPages' and 'DataGridViews'")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TabControlWithDataGridViews")] +[assembly: AssemblyCopyright("Copyright © 2024 by Eugen Höglinger")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("a4b2147b-532c-474c-bfba-d4ab7e6e820e")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TabControlsWithDataGridViews/TabControlWithDataGridView.cs b/TabControlsWithDataGridViews/TabControlWithDataGridView.cs new file mode 100644 index 0000000..8906674 --- /dev/null +++ b/TabControlsWithDataGridViews/TabControlWithDataGridView.cs @@ -0,0 +1,620 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Windows.Forms; + +namespace Eugen.ESystem.Windows.Forms +{ + internal class TabControlWithDataGridView + { + /// + /// Set or get the max. number of tabs + /// + public int MaxNoOfTabs { get; set; } + + /// + /// Set or get the Data directory path + /// + public string DataPath { get; set; } // Data directory + + /// + /// The file extension you are looking for, e.g. .mp3 + /// + public string Extension { set; get; } // File extension + + /// + /// Set or get the 'Tab' name + /// + public string TabName { get; set; } // Basic tab name (name without number) + + /// + /// Set or get the current 'TabControl' + /// + public TabControl DynamicTabControl { set; get; } // Current TabControl + + /// + /// Set or get the 'TabControl' width + /// + public int TabControlWidth { set; get; } // The 'TabControl' width + + /// + /// Set or get the 'TabControl' hight + /// + public int TabControlHeight { set; get; } // The 'TabControl' hight + + /// + /// Set or get the 'DataGridView' back color + /// + public Color DataGridViewBackColor { set; get; } // The 'DataGridView' back color + + /// + /// Set or get the 'DataGridView' fore color + /// + public Color DataGridViewForeColor { set; get; } // The 'DataGridView' fore color + + /// + /// Set or get the 'DataGridView' font + /// + public Font DataGridViewFont { set; get; } // The 'DataGridView' font + + /// + /// Set or get the title of 'TabPage' + /// + public string TabTitle { set; get; } + + /// + /// Set or get the Title of Column 1 + /// + public string Column1Title { set; get; } + + /// + /// Set or get the Title of Column 2 + /// + public string Column2Title { set; get; } + + /// + /// Set or get the title of the move to buttons + /// + public string MoveToButtonTitle { set; get; } + + private Control.ControlCollection Controls { get; set; } + private List DataGridViewValues { get; set; } + private List PreviousDataGridViewValues { get; set; } + private List NextDataGridViewValues { get; set; } + private TabPage CurrentTabPage { get; set; } + private int CurrentTabPageIndex { get; set; } + private int SelectedDataGridViewIndex { get; set; } + private int SelectedRow { get; set; } + private List> AllFiles { get; set; } + + int maxNumbersOfTabPages = 12; + + #region Public Methodes + /// + /// Creates a tab for each directory in the root directory + /// + public void CreatesATabForEachDirectory() + { + for (int i = 0; i < Directory.GetDirectories(DataPath).Length - 1; i++) + { + AddTabPageWithDataGridViewAndButton(); // Add an additional 'TabPage' with a 'DataGridView' + } + } + + public void InitialFillingOfTheTables(int setTab) + { + List> fileList = ReadFromDirectory(Extension); // Read files from directory + + // Only file with the defined extension are allowed + foreach (var item in fileList) + { + for (int i = 0; i < item.Count; i++) + { + if (Path.GetExtension(item[i].GetValue(1).ToString()) != Extension) + { + fileList.Remove(item); + } + } + } + + DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the first dataGridView + + for (int i = 0; i < DynamicTabControl.TabCount; i++) + { + DynamicTabControl.SelectedIndex = i; //Set the selected 'TabPage' as current 'TabPage' + dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the current dataGridView + + WriteDataGridView(dataGridView, fileList[i]); + } + + // Actavate the first 'TabPage' + DynamicTabControl.SelectedIndex = setTab; //Set the selected 'TabPage' as current 'TabPage' + dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the current dataGridView + } + + /// + /// Moves the selected row up one row + /// + public void RowMoveUp() + { + DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the first dataGridView + + MoveRow mvr = new MoveRow(); + mvr.DataPath = DataPath; + mvr.UsedDataGridView = dataGridView; + mvr.SelectedDataGridViewIndex = Convert.ToInt32(dataGridView.Name.Replace("dataGridView", "")); + mvr.Up(); + + //The display may only be updated, if a row has been moved + if (mvr.UpdateDisplay) + { + // Read the current files of the root folder into the DataGridViews again + InitialFillingOfTheTables(DynamicTabControl.SelectedIndex); + + dataGridView.Rows[mvr.SelectedRow - 1].Selected = true; // Select the row moved upwards + } + } + + /// + /// Moves the selected row down one row + /// + public void RowMoveDown() + { + DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the first dataGridView + + MoveRow mvr = new MoveRow(); + mvr.DataPath = DataPath; + mvr.UsedDataGridView = dataGridView; + mvr.SelectedDataGridViewIndex = Convert.ToInt32(dataGridView.Name.Replace("dataGridView", "")); + mvr.Down(); + + // The display may only be updated, if a row has been moved + if (mvr.UpdateDisplay) + { + // Read the current files of the root folder into the DataGridViews again + InitialFillingOfTheTables(DynamicTabControl.SelectedIndex); + + dataGridView.Rows[mvr.SelectedRow + 1].Selected = true; // Select the row moved upwards + } + } + + /// + /// Creates a new 'TabControl' and set its properties + /// + /// A form control + public void CreatingTabControl(Control.ControlCollection controls) + { + TabControl dynamicTabControl = new TabControl(); + dynamicTabControl.Name = "DynamicTabControl"; + dynamicTabControl.Width = TabControlWidth - 25; + dynamicTabControl.Height = TabControlHeight; + dynamicTabControl.BackColor = DataGridViewBackColor; + dynamicTabControl.ForeColor = DataGridViewForeColor; + dynamicTabControl.Font = DataGridViewFont; + controls.Add(dynamicTabControl); // Add TabControl to Form + + Controls = controls; // Speichert das Control + + DynamicTabControl = dynamicTabControl; // Speichert das aktuelle TabControl + + AddTabPageWithDataGridViewAndButton(); // Add TabPage with DataGridView to TabControl + } + + /// + /// Add a 'TabPage' with a 'DataGridView' + /// + public void AddTabPageWithDataGridViewAndButton() + { + int numberOfTabs = DynamicTabControl.TabCount; + + if (numberOfTabs < maxNumbersOfTabPages) + { + AddMoveToButton(Controls, numberOfTabs); // Add Button to UserControl + AddTabPage(DynamicTabControl, numberOfTabs); // Add TabPage to TabControl + AddDataGridViewTable(Controls, DynamicTabControl, numberOfTabs); // Add a separate DataGridView for each TabPage + } + } + + /// + /// Removes the last 'TabPage' + /// + public void RemoveTabPageAndButton() + { + // Removes the last 'TabControl' of all + + // There must be at least 2 'TabControl', so that one can be removed + if (DynamicTabControl.TabCount > 1) + { + TabPage tab = DynamicTabControl.TabPages[DynamicTabControl.TabCount - 1]; + + // There must be at least 2 'TabControl', so that one can be removed + if (DynamicTabControl.TabCount > 1) + { + // As long as the 'TabControl' (DataGridView) contains data, it cannot be deleted + if (IsDataGridViewEmpty(tab.Controls.OfType().FirstOrDefault())) + { + DynamicTabControl.TabPages.Remove(tab); // Removes the 'tabPage' + + // Removes the associated button + for (int i = 0; i < Controls.Count; i++) + { + if (Controls[i].Name == "buttonMoveTo" + (DynamicTabControl.TabCount).ToString()) + { + Controls.Remove(Controls[i]); + + // If there is only one tab, hide the first 'MoveTo' button + if (Controls[i - 1].Name == "buttonMoveTo0") + { + Controls[i - 1].Visible = false; + } + else + { + Controls[i - 1].Visible = true; + } + } + } + } + else + { + MessageBox.Show("Löschen nicht möglich!\n\r\n\rTab kann nicht gelöscht werden,\n\rweil die Tabelle noch Daten enthälten!\n\r"); + } + } + } + } + + /// + /// Removes the selectet 'TabPage' + /// + public void RemoveSelectedTabPageAndButton() + { + // Removes the selected 'TabControl' + + // There must be at least 2 'TabControl', so that one can be removed + if (DynamicTabControl.TabCount > 1) + { + // As long as the 'TabControl' (DataGridView) contains data, it cannot be deleted + if (IsDataGridViewEmpty(DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault())) + { + DynamicTabControl.TabPages.Remove(DynamicTabControl.SelectedTab); + + // Removes the associated button + for (int i = 0; i < Controls.Count; i++) + { + if (Controls[i].Name == "buttonMoveTo" + (DynamicTabControl.TabCount).ToString()) + { + Controls.Remove(Controls[i]); + + // If there is only one tab, hide the first 'MoveTo' button + if (Controls[i - 1].Name == "buttonMoveTo0") + { + Controls[i - 1].Visible = false; + } + else + { + Controls[i - 1].Visible = true; + } + } + } + } + else + { + MessageBox.Show("Löschen nicht möglich!\n\r\n\rTab kann nicht gelöscht werden,\n\rweil die Tabelle noch Daten enthälten!\n\r"); + } + + RenameTabs(DynamicTabControl); // Rename all 'TabControl' so that they are numbered consecutively again + } + } + + /// + /// Moves the selected 'TabPage' to the left and renumber/rename the others + /// + public void MoveTabPageToLeft() + { + MoveTab moveTab = new MoveTab(); + moveTab.DataPath = DataPath; + moveTab.TabTitle = TabTitle; + moveTab.CurrentTabIndex = DynamicTabControl.SelectedIndex; + moveTab.CurrentTabName = DynamicTabControl.SelectedTab.Name; + moveTab.Left(); + + //The display may only be updated, if a tabPage has been moved + if (moveTab.UpdateDisplay) + { + // Read the current files of the root folder into the DataGridViews again + InitialFillingOfTheTables(DynamicTabControl.SelectedIndex); + + DynamicTabControl.SelectedIndex = DynamicTabControl.SelectedIndex - 1; + } + } + + /// + /// Moves the selected 'TabPage' to the right and renumber/rename the others + /// + public void MoveTabPageToRight() + { + MoveTab moveTab = new MoveTab(); + moveTab.DataPath = DataPath; + moveTab.DynamicTabControl = DynamicTabControl; + moveTab.TabTitle = TabTitle; + moveTab.CurrentTabIndex = DynamicTabControl.SelectedIndex; + moveTab.CurrentTabName = DynamicTabControl.SelectedTab.Name; + moveTab.Right(); + + //The display may only be updated, if a tabPage has been moved + if (moveTab.UpdateDisplay) + { + // Read the current files of the root folder into the DataGridViews again + InitialFillingOfTheTables(DynamicTabControl.SelectedIndex); + + DynamicTabControl.SelectedIndex = DynamicTabControl.SelectedIndex + 1; + } + } + #endregion + + #region Private Methodes + private List> ReadFromDirectory(string extension) + { + // Read all directories from the root directory + string[] directories = Directory.GetDirectories(DataPath); + + // Creates a list of all files in all directories + List> allFiles = new List>(); + + for (int i = 0; i < directories.Length; i++) + { + string[] filesWithPath = Directory.GetFiles(directories[i]); // Read all files from a directory + + //filesInTable.Clear(); + List filesInTable = new List(); // Creates a list of all files in all directories + + for (int j = 0; j < filesWithPath.Length; j++) + { + string[] files = new string[2]; // Files per row + files[0] = Path.GetFileName(filesWithPath[j]).Remove(Path.GetFileName(filesWithPath[j]).IndexOf(" ")); + files[1] = Path.GetFileName(filesWithPath[j]); + + if (Path.GetExtension(filesWithPath[j]) == Extension) + { + filesInTable.Add(files); + } + } + + allFiles.Add(filesInTable); // Adds all files of a directory to the list + } + + AllFiles = allFiles; + + return allFiles; + } + + private void AddTabPage(TabControl dynamicTabControl, int count) + { + TabPage tabPage = new TabPage(); + + tabPage.Name = "tabPage" + count.ToString(); + + if (String.IsNullOrEmpty(TabTitle)) + { + tabPage.Text = "Tab " + (count + 1).ToString(); + } + else + { + tabPage.Text = TabTitle + (count + 1).ToString(); + } + + dynamicTabControl.TabPages.Add(tabPage); + } + + private void AddDataGridViewTable(Control.ControlCollection Controls, TabControl dynamicTabControl, int number) + { + DataGridView dataGridView = new DataGridView(); + + Controls.Add(dataGridView); + + dataGridView.ColumnCount = 2; + dataGridView.Name = "dataGridView" + number.ToString(); + dataGridView.Columns[0].Name = Column1Title; + dataGridView.Columns[1].Name = Column2Title; + dataGridView.Columns[0].Width = 50; + dataGridView.Columns[1].Width = TabControlWidth - 126; + dataGridView.ScrollBars = ScrollBars.Both; + dataGridView.Dock = DockStyle.Fill; + dataGridView.Rows.Add(); + + dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect; + dataGridView.MultiSelect = false; + + dynamicTabControl.TabPages[number].Controls.Add(dataGridView); + } + + private void AddMoveToButton(Control.ControlCollection Controls, int number) + { + Button moveToButton = new Button(); + + if (number < maxNumbersOfTabPages) + { + moveToButton.Name = "buttonMoveTo" + number.ToString(); + moveToButton.Location = new System.Drawing.Point(TabControlWidth + 80 - 78 - 25, 10 + 58 + (number + 1) * 29 - 29); + moveToButton.Size = new System.Drawing.Size(100, 23); + + if (String.IsNullOrEmpty(MoveToButtonTitle)) + { + moveToButton.Text = "Move to Tab " + (number + 1).ToString(); + } + else + { + moveToButton.Text = MoveToButtonTitle + (number + 1).ToString(); + } + } + + Controls.Add(moveToButton); + + // If there is only one tab, hide the first 'MoveTo' button + int numberFirstButton = 0; + + for (int i = 0; i < Controls.Count; i++) + { + if (Controls[i].Name == "buttonMoveTo0") + { + numberFirstButton = i; + break; + } + } + + if (number == 0) + { + Controls[numberFirstButton].Visible = false; + } + else + { + Controls[numberFirstButton].Visible = true; + } + + // Executed when a 'MoveTo' button is selected + moveToButton.Click += (sender, args) => + { + MoveTo(number); + }; + } + + private void MoveTo(int number) + { + if (number != DynamicTabControl.SelectedIndex) + { + DataGridView dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the first dataGridView + + Move move = new Move(); + move.DataPath = DataPath; + move.Extension = Extension; + move.UsedDataGridView = dataGridView; + move.SelectedDataGridViewIndex = SelectedDataGridViewIndex; + move.TabTitle = TabTitle; + move.DynamicTabControl = DynamicTabControl; + move.ToTab(number); + + //The display may only be updated, if a row has been moved + if (move.UpdateDisplay) + { + // Read the current files of the root folder into the DataGridViews again + InitialFillingOfTheTables(number); + + dataGridView = DynamicTabControl.SelectedTab.Controls.OfType().FirstOrDefault(); // Chang the control to the first dataGridView + + dataGridView.Rows[dataGridView.Rows.Count - 2].Selected = true; // Select the row moved upwards + } + } + } + + private void RenameTabs(TabControl dynamicTabControl) + { + // Rename all 'TabControl' so that they are numbered consecutively again + for (int i = 0; i < dynamicTabControl.TabCount; i++) + { + if (String.IsNullOrEmpty(TabTitle)) + { + dynamicTabControl.TabPages[i].Name = "tabPage" + i.ToString(); + dynamicTabControl.TabPages[i].Text = "Tab " + (i + 1).ToString(); + } + else + { + dynamicTabControl.TabPages[i].Name = "tabPage" + i.ToString(); + dynamicTabControl.TabPages[i].Text = TabTitle + (i + 1).ToString(); + } + } + } + + private bool IsDataGridViewEmpty(DataGridView dataGridView) + { + bool isEmpty = true; + + if (dataGridView.Rows.Count == 0) + { + isEmpty = true; //Wenn es keine Zeilen gibt, dann ist die Tabelle leer + } + else + { + //Wenn es Zeilen gibt ... + for (int i = 0; i < dataGridView.Rows.Count; i++) + { + for (int j = 0; j < dataGridView.Columns.Count; j++) + { + if (dataGridView[j, i].Value != null) + { + isEmpty = false; //... und die Zelle nicht leer ist, dann ist die Tabelle nicht leer + } + } + } + } + + return isEmpty; + } + + private TabControl DeterminePreviousControl(TabControl dynamicTabControl) + { + dynamicTabControl.SelectedIndex = dynamicTabControl.SelectedIndex - 1; + return dynamicTabControl; + } + + private TabControl DetermineNextControl(TabControl dynamicTabControl) + { + dynamicTabControl.SelectedIndex = dynamicTabControl.SelectedIndex + 1; + return dynamicTabControl; + } + + private List DetermineDataGridViewValues(TabControl dynamicTabControl, DataGridView dataGridView) + { + string[] rowValues = new string[2]; + List dataGridViewValues = new List(); + + // Werte der DataGridview einlesen + for (int i = 0; i < dataGridView.Rows.Count - 1; i++) + { + if (dataGridView[0, i].Value == null) + { + rowValues[0] = ""; + } + else + { + rowValues[0] = dataGridView[0, i].Value.ToString(); + } + + if (dataGridView[0, i].Value == null) + { + rowValues[1] = ""; + } + else + { + rowValues[1] = dataGridView[1, i].Value.ToString(); + } + + dataGridViewValues.Add(rowValues); + } + + return dataGridViewValues; + } + + private void WriteDataGridView(DataGridView dataGridView, List dataGridViewValues) + { + dataGridView.Rows.Clear(); // Delete all existing values + + for (int i = 0; i < dataGridViewValues.Count; i++) + { + dataGridView.Rows.Add(); + dataGridView[0, i].Value = dataGridViewValues[i].GetValue(0); + dataGridView[1, i].Value = dataGridViewValues[i].GetValue(1).ToString().Remove(dataGridViewValues[i].GetValue(1).ToString().LastIndexOf(".")); + } + + dataGridView.Refresh(); + } + + private void RenameFolders(string folder1, string folder2) + { + Directory.Move(DataPath + "\\" + folder1, DataPath + "\\" + folder1 + "_temp"); // Rename the 'folder1' to a temporary folder, so the name is free + Directory.Move(DataPath + "\\" + folder2, DataPath + "\\" + folder1); // Rename 'folder2' in 'folder1' + Directory.Move(DataPath + "\\" + folder1 + "_temp", DataPath + "\\" + folder2); // Rename the temporary folder to 'folder2' + } + #endregion + } +} diff --git a/TabControlsWithDataGridViews/TabControlsWithDataGridViews.Designer.cs b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.Designer.cs new file mode 100644 index 0000000..132e36e --- /dev/null +++ b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.Designer.cs @@ -0,0 +1,156 @@ +namespace Eugen.ESystem.Windows.Forms +{ + partial class TabControlsWithDataGridViews + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.buttonAddTab = new System.Windows.Forms.Button(); + this.buttonRemoveTab = new System.Windows.Forms.Button(); + this.buttonRemoveSelectedTab = new System.Windows.Forms.Button(); + this.buttonMoveTabToLeft = new System.Windows.Forms.Button(); + this.buttonMoveTabToRight = new System.Windows.Forms.Button(); + this.panelButton = new System.Windows.Forms.Panel(); + this.buttonMoveUp = new System.Windows.Forms.Button(); + this.buttonMoveDown = new System.Windows.Forms.Button(); + this.panelButton.SuspendLayout(); + this.SuspendLayout(); + // + // buttonAddTab + // + this.buttonAddTab.Location = new System.Drawing.Point(3, 3); + this.buttonAddTab.Name = "buttonAddTab"; + this.buttonAddTab.Size = new System.Drawing.Size(125, 23); + this.buttonAddTab.TabIndex = 0; + this.buttonAddTab.Text = "Add Tab"; + this.buttonAddTab.UseVisualStyleBackColor = true; + this.buttonAddTab.Click += new System.EventHandler(this.buttonAddTab_Click); + // + // buttonRemoveTab + // + this.buttonRemoveTab.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.buttonRemoveTab.Location = new System.Drawing.Point(134, 3); + this.buttonRemoveTab.Name = "buttonRemoveTab"; + this.buttonRemoveTab.Size = new System.Drawing.Size(125, 23); + this.buttonRemoveTab.TabIndex = 1; + this.buttonRemoveTab.Text = "Remove Tab"; + this.buttonRemoveTab.UseVisualStyleBackColor = true; + this.buttonRemoveTab.Click += new System.EventHandler(this.buttonRemoveTab_Click); + // + // buttonRemoveSelectedTab + // + this.buttonRemoveSelectedTab.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.buttonRemoveSelectedTab.Location = new System.Drawing.Point(265, 3); + this.buttonRemoveSelectedTab.Name = "buttonRemoveSelectedTab"; + this.buttonRemoveSelectedTab.Size = new System.Drawing.Size(125, 23); + this.buttonRemoveSelectedTab.TabIndex = 2; + this.buttonRemoveSelectedTab.Text = "Remove Selected Tab"; + this.buttonRemoveSelectedTab.UseVisualStyleBackColor = true; + this.buttonRemoveSelectedTab.Click += new System.EventHandler(this.buttonRemoveSelectedTab_Click); + // + // buttonMoveTabToLeft + // + this.buttonMoveTabToLeft.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.buttonMoveTabToLeft.Location = new System.Drawing.Point(396, 3); + this.buttonMoveTabToLeft.Name = "buttonMoveTabToLeft"; + this.buttonMoveTabToLeft.Size = new System.Drawing.Size(125, 23); + this.buttonMoveTabToLeft.TabIndex = 3; + this.buttonMoveTabToLeft.Text = "Move Tab To Left"; + this.buttonMoveTabToLeft.UseVisualStyleBackColor = true; + this.buttonMoveTabToLeft.Click += new System.EventHandler(this.buttonMoveTabToLeft_Click); + // + // buttonMoveTabToRight + // + this.buttonMoveTabToRight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.buttonMoveTabToRight.Location = new System.Drawing.Point(527, 3); + this.buttonMoveTabToRight.Name = "buttonMoveTabToRight"; + this.buttonMoveTabToRight.Size = new System.Drawing.Size(125, 23); + this.buttonMoveTabToRight.TabIndex = 4; + this.buttonMoveTabToRight.Text = "Move Tab To Right"; + this.buttonMoveTabToRight.UseVisualStyleBackColor = true; + this.buttonMoveTabToRight.Click += new System.EventHandler(this.buttonMoveTabToRight_Click); + // + // panelButton + // + this.panelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.panelButton.Controls.Add(this.buttonMoveTabToRight); + this.panelButton.Controls.Add(this.buttonAddTab); + this.panelButton.Controls.Add(this.buttonMoveTabToLeft); + this.panelButton.Controls.Add(this.buttonRemoveTab); + this.panelButton.Controls.Add(this.buttonRemoveSelectedTab); + this.panelButton.Location = new System.Drawing.Point(0, 411); + this.panelButton.Name = "panelButton"; + this.panelButton.Size = new System.Drawing.Size(655, 29); + this.panelButton.TabIndex = 5; + // + // buttonMoveUp + // + this.buttonMoveUp.Location = new System.Drawing.Point(657, 3); + this.buttonMoveUp.Name = "buttonMoveUp"; + this.buttonMoveUp.Size = new System.Drawing.Size(100, 23); + this.buttonMoveUp.TabIndex = 6; + this.buttonMoveUp.Text = "Move up"; + this.buttonMoveUp.UseVisualStyleBackColor = true; + this.buttonMoveUp.Click += new System.EventHandler(this.buttonMoveUp_Click); + // + // buttonMoveDown + // + this.buttonMoveDown.Location = new System.Drawing.Point(657, 32); + this.buttonMoveDown.Name = "buttonMoveDown"; + this.buttonMoveDown.Size = new System.Drawing.Size(100, 23); + this.buttonMoveDown.TabIndex = 7; + this.buttonMoveDown.Text = "Move down"; + this.buttonMoveDown.UseVisualStyleBackColor = true; + this.buttonMoveDown.Click += new System.EventHandler(this.buttonMoveDown_Click); + // + // TabControlsWithDataGridViews + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.buttonMoveDown); + this.Controls.Add(this.buttonMoveUp); + this.Controls.Add(this.panelButton); + this.MinimumSize = new System.Drawing.Size(760, 440); + this.Name = "TabControlsWithDataGridViews"; + this.Size = new System.Drawing.Size(760, 440); + this.Load += new System.EventHandler(this.TabControlsWithDataGridViews_Load); + this.panelButton.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button buttonAddTab; + private System.Windows.Forms.Button buttonRemoveTab; + private System.Windows.Forms.Button buttonRemoveSelectedTab; + private System.Windows.Forms.Button buttonMoveTabToLeft; + private System.Windows.Forms.Button buttonMoveTabToRight; + private System.Windows.Forms.Panel panelButton; + private System.Windows.Forms.Button buttonMoveUp; + private System.Windows.Forms.Button buttonMoveDown; + } +} diff --git a/TabControlsWithDataGridViews/TabControlsWithDataGridViews.cs b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.cs new file mode 100644 index 0000000..4d2f85e --- /dev/null +++ b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.cs @@ -0,0 +1,241 @@ +using System; +using System.IO; +using System.Reflection; +using System.Windows.Forms; + +namespace Eugen.ESystem.Windows.Forms +{ + public partial class TabControlsWithDataGridViews : UserControl + { + #region Version und Copyright + // Key und Copyright + static string dllName = Path.GetFileNameWithoutExtension(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //Den Programmnamen auslesen + static string dllVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + static object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + static string copyright = GenerateCopyright(); + string icon = Application.StartupPath + "\\Info.bmp"; + //Assembly Datum und Zeit + static DateTime value = AssemblyDateTime(); + string date = value.ToShortDateString(); + string time = value.ToLongTimeString(); + private static DateTime AssemblyDateTime() + { + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + var buildDateTime = new DateTime(2000, 1, 1).Add(new TimeSpan(TimeSpan.TicksPerDay * version.Build + TimeSpan.TicksPerSecond * 2 * version.Revision)); + //Tage seit dem 1. Januar 2000 und Sekunden seit Mitternacht, (multiplizier mit 2 ergibt das Original) + return buildDateTime; + } + + private static string CurrentYear() + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + + private static string StartYear() + { + string startYear = ""; + if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © ")) + { + startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", ""); + while (startYear.StartsWith(" ")) + { + startYear = startYear.Remove(0, 1); + } + startYear = startYear.Remove(startYear.IndexOf(" ")); + return startYear; + } + else + { + DateTime dtn = DateTime.Now; + return dtn.Year.ToString(); + } + } + + private static string GenerateCopyright() + { + string startYear = StartYear(); + string currentYear = CurrentYear(); + + if (startYear == currentYear) + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright; + } + else + { + return ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace(startYear, String.Concat(startYear, "-", currentYear)); + } + } + #endregion + + #region DLL-Info + /// + /// Contains the name of the dll file. + /// + public static string DllName { private set; get; } + + /// + /// Contains the version of the dll file. + /// + public static string DllVersion { private set; get; } + + /// + /// Contains the copyright notice. + /// + public static string Copyright { private set; get; } + + /// + /// Contains the name-, version- and copyright-information of the dll file. + /// + public static string[] DllInfo { private set; get; } + + private static void SetDllInfo() + { + //Name, Key und Copyright setzen + DllName = dllName; + DllVersion = dllVersion; + Copyright = copyright; + } + #endregion + public TabControlsWithDataGridViews() + { + SetDllInfo(); + InitializeComponent(); + } + + private void TabControlsWithDataGridViews_Load(object sender, EventArgs e) + { + // Correct TabControlSize + if (TabControlWidth < minWidth) + { + this.Width = minWidth; + TabControlWidth = this.Width - 80; + } + else if (TabControlWidth > maxWidth) + { + this.Width = maxWidth; + TabControlWidth = this.Width - 80; + } + + if (TabControlHeight < minHeight) + { + this.Height = minHeight; + TabControlHeight = this.Height - 26; + } + else if (TabControlHeight > maxHeight) + { + this.Height = minHeight; + TabControlHeight = this.Height - 26; + } + + // Set the max. number of tabs + tcwdgv.MaxNoOfTabs = maxNoOfTabs; + + // Set the control button location + int controlButtonDistance = (panelButton.Width - (controlButtonWidth * 5) - 6) / 4 + controlButtonWidth; // X distance from the origin point of one button to the origin point of the next button + buttonRemoveTab.Location = new System.Drawing.Point(controlButtonXDistance + controlButtonDistance, 3); + buttonRemoveSelectedTab.Location = new System.Drawing.Point(controlButtonXDistance + 2 * controlButtonDistance, 3); + buttonMoveTabToLeft.Location = new System.Drawing.Point(controlButtonXDistance + 2 + 3 * controlButtonDistance, 3); + + tcwdgv.TabControlWidth = TabControlWidth; // The 'TabControl' width + tcwdgv.TabControlHeight = TabControlHeight; // The 'TabControl' hight + tcwdgv.TabTitle = TabTitle; // The title of a 'tabPage' + tcwdgv.Column1Title = Column1Title; // The title of column 1 + tcwdgv.Column2Title = Column2Title; // The title of column 2 + tcwdgv.MoveToButtonTitle = MoveToButtonTitle; // The title of the 'Move to' buttons + tcwdgv.CreatingTabControl(Controls); // Create a 'TabControl' and a 'TabPage' with a 'DataGridView' + + if (String.IsNullOrEmpty(DataPath)) + { + DataPath = ""; + } + tcwdgv.DataPath = DataPath; + + tcwdgv.Extension = Extension; + + // Reads all files from the root directory and writes them to the tables + tcwdgv.CreatesATabForEachDirectory(); // Creates a tab for each directory in the root directory + tcwdgv.InitialFillingOfTheTables(0); // Fills the tables with the values + } + + TabControlWithDataGridView tcwdgv = new TabControlWithDataGridView(); + + int maxNoOfTabs = 12; + int minWidth = 760; + int maxWidth = 1200; + int minHeight = 433; + int maxHeight = 800; + int controlButtonWidth = 130; + int controlButtonXDistance = 3; // X-distance between the origin point of a button and the edge + int tabButtonYDistance = 3; // Y-distance between the origin point of a button and the edge + int tabButtonDistance = 29; // Y-distance from the origin point of one button to the origin point of the next button + + int TabControlWidth { set; get; } + int TabControlHeight { set; get; } + + /// + /// Root directory in which the data are located + /// + public static string DataPath { set; get; } + + /// + /// The file extension you are looking for, e.g. .mp3 + /// + public static string Extension { set; get; } + + /// + /// Set or get the title of 'TabPage' + /// + public static string TabTitle { set; get; } + + /// + /// Set or get the title of 'DataGridView Column 1' + /// + public static string Column1Title { set; get; } + + /// + /// Set or get the title of 'DataGridView Column 2' + /// + public static string Column2Title { set; get; } + + /// + /// Set or get the title of the move to buttons + /// + public static string MoveToButtonTitle { set; get; } + + private void buttonAddTab_Click(object sender, EventArgs e) + { + tcwdgv.AddTabPageWithDataGridViewAndButton(); // Add an additional 'TabPage' with a 'DataGridView' + } + + private void buttonRemoveTab_Click(object sender, EventArgs e) + { + tcwdgv.RemoveTabPageAndButton(); // Removes the last 'TabPage' + } + + private void buttonRemoveSelectedTab_Click(object sender, EventArgs e) + { + tcwdgv.RemoveSelectedTabPageAndButton(); // Removes the selected 'TabPage' and renumber/rename the others + } + + private void buttonMoveTabToLeft_Click(object sender, EventArgs e) + { + tcwdgv.MoveTabPageToLeft(); // Moves the selected 'TabPage' to the left and renumber/rename the others + } + + private void buttonMoveTabToRight_Click(object sender, EventArgs e) + { + tcwdgv.MoveTabPageToRight(); // Moves the selected 'TabPage' to the rigth and renumber/rename the others + } + + private void buttonMoveUp_Click(object sender, EventArgs e) + { + tcwdgv.RowMoveUp(); + } + + private void buttonMoveDown_Click(object sender, EventArgs e) + { + tcwdgv.RowMoveDown(); + } + } +} diff --git a/TabControlsWithDataGridViews/TabControlsWithDataGridViews.csproj b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.csproj new file mode 100644 index 0000000..c64278c --- /dev/null +++ b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.csproj @@ -0,0 +1,91 @@ + + + + + Debug + AnyCPU + {A4B2147B-532C-474C-BFBA-D4AB7E6E820E} + Library + Eugen.ESystem.Windows.Forms + hetcwdgv + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + True + True + AppResources.resx + + + True + True + AppResources_de.resx + + + True + True + AppResources_en.resx + + + UserControl + + + TabControlsWithDataGridViews.cs + + + + + + + + ResXFileCodeGenerator + AppResources.Designer.cs + + + ResXFileCodeGenerator + AppResources_de.Designer.cs + + + ResXFileCodeGenerator + AppResources_en.Designer.cs + + + TabControlsWithDataGridViews.cs + + + + \ No newline at end of file diff --git a/TabControlsWithDataGridViews/TabControlsWithDataGridViews.resx b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/TabControlsWithDataGridViews/TabControlsWithDataGridViews.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.dll b/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.dll new file mode 100644 index 0000000..7c7963c Binary files /dev/null and b/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.dll differ diff --git a/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.pdb b/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.pdb new file mode 100644 index 0000000..6601e5d Binary files /dev/null and b/TabControlsWithDataGridViews/bin/Debug/hetcwdgv.pdb differ diff --git a/TabControlsWithDataGridViews/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/TabControlsWithDataGridViews/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/TabControlsWithDataGridViews/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..2d21f8d Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3787ac0 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources.resources b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources.resources differ diff --git a/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_de.resources b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_de.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_de.resources differ diff --git a/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_en.resources b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_en.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.Properties.AppResources_en.resources differ diff --git a/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews.resources b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews.resources differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TabControlWithDataGridViews.csproj.AssemblyReference.cache b/TabControlsWithDataGridViews/obj/Debug/TabControlWithDataGridViews.csproj.AssemblyReference.cache new file mode 100644 index 0000000..396c75b Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TabControlWithDataGridViews.csproj.AssemblyReference.cache differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.AssemblyReference.cache b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.AssemblyReference.cache new file mode 100644 index 0000000..f53d4d2 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.AssemblyReference.cache differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.CoreCompileInputs.cache b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..6a8c07a --- /dev/null +++ b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +362805a9dc970ac2fcfe5e123d4c993f907ae6939b9faf3dc1a0f00343231b22 diff --git a/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.FileListAbsolute.txt b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..f636ca2 --- /dev/null +++ b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.FileListAbsolute.txt @@ -0,0 +1,11 @@ +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\bin\Debug\hetcwdgv.dll +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\bin\Debug\hetcwdgv.pdb +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\TabControlsWithDataGridViews.csproj.AssemblyReference.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\Eugen.ESystem.Windows.Forms.Properties.AppResources.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\Eugen.ESystem.Windows.Forms.Properties.AppResources_de.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\Eugen.ESystem.Windows.Forms.Properties.AppResources_en.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\Eugen.ESystem.Windows.Forms.TabControlsWithDataGridViews.resources +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\TabControlsWithDataGridViews.csproj.GenerateResource.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\TabControlsWithDataGridViews.csproj.CoreCompileInputs.cache +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\hetcwdgv.dll +C:\CAD\Git-WorkRepository\VisualStudio\_USER CONTROL\TabControlsWithDataGridViews.git\TabControlsWithDataGridViews\obj\Debug\hetcwdgv.pdb diff --git a/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.GenerateResource.cache b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.GenerateResource.cache new file mode 100644 index 0000000..18ab0b8 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TabControlsWithDataGridViews.csproj.GenerateResource.cache differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources.Designer.cs.dll b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources.Designer.cs.dll new file mode 100644 index 0000000..4fd7a25 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources.Designer.cs.dll differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_de.Designer.cs.dll b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_de.Designer.cs.dll new file mode 100644 index 0000000..fe119b1 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_de.Designer.cs.dll differ diff --git a/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_en.Designer.cs.dll b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_en.Designer.cs.dll new file mode 100644 index 0000000..a637fe2 Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/TempPE/Properties.AppResources_en.Designer.cs.dll differ diff --git a/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.dll b/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.dll new file mode 100644 index 0000000..7c7963c Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.dll differ diff --git a/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.pdb b/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.pdb new file mode 100644 index 0000000..6601e5d Binary files /dev/null and b/TabControlsWithDataGridViews/obj/Debug/hetcwdgv.pdb differ diff --git a/config b/config new file mode 100644 index 0000000..d4c3978 --- /dev/null +++ b/config @@ -0,0 +1,9 @@ +[core] + repositoryformatversion = 0 + filemode = false + bare = true + symlinks = false + ignorecase = true + sharedrepository = 2 +[receive] + denyNonFastforwards = true diff --git a/description b/description new file mode 100644 index 0000000..498b267 --- /dev/null +++ b/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/hooks/applypatch-msg.sample b/hooks/applypatch-msg.sample new file mode 100644 index 0000000..a5d7b84 --- /dev/null +++ b/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/hooks/commit-msg.sample b/hooks/commit-msg.sample new file mode 100644 index 0000000..b58d118 --- /dev/null +++ b/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/hooks/fsmonitor-watchman.sample b/hooks/fsmonitor-watchman.sample new file mode 100644 index 0000000..23e856f --- /dev/null +++ b/hooks/fsmonitor-watchman.sample @@ -0,0 +1,174 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use IPC::Open2; + +# An example hook script to integrate Watchman +# (https://facebook.github.io/watchman/) with git to speed up detecting +# new and modified files. +# +# The hook is passed a version (currently 2) and last update token +# formatted as a string and outputs to stdout a new update token and +# all files that have been modified since the update token. Paths must +# be relative to the root of the working tree and separated by a single NUL. +# +# To enable this hook, rename this file to "query-watchman" and set +# 'git config core.fsmonitor .git/hooks/query-watchman' +# +my ($version, $last_update_token) = @ARGV; + +# Uncomment for debugging +# print STDERR "$0 $version $last_update_token\n"; + +# Check the hook interface version +if ($version ne 2) { + die "Unsupported query-fsmonitor hook version '$version'.\n" . + "Falling back to scanning...\n"; +} + +my $git_work_tree = get_working_dir(); + +my $retry = 1; + +my $json_pkg; +eval { + require JSON::XS; + $json_pkg = "JSON::XS"; + 1; +} or do { + require JSON::PP; + $json_pkg = "JSON::PP"; +}; + +launch_watchman(); + +sub launch_watchman { + my $o = watchman_query(); + if (is_work_tree_watched($o)) { + output_result($o->{clock}, @{$o->{files}}); + } +} + +sub output_result { + my ($clockid, @files) = @_; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # binmode $fh, ":utf8"; + # print $fh "$clockid\n@files\n"; + # close $fh; + + binmode STDOUT, ":utf8"; + print $clockid; + print "\0"; + local $, = "\0"; + print @files; +} + +sub watchman_clock { + my $response = qx/watchman clock "$git_work_tree"/; + die "Failed to get clock id on '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + + return $json_pkg->new->utf8->decode($response); +} + +sub watchman_query { + my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty') + or die "open2() failed: $!\n" . + "Falling back to scanning...\n"; + + # In the query expression below we're asking for names of files that + # changed since $last_update_token but not from the .git folder. + # + # To accomplish this, we're using the "since" generator to use the + # recency index to select candidate nodes and "fields" to limit the + # output to file names only. Then we're using the "expression" term to + # further constrain the results. + my $last_update_line = ""; + if (substr($last_update_token, 0, 1) eq "c") { + $last_update_token = "\"$last_update_token\""; + $last_update_line = qq[\n"since": $last_update_token,]; + } + my $query = <<" END"; + ["query", "$git_work_tree", {$last_update_line + "fields": ["name"], + "expression": ["not", ["dirname", ".git"]] + }] + END + + # Uncomment for debugging the watchman query + # open (my $fh, ">", ".git/watchman-query.json"); + # print $fh $query; + # close $fh; + + print CHLD_IN $query; + close CHLD_IN; + my $response = do {local $/; }; + + # Uncomment for debugging the watch response + # open ($fh, ">", ".git/watchman-response.json"); + # print $fh $response; + # close $fh; + + die "Watchman: command returned no output.\n" . + "Falling back to scanning...\n" if $response eq ""; + die "Watchman: command returned invalid output: $response\n" . + "Falling back to scanning...\n" unless $response =~ /^\{/; + + return $json_pkg->new->utf8->decode($response); +} + +sub is_work_tree_watched { + my ($output) = @_; + my $error = $output->{error}; + if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) { + $retry--; + my $response = qx/watchman watch "$git_work_tree"/; + die "Failed to make watchman watch '$git_work_tree'.\n" . + "Falling back to scanning...\n" if $? != 0; + $output = $json_pkg->new->utf8->decode($response); + $error = $output->{error}; + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + # Uncomment for debugging watchman output + # open (my $fh, ">", ".git/watchman-output.out"); + # close $fh; + + # Watchman will always return all files on the first query so + # return the fast "everything is dirty" flag to git and do the + # Watchman query just to get it over with now so we won't pay + # the cost in git to look up each individual file. + my $o = watchman_clock(); + $error = $output->{error}; + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + output_result($o->{clock}, ("/")); + $last_update_token = $o->{clock}; + + eval { launch_watchman() }; + return 0; + } + + die "Watchman: $error.\n" . + "Falling back to scanning...\n" if $error; + + return 1; +} + +sub get_working_dir { + my $working_dir; + if ($^O =~ 'msys' || $^O =~ 'cygwin') { + $working_dir = Win32::GetCwd(); + $working_dir =~ tr/\\/\//; + } else { + require Cwd; + $working_dir = Cwd::cwd(); + } + + return $working_dir; +} diff --git a/hooks/post-update.sample b/hooks/post-update.sample new file mode 100644 index 0000000..ec17ec1 --- /dev/null +++ b/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/hooks/pre-applypatch.sample b/hooks/pre-applypatch.sample new file mode 100644 index 0000000..4142082 --- /dev/null +++ b/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/hooks/pre-commit.sample b/hooks/pre-commit.sample new file mode 100644 index 0000000..e144712 --- /dev/null +++ b/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=$(git hash-object -t tree /dev/null) +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --type=bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/hooks/pre-merge-commit.sample b/hooks/pre-merge-commit.sample new file mode 100644 index 0000000..399eab1 --- /dev/null +++ b/hooks/pre-merge-commit.sample @@ -0,0 +1,13 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git merge" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message to +# stderr if it wants to stop the merge commit. +# +# To enable this hook, rename this file to "pre-merge-commit". + +. git-sh-setup +test -x "$GIT_DIR/hooks/pre-commit" && + exec "$GIT_DIR/hooks/pre-commit" +: diff --git a/hooks/pre-push.sample b/hooks/pre-push.sample new file mode 100644 index 0000000..4ce688d --- /dev/null +++ b/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +zero=$(git hash-object --stdin &2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/hooks/pre-rebase.sample b/hooks/pre-rebase.sample new file mode 100644 index 0000000..6cbef5c --- /dev/null +++ b/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up to date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/hooks/pre-receive.sample b/hooks/pre-receive.sample new file mode 100644 index 0000000..a1fd29e --- /dev/null +++ b/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/hooks/prepare-commit-msg.sample b/hooks/prepare-commit-msg.sample new file mode 100644 index 0000000..10fa14c --- /dev/null +++ b/hooks/prepare-commit-msg.sample @@ -0,0 +1,42 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first one removes the +# "# Please enter the commit message..." help message. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +COMMIT_MSG_FILE=$1 +COMMIT_SOURCE=$2 +SHA1=$3 + +/usr/bin/perl -i.bak -ne 'print unless(m/^. Please enter the commit message/..m/^#$/)' "$COMMIT_MSG_FILE" + +# case "$COMMIT_SOURCE,$SHA1" in +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$COMMIT_MSG_FILE" ;; +# *) ;; +# esac + +# SOB=$(git var GIT_COMMITTER_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# git interpret-trailers --in-place --trailer "$SOB" "$COMMIT_MSG_FILE" +# if test -z "$COMMIT_SOURCE" +# then +# /usr/bin/perl -i.bak -pe 'print "\n" if !$first_line++' "$COMMIT_MSG_FILE" +# fi diff --git a/hooks/push-to-checkout.sample b/hooks/push-to-checkout.sample new file mode 100644 index 0000000..af5a0c0 --- /dev/null +++ b/hooks/push-to-checkout.sample @@ -0,0 +1,78 @@ +#!/bin/sh + +# An example hook script to update a checked-out tree on a git push. +# +# This hook is invoked by git-receive-pack(1) when it reacts to git +# push and updates reference(s) in its repository, and when the push +# tries to update the branch that is currently checked out and the +# receive.denyCurrentBranch configuration variable is set to +# updateInstead. +# +# By default, such a push is refused if the working tree and the index +# of the remote repository has any difference from the currently +# checked out commit; when both the working tree and the index match +# the current commit, they are updated to match the newly pushed tip +# of the branch. This hook is to be used to override the default +# behaviour; however the code below reimplements the default behaviour +# as a starting point for convenient modification. +# +# The hook receives the commit with which the tip of the current +# branch is going to be updated: +commit=$1 + +# It can exit with a non-zero status to refuse the push (when it does +# so, it must not modify the index or the working tree). +die () { + echo >&2 "$*" + exit 1 +} + +# Or it can make any necessary changes to the working tree and to the +# index to bring them to the desired state when the tip of the current +# branch is updated to the new commit, and exit with a zero status. +# +# For example, the hook can simply run git read-tree -u -m HEAD "$1" +# in order to emulate git fetch that is run in the reverse direction +# with git push, as the two-tree form of git read-tree -u -m is +# essentially the same as git switch or git checkout that switches +# branches while keeping the local changes in the working tree that do +# not interfere with the difference between the branches. + +# The below is a more-or-less exact translation to shell of the C code +# for the default behaviour for git's push-to-checkout hook defined in +# the push_to_deploy() function in builtin/receive-pack.c. +# +# Note that the hook will be executed from the repository directory, +# not from the working tree, so if you want to perform operations on +# the working tree, you will have to adapt your code accordingly, e.g. +# by adding "cd .." or using relative paths. + +if ! git update-index -q --ignore-submodules --refresh +then + die "Up-to-date check failed" +fi + +if ! git diff-files --quiet --ignore-submodules -- +then + die "Working directory has unstaged changes" +fi + +# This is a rough translation of: +# +# head_has_history() ? "HEAD" : EMPTY_TREE_SHA1_HEX +if git cat-file -e HEAD 2>/dev/null +then + head=HEAD +else + head=$(git hash-object -t tree --stdin &2 + exit 1 +} + +unset GIT_DIR GIT_WORK_TREE +cd "$worktree" && + +if grep -q "^diff --git " "$1" +then + validate_patch "$1" +else + validate_cover_letter "$1" +fi && + +if test "$GIT_SENDEMAIL_FILE_COUNTER" = "$GIT_SENDEMAIL_FILE_TOTAL" +then + git config --unset-all sendemail.validateWorktree && + trap 'git worktree remove -ff "$worktree"' EXIT && + validate_series +fi diff --git a/hooks/update.sample b/hooks/update.sample new file mode 100644 index 0000000..c4d426b --- /dev/null +++ b/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --type=bool hooks.allowunannotated) +allowdeletebranch=$(git config --type=bool hooks.allowdeletebranch) +denycreatebranch=$(git config --type=bool hooks.denycreatebranch) +allowdeletetag=$(git config --type=bool hooks.allowdeletetag) +allowmodifytag=$(git config --type=bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero=$(git hash-object --stdin &2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/info/exclude b/info/exclude new file mode 100644 index 0000000..a5196d1 --- /dev/null +++ b/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~