Initialized

This commit is contained in:
Eugen Höglinger 2024-10-09 15:43:39 +02:00
commit 9ff0f0f4cb
46 changed files with 1616 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,115 @@
{
"Version": 1,
"WorkspaceRootPath": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|c:\\cad\\git-workrepository\\visualstudio\\_test\\test_changeorder.git\\test_changeorder\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|solutionrelative:test_changeorder\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\test_changeorder\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form",
"RelativeMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|solutionrelative:test_changeorder\\form1.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}|Form"
},
{
"AbsoluteMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\test_changeorder\\renamefiles.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|solutionrelative:test_changeorder\\renamefiles.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\test_changeorder\\movetotab.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|solutionrelative:test_changeorder\\movetotab.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\test_changeorder\\movedown.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{603EE8BF-85AC-4454-A8CB-82ABB65671A5}|Test_ChangeOrder\\Test_ChangeOrder.csproj|solutionrelative:test_changeorder\\movedown.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 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": "Document",
"DocumentIndex": 2,
"Title": "RenameFiles.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\RenameFiles.cs",
"RelativeDocumentMoniker": "Test_ChangeOrder\\RenameFiles.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\RenameFiles.cs",
"RelativeToolTip": "Test_ChangeOrder\\RenameFiles.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAwAAAA2AAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-27T14:35:47.801Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 4,
"Title": "MoveDown.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\MoveDown.cs",
"RelativeDocumentMoniker": "Test_ChangeOrder\\MoveDown.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\MoveDown.cs",
"RelativeToolTip": "Test_ChangeOrder\\MoveDown.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAABEAAABGAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-26T09:47:37.936Z"
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "MoveToTab.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\MoveToTab.cs",
"RelativeDocumentMoniker": "Test_ChangeOrder\\MoveToTab.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\MoveToTab.cs",
"RelativeToolTip": "Test_ChangeOrder\\MoveToTab.cs",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAFkAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-21T12:23:13.935Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "Form1.cs",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\Form1.cs",
"RelativeDocumentMoniker": "Test_ChangeOrder\\Form1.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\Form1.cs",
"RelativeToolTip": "Test_ChangeOrder\\Form1.cs",
"ViewState": "AQIAAIYAAAAAAAAAAAAAALAAAAALAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-15T11:42:32.312Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "Form1.cs [Entwurf]",
"DocumentMoniker": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\Form1.cs",
"RelativeDocumentMoniker": "Test_ChangeOrder\\Form1.cs",
"ToolTip": "C:\\CAD\\Git-WorkRepository\\VisualStudio\\_TEST\\Test_ChangeOrder.git\\Test_ChangeOrder\\Form1.cs [Entwurf]",
"RelativeToolTip": "Test_ChangeOrder\\Form1.cs [Entwurf]",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2024-03-15T09:54:45.702Z",
"EditorCaption": " [Entwurf]"
}
]
}
]
}
]
}

View File

View File

View File

View File

View File

View File

View File

View File

View File

25
Test_ChangeOrder.git.sln Normal file
View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34616.47
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test_ChangeOrder", "Test_ChangeOrder\Test_ChangeOrder.csproj", "{603EE8BF-85AC-4454-A8CB-82ABB65671A5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{603EE8BF-85AC-4454-A8CB-82ABB65671A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{603EE8BF-85AC-4454-A8CB-82ABB65671A5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{603EE8BF-85AC-4454-A8CB-82ABB65671A5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{603EE8BF-85AC-4454-A8CB-82ABB65671A5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9F4EAA72-9746-4E33-BA76-4085F021A1F4}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

259
Test_ChangeOrder/Form1.Designer.cs generated Normal file
View File

@ -0,0 +1,259 @@
namespace Test_ChangeOrder
{
partial class Form1
{
/// <summary>
/// Erforderliche Designervariable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
/// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Vom Windows Form-Designer generierter Code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
private void InitializeComponent()
{
this.tabControl = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.dataGridViewTab1 = new System.Windows.Forms.DataGridView();
this.Nummer = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Titel = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.dataGridViewTab2 = new System.Windows.Forms.DataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.buttonUp = new System.Windows.Forms.Button();
this.buttonDown = new System.Windows.Forms.Button();
this.buttonToTab1 = new System.Windows.Forms.Button();
this.buttonToTab2 = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.buttonReadData = new System.Windows.Forms.Button();
this.buttonAddTab = new System.Windows.Forms.Button();
this.buttonRemoveTab = new System.Windows.Forms.Button();
this.tabControl.SuspendLayout();
this.tabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewTab1)).BeginInit();
this.tabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridViewTab2)).BeginInit();
this.SuspendLayout();
//
// tabControl
//
this.tabControl.Controls.Add(this.tabPage1);
this.tabControl.Controls.Add(this.tabPage2);
this.tabControl.Location = new System.Drawing.Point(12, 41);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(695, 368);
this.tabControl.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.Controls.Add(this.dataGridViewTab1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(687, 342);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "Tab 1";
this.tabPage1.UseVisualStyleBackColor = true;
//
// dataGridViewTab1
//
this.dataGridViewTab1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridViewTab1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Nummer,
this.Titel});
this.dataGridViewTab1.Location = new System.Drawing.Point(6, 6);
this.dataGridViewTab1.Name = "dataGridViewTab1";
this.dataGridViewTab1.Size = new System.Drawing.Size(675, 330);
this.dataGridViewTab1.TabIndex = 0;
//
// Nummer
//
this.Nummer.HeaderText = "No.";
this.Nummer.Name = "Nummer";
this.Nummer.Width = 30;
//
// Titel
//
this.Titel.HeaderText = "Titel";
this.Titel.Name = "Titel";
this.Titel.Width = 580;
//
// tabPage2
//
this.tabPage2.Controls.Add(this.dataGridViewTab2);
this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(687, 342);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Tab 2";
this.tabPage2.UseVisualStyleBackColor = true;
//
// dataGridViewTab2
//
this.dataGridViewTab2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridViewTab2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1,
this.dataGridViewTextBoxColumn2});
this.dataGridViewTab2.Location = new System.Drawing.Point(6, 6);
this.dataGridViewTab2.Name = "dataGridViewTab2";
this.dataGridViewTab2.Size = new System.Drawing.Size(675, 330);
this.dataGridViewTab2.TabIndex = 1;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.HeaderText = "No.";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
this.dataGridViewTextBoxColumn1.Width = 30;
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.HeaderText = "Titel";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
this.dataGridViewTextBoxColumn2.Width = 580;
//
// buttonUp
//
this.buttonUp.Location = new System.Drawing.Point(713, 12);
this.buttonUp.Name = "buttonUp";
this.buttonUp.Size = new System.Drawing.Size(75, 23);
this.buttonUp.TabIndex = 1;
this.buttonUp.Text = "Nach oben";
this.buttonUp.UseVisualStyleBackColor = true;
this.buttonUp.Click += new System.EventHandler(this.buttonUp_Click);
//
// buttonDown
//
this.buttonDown.Location = new System.Drawing.Point(713, 41);
this.buttonDown.Name = "buttonDown";
this.buttonDown.Size = new System.Drawing.Size(75, 23);
this.buttonDown.TabIndex = 2;
this.buttonDown.Text = "Nach unten";
this.buttonDown.UseVisualStyleBackColor = true;
this.buttonDown.Click += new System.EventHandler(this.buttonDown_Click);
//
// buttonToTab1
//
this.buttonToTab1.Location = new System.Drawing.Point(713, 70);
this.buttonToTab1.Name = "buttonToTab1";
this.buttonToTab1.Size = new System.Drawing.Size(75, 23);
this.buttonToTab1.TabIndex = 3;
this.buttonToTab1.Text = "Auf Tab 1";
this.buttonToTab1.UseVisualStyleBackColor = true;
this.buttonToTab1.Click += new System.EventHandler(this.buttonToTab1_Click);
//
// buttonToTab2
//
this.buttonToTab2.Location = new System.Drawing.Point(713, 99);
this.buttonToTab2.Name = "buttonToTab2";
this.buttonToTab2.Size = new System.Drawing.Size(75, 23);
this.buttonToTab2.TabIndex = 4;
this.buttonToTab2.Text = "Auf Tab 2";
this.buttonToTab2.UseVisualStyleBackColor = true;
this.buttonToTab2.Click += new System.EventHandler(this.buttonToTab2_Click);
//
// buttonCancel
//
this.buttonCancel.Location = new System.Drawing.Point(713, 415);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
this.buttonCancel.TabIndex = 6;
this.buttonCancel.Text = "Abbrechen";
this.buttonCancel.UseVisualStyleBackColor = true;
this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click);
//
// buttonReadData
//
this.buttonReadData.Location = new System.Drawing.Point(12, 12);
this.buttonReadData.Name = "buttonReadData";
this.buttonReadData.Size = new System.Drawing.Size(695, 23);
this.buttonReadData.TabIndex = 7;
this.buttonReadData.Text = "Daten einlesen";
this.buttonReadData.UseVisualStyleBackColor = true;
this.buttonReadData.Click += new System.EventHandler(this.buttonReadData_Click);
//
// buttonAddTab
//
this.buttonAddTab.Location = new System.Drawing.Point(713, 347);
this.buttonAddTab.Name = "buttonAddTab";
this.buttonAddTab.Size = new System.Drawing.Size(75, 23);
this.buttonAddTab.TabIndex = 9;
this.buttonAddTab.Text = "Tab dazu";
this.buttonAddTab.UseVisualStyleBackColor = true;
this.buttonAddTab.Click += new System.EventHandler(this.buttonAddTab_Click);
//
// buttonRemoveTab
//
this.buttonRemoveTab.Location = new System.Drawing.Point(713, 376);
this.buttonRemoveTab.Name = "buttonRemoveTab";
this.buttonRemoveTab.Size = new System.Drawing.Size(75, 23);
this.buttonRemoveTab.TabIndex = 10;
this.buttonRemoveTab.Text = "Tab weg";
this.buttonRemoveTab.UseVisualStyleBackColor = true;
this.buttonRemoveTab.Click += new System.EventHandler(this.buttonRemoveTab_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(800, 450);
this.Controls.Add(this.buttonRemoveTab);
this.Controls.Add(this.buttonAddTab);
this.Controls.Add(this.buttonReadData);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonToTab2);
this.Controls.Add(this.buttonToTab1);
this.Controls.Add(this.buttonDown);
this.Controls.Add(this.buttonUp);
this.Controls.Add(this.tabControl);
this.Name = "Form1";
this.Text = "Form1";
this.tabControl.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridViewTab1)).EndInit();
this.tabPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dataGridViewTab2)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2;
private System.Windows.Forms.Button buttonUp;
private System.Windows.Forms.Button buttonDown;
private System.Windows.Forms.Button buttonToTab1;
private System.Windows.Forms.Button buttonToTab2;
private System.Windows.Forms.DataGridView dataGridViewTab1;
private System.Windows.Forms.DataGridView dataGridViewTab2;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Button buttonReadData;
private System.Windows.Forms.DataGridViewTextBoxColumn Nummer;
private System.Windows.Forms.DataGridViewTextBoxColumn Titel;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
private System.Windows.Forms.Button buttonAddTab;
private System.Windows.Forms.Button buttonRemoveTab;
}
}

367
Test_ChangeOrder/Form1.cs Normal file
View File

@ -0,0 +1,367 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
namespace Test_ChangeOrder
{
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 = 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 = "";
if (((AssemblyCopyrightAttribute)attributes[0]).Copyright.Contains("Copyright © "))
{
startYear = ((AssemblyCopyrightAttribute)attributes[0]).Copyright.Replace("Copyright © ", "");
while (startYear.StartsWith(" "))
{
startYear = startYear.Remove(0, 1);
}
if (startYear.Contains("-"))
{
startYear = startYear.Remove(startYear.IndexOf("-"));
}
else
{
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
{
string temp = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
string start = temp.Remove(temp.IndexOf(startYear) - 1);
string end = (temp.Remove(0, temp.IndexOf(" by")));
return String.Concat(start, " ", startYear, "-", currentYear, end);
}
}
#endregion
#region Programm-Info
/// <summary>
/// Contains the name of the program file
/// </summary>
public static string ProgramName { set; get; }
/// <summary>
/// Contains the version of the program file
/// </summary>
public static string ProgramVersion { set; get; }
/// <summary>
/// Contains the copyright notice
/// </summary>
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();
//TestToTab("Tab 2");
}
enum MovementDirection
{
Up,
Down
}
enum Moved
{
Yes,
No
}
enum CurrentTab
{
Tab1,
Tab2
}
string path = @"C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Daten\";
string[] subfolders = new string[] { "Tab 1", "Tab 2" };
List<string> ValuesTab1 { set; get; }
List<string> ValuesTab2 { set; get; }
//private void TestToTab(string toTab)
//{
// List<List<string>> tab = new List<List<string>>();
// string selectedTab = "";
// int selectedTabIndex = 0;
// int selectedRow = 0;
// List<DataGridView> dataGridView = new List<DataGridView>();
// for (int i = 0; i < tabControl.TabCount; i++)
// {
// List<string> tabValues = new List<string>();
// tab.Add(tabValues);
// DataGridView dataGridViewName = new DataGridView();
// dataGridView.Add(dataGridViewName);
// }
// if (tabControl.SelectedTab.Text != toTab)
// {
// selectedTab = tabControl.SelectedTab.ToString();
// selectedTabIndex = tabControl.SelectedIndex;
// //value = dataGridViewTab1[1, dataGridViewTab1.CurrentCellAddress.Y].Value.ToString();
// }
// else
// {
// MessageBox.Show("Wert kann nicht in den gleichen Bereich verschoben werden.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
// }
//}
private void buttonReadData_Click(object sender, EventArgs e)
{
//Lies Daten vom Laufwerk
ValuesTab1 = ReadFilesFromFolder(path + subfolders[0]); //Daten vom Verzeichnis 'Tab 1' lesen und der Variablen 'ValuesTab1' zuordnen
ValuesTab2 = ReadFilesFromFolder(path + subfolders[1]); //Daten von Verzeichnis 'Tab 2' lesen und der Variablen 'ValuesTab2' zuordnen
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte in 'dataGridViewTab1' und 'dataGridViewTab2' schreiben
}
private void buttonCancel_Click(object sender, EventArgs e)
{
this.Close();
}
private void buttonUp_Click(object sender, EventArgs e)
{
//Eine Zeile nach oben verschieben
MoveRow(MovementDirection.Up);
}
private void buttonDown_Click(object sender, EventArgs e)
{
//Eine Zeile nach unten verschieben
MoveRow(MovementDirection.Down);
}
private void buttonToTab1_Click(object sender, EventArgs e)
{
//Nach Tab 1 verschieben
string value = "";
List<List<string>> allValues = new List<List<string>>();
allValues.Add(ValuesTab1);
allValues.Add(ValuesTab2);
if (tabControl.SelectedTab.Text == "Tab 2")
{
value = dataGridViewTab2[1, dataGridViewTab2.CurrentCellAddress.Y].Value.ToString();
var moveToTab = new MoveToTab();
allValues = moveToTab.Move("Tab 1", allValues, value);
ValuesTab1 = allValues[0]; //Werte von 'Tab 1' setzen
ValuesTab2 = allValues[1]; //Werte von 'Tab 2' setzen
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab1' in 'dataGridViewTab1' schreiben
SetRowSelectionTab(CurrentTab.Tab2, 0); //Aktuelle Zeile selektieren
}
else
{
MessageBox.Show("Wert kann nicht in den gleichen Bereich verschoben werden.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void buttonToTab2_Click(object sender, EventArgs e)
{
//Nach Tab 2 verschieben
string value = "";
List<List<string>> allValues = new List<List<string>>();
allValues.Add(ValuesTab1);
allValues.Add(ValuesTab2);
if (tabControl.SelectedTab.Text == "Tab 1")
{
value = dataGridViewTab1[1, dataGridViewTab1.CurrentCellAddress.Y].Value.ToString();
var moveToTab = new MoveToTab();
allValues = moveToTab.Move("Tab 2", allValues, value);
ValuesTab1 = allValues[0]; //Werte von 'Tab 1' setzen
ValuesTab2 = allValues[1]; //Werte von 'Tab 2' setzen
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab1' in 'dataGridViewTab1' schreiben
SetRowSelectionTab(CurrentTab.Tab1, 0); //Aktuelle Zeile selektieren
}
else
{
MessageBox.Show("Wert kann nicht in den gleichen Bereich verschoben werden.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
private void buttonAddTab_Click(object sender, EventArgs e)
{
//TODO: Einen neuen Tab erzeugen
//Maximal 10 Tabs möglich
}
private void buttonRemoveTab_Click(object sender, EventArgs e)
{
//TODO: Den letzten TAB entfernen
//Tab darf keine Elemente mehr enthalten
//Es muss mindestens 1 Tab erhalten bleiben
}
private List<string> ReadFilesFromFolder(string folder)
{
List<string> files = new List<string>();
//Dateien einlesen
if (Directory.GetFiles(folder).Length < 1)
{
//Keine Dateien vorhanden
return files;
}
else
{
//Dateien vorhanden
foreach(string file in Directory.GetFiles(folder))
{
files.Add(file);
}
return files;
}
}
private void WriteValuesToDataGridView(List<string> valuesTab1, List<string> valuesTab2)
{
//Werte von 'ValuesTab1' in 'dataGridViewTab1' schreiben
dataGridViewTab1.RowCount = valuesTab1.Count;
for (int i = 0; i < valuesTab1.Count; i++)
{
dataGridViewTab1[0, i].Value = i + 1;
dataGridViewTab1[1, i].Value = valuesTab1[i];
}
//Werte von 'ValuesTab2' in 'dataGridViewTab2' schreiben
dataGridViewTab2.RowCount = valuesTab2.Count;
for (int i = 0; i < valuesTab2.Count; i++)
{
dataGridViewTab2[0, i].Value = i + 1;
dataGridViewTab2[1, i].Value = valuesTab2[i];
}
}
private void MoveRow(MovementDirection movmentDirection)
{
if (movmentDirection == MovementDirection.Up)
{
//Eine Zeile nach oben verschieben
var moveUp = new MoveUp();
if (tabControl.SelectedTab.Text == "Tab 1")
{
ValuesTab1 = moveUp.Move(ValuesTab1, dataGridViewTab1.CurrentCellAddress.Y); //Die Werte und die selektierte Zeile übergeben
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab1' in 'dataGridViewTab1' schreiben
SetRowSelectionTab(CurrentTab.Tab1, moveUp.SelectedRow); //Aktuelle Zeile selektieren
}
else
{
ValuesTab2 = moveUp.Move(ValuesTab2, dataGridViewTab2.CurrentCellAddress.Y); //Die Werte und die selektierte Zeile übergeben
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab2' in 'dataGridViewTab2' schreiben
SetRowSelectionTab(CurrentTab.Tab2,moveUp.SelectedRow); //Aktuelle Zeile selektieren
}
}
else
{
//Eine Zeile nach unten verschieben
var moveDown = new MoveDown();
if (tabControl.SelectedTab.Text == "Tab 1")
{
ValuesTab1 = moveDown.Move(ValuesTab1, dataGridViewTab1.CurrentCellAddress.Y); //Die Werte und die selektierte Zeile übergeben
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab1' in 'dataGridViewTab1' schreiben
SetRowSelectionTab(CurrentTab.Tab1, moveDown.SelectedRow); //Aktuelle Zeile selektieren
}
else
{
ValuesTab2 = moveDown.Move(ValuesTab2, dataGridViewTab2.CurrentCellAddress.Y); //Die Werte und die selektierte Zeile übergeben
WriteValuesToDataGridView(ValuesTab1, ValuesTab2); //Werte von 'ValuesTab2' in 'dataGridViewTab2' schreiben
SetRowSelectionTab(CurrentTab.Tab2, moveDown.SelectedRow); //Aktuelle Zeile selektieren
}
}
}
private void SetRowSelectionTab(CurrentTab tab, int selectedRow)
{
if (tab == CurrentTab.Tab1)
{
//'Tab 1' ist ausgewählt
dataGridViewTab1.CurrentCell = dataGridViewTab1[0, selectedRow]; //Aktuelle Zeile setzen
dataGridViewTab1.Rows[dataGridViewTab1.CurrentCellAddress.Y].Selected = true; //Die aktive Zeile selektieren
}
else
{
//'Tab 2' ist ausgewählt
dataGridViewTab2.CurrentCell = dataGridViewTab2[0, selectedRow]; //Aktuelle Zeile setzen
dataGridViewTab2.Rows[dataGridViewTab2.CurrentCellAddress.Y].Selected = true; //Die aktive Zeile selektieren
}
}
}
}

144
Test_ChangeOrder/Form1.resx Normal file
View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="Nummer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Titel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Nummer.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Titel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@ -0,0 +1,98 @@
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 Test_ChangeOrder
{
internal class MoveDown
{
//public List<string> Values { get; set; }
//public int NumberSelectedValue { get; set; }
public int SelectedRow { get; set; }
public List<string> Move(List<string> values, int selectedRow)
{
SelectedRow = selectedRow;
//Wenn die Ausgewählte Position nicht größer als die Anzahl der Werte und nicht die erste Position ist, dann verschiebe den ausgewählten Wert eine Position nach oben
if (ValidSelection(values, selectedRow))
{
//values.Clear();
values = NewValues(ValuesBefore(values, selectedRow), values[selectedRow], ValuesAfter(values, selectedRow));
var renameFiles = new RenameFiles();
values = renameFiles.Rename(values);
SetSelectedRow(selectedRow);
}
return values;
}
private List<string> ValuesBefore(List<string> values, int selectedRow)
{
List<string> valuesBefore = new List<string>();
valuesBefore.Clear();
for (int i = 0; i < selectedRow; i++)
{
valuesBefore.Add(values[i]);
}
return valuesBefore;
}
private List<string> ValuesAfter(List<string> values, int selectedRow)
{
List<string> valuesAfter = new List<string>();
valuesAfter.Clear();
for (int i = selectedRow + 1; i < values.Count; i++)
{
valuesAfter.Add(values[i]);
}
return valuesAfter;
}
protected virtual List<string> NewValues(List<string> valuesBefore, string selectedValue, List<string> valuesAfter)
{
List<string> newValue = new List<string>();
newValue.Clear();
newValue.AddRange(valuesBefore);
newValue.Add(valuesAfter[0]);
newValue.Add(selectedValue);
for (int i = 1; i < valuesAfter.Count; i++)
{
newValue.Add(valuesAfter[i]);
}
return newValue;
}
protected virtual bool ValidSelection(List<string> values, int selectedRow)
{
//Die ausgewählte Position muss min. 1 sein, weil sie sonst nicht nach vorne geschoben werden kann und
//die Position darf nicht größer als die max. Anzahl der Elemnte sein
if (selectedRow >= 0 && selectedRow < values.Count - 1)
{
return true;
}
else
{
return false;
}
}
protected virtual void SetSelectedRow(int selectedRow)
{
SelectedRow = selectedRow + 1;
}
}
}

View File

@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test_ChangeOrder
{
internal class MoveToTab
{
public List<List<String>> Move(string toTab, List<List<string>> allValues, string selectedValue)
{
//List<List<String>> allValues = new List<List<String>>();
List<string> valuesTab1 = new List<string>();
List<string> valuesTab2 = new List<string>();
string destinationValue = "";
string fileName = "";
string tempFileName = "";
valuesTab1.AddRange(allValues[0]);
valuesTab2.AddRange(allValues[1]);
var renameFiles = new RenameFiles();
if (toTab == "Tab 1")
{
//Übergebenen Wert aus der Liste von 'Tab 2' entfernen
valuesTab2.Remove(selectedValue);
//Zu verschiebende Datei nach 'C:\temp' verschieben, damit es kein Problem mit einer ev. vorhandenen Namensgleichheit gibt
fileName = Path.GetFileName(selectedValue);
tempFileName = "C:\\temp\\" + fileName;
//Datei von Verzeichnis 'Tab 2' ins Verzeichnis 'C:\temp' verschieben
File.Move(selectedValue, tempFileName);
//Die Einträge der Liste von 'Tab 2' umbenennen
renameFiles.Rename(valuesTab2);
//Verzeichnis 'Tab 2' in Verzeichnis 'Tab 1' umbenennen
if (valuesTab1.Count < 10)
{
destinationValue = Path.GetDirectoryName(selectedValue) + "\\" + "0" + (valuesTab1.Count + 1) + fileName.Remove(0, fileName.IndexOf(" "));
}
else
{
destinationValue = Path.GetDirectoryName(selectedValue) + "\\" + (valuesTab1.Count + 1) + fileName.Remove(0, fileName.IndexOf(" "));
}
destinationValue = destinationValue.Replace("Tab 2", "Tab 1");
//Übergebenen Wert in der Liste von 'Tab 1' ans Ende setzen
valuesTab1.Add(destinationValue);
//Datei von Verzeichnis 'Tab 2' ins Verzeichnis 'Tab 1' verschieben
File.Move(tempFileName, destinationValue);
}
else
{
//Übergebenen Wert aus der Liste von 'Tab 1' entfernen
valuesTab1.Remove(selectedValue);
//Zu verschiebende Datei nach 'C:\temp' verschieben, damit es kein Problem mit einer ev. vorhandenen Namensgleichheit gibt
fileName = Path.GetFileName(selectedValue);
tempFileName = "C:\\temp\\" + fileName;
//Datei von Verzeichnis 'Tab 1' ins Verzeichnis 'C:\temp' verschieben
File.Move(selectedValue, tempFileName);
//Die Einträge der Liste von 'Tab 1' umbenennen
renameFiles.Rename(valuesTab1);
//Verzeichnis 'Tab 1' in Verzeichnis 'Tab 2' umbenennen
if (valuesTab2.Count < 10)
{
destinationValue = Path.GetDirectoryName(selectedValue) + "\\" + "0" + (valuesTab2.Count + 1) + fileName.Remove(0, fileName.IndexOf(" "));
}
else
{
destinationValue = Path.GetDirectoryName(selectedValue) + "\\" + (valuesTab2.Count + 1) + fileName.Remove(0, fileName.IndexOf(" "));
}
destinationValue = destinationValue.Replace("Tab 1", "Tab 2");
//Übergebenen Wert in der Liste von 'Tab 2' ans Ende setzen
valuesTab2.Add(destinationValue);
//Datei von Verzeichnis 'Tab 1' ins Verzeichnis 'Tab 2' verschieben
File.Move(tempFileName, destinationValue);
}
//Liste von 'Tab 1' und von 'Tab 2' in 'AllValues' zusammenfassen
allValues.Clear();
allValues.Add(valuesTab1);
allValues.Add(valuesTab2);
return allValues;
}
}
}

View File

@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test_ChangeOrder
{
internal class MoveUp : MoveDown
{
protected override List<string> NewValues(List<string> valuesBefore, string selectedValue, List<string> valuesAfter)
{
List<string> newValue = new List<string>();
newValue.Clear();
for (int i = 0; i < valuesBefore.Count - 1; i++)
{
newValue.Add(valuesBefore[i]);
}
newValue.Add(selectedValue);
newValue.Add(valuesBefore[valuesBefore.Count - 1]);
newValue.AddRange(valuesAfter);
return newValue;
}
protected override bool ValidSelection(List<string> values, int selectedRow)
{
//Die ausgewählte Position muss min. 0 sein, weil sie sonst nicht nach vorne geschoben werden kann und
//die Position darf nicht größer als die max. Anzahl der Elemnte minus 1 sein
if (selectedRow > 0 && selectedRow < values.Count)
{
return true;
}
else
{
return false;
}
}
protected override void SetSelectedRow(int selectedRow)
{
SelectedRow = selectedRow - 1;
}
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test_ChangeOrder
{
internal static class Program
{
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("Test_ChangeOrder")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Test_ChangeOrder")]
[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("603ee8bf-85ac-4454-a8cb-82abb65671a5")]
// 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.*")]
//[assembly: AssemblyFileVersion("1.0.0.0")] //Wenn auskommentiert, dann gleich wie AssemblyVersion!

View File

@ -0,0 +1,71 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion: 4.0.30319.42000
//
// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn
// der Code neu generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test_ChangeOrder.Properties
{
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// Diese Klasse wurde von der StronglyTypedResourceBuilder-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 Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.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()
{
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Test_ChangeOrder.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -0,0 +1,30 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Test_ChangeOrder.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.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;
}
}
}
}

View File

@ -0,0 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View File

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Test_ChangeOrder
{
internal class RenameFiles
{
public List<string> Rename(List<string> files)
{
//Dateien nach dem verschieben umbenennen, damit die Nummer im Dateinamen mitder Reihung übereinstimmt
int number = 0;
string fileName = "";
//string tempFileName = "";
string file = "";
string path = "";
System.IO.File.Move(files[files.Count - 1], Path.GetDirectoryName(files[files.Count - 1]) + "\\" + Path.GetFileNameWithoutExtension(files[files.Count - 1]) + "_" + Path.GetExtension(files[files.Count - 1]));
for (int i = 0; i < files.Count; i++)
{
file = Path.GetFileName(files[i]);
path = Path.GetDirectoryName(files[i]);
number = Convert.ToInt32(file.Remove(file.IndexOf(" ")));
fileName = file.Remove(0, file.IndexOf(" "));
if (number != i + 1)
{
//Umbenennen
if (i + 1 < 10)
{
fileName = path + "\\0" + (i + 1).ToString() + fileName;
}
else
{
fileName = path + "\\" + (i + 1).ToString() + fileName;
}
try
{
if (i == files.Count - 1)
{
System.IO.File.Move(Path.GetDirectoryName(files[i]) + "\\" + Path.GetFileNameWithoutExtension(files[i]) + "_" + Path.GetExtension(files[i]), fileName); //Wenn der letzte Eintrag
}
else
{
System.IO.File.Move(files[i], fileName); //Alle, ausser dem letzten Eintrag
}
}
catch (Exception)
{
MessageBox.Show("Datei konnte nicht umbenannt werden.", "Fehler", MessageBoxButtons.OK);
}
files[i] = fileName;
}
}
for (int j = 0; j < files.Count - 1; j++)
{
if (Path.GetFileNameWithoutExtension(files[j]).EndsWith("_"))
{
files[j] = Path.GetDirectoryName(files[j]) + "\\" + Path.GetFileNameWithoutExtension(files[j]).Remove(Path.GetFileNameWithoutExtension(files[j]).Length - 1) + Path.GetExtension(files[j]);
}
}
return files;
}
}
}

View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{603EE8BF-85AC-4454-A8CB-82ABB65671A5}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Test_ChangeOrder</RootNamespace>
<AssemblyName>Test_ChangeOrder</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>false</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="MoveDown.cs" />
<Compile Include="MoveToTab.cs" />
<Compile Include="MoveUp.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RenameFiles.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Binary file not shown.

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>

Binary file not shown.

View File

@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]

View File

@ -0,0 +1 @@
970d88014ec018a1ab14fd9194c3b47cc394c6d5c48fecc9d1dc0517575f7d80

View File

@ -0,0 +1,10 @@
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.csproj.AssemblyReference.cache
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.Form1.resources
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.Properties.Resources.resources
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.csproj.GenerateResource.cache
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.csproj.CoreCompileInputs.cache
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\bin\Debug\Test_ChangeOrder.exe.config
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\bin\Debug\Test_ChangeOrder.exe
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\bin\Debug\Test_ChangeOrder.pdb
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.exe
C:\CAD\Git-WorkRepository\VisualStudio\_TEST\Test_ChangeOrder.git\Test_ChangeOrder\obj\Debug\Test_ChangeOrder.pdb

Binary file not shown.

Binary file not shown.