20250216
This commit is contained in:
@@ -19,6 +19,7 @@ using Syncfusion.Compression.Zip;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Office.Interop.Word;
|
||||
using Syncfusion.Windows.Forms.HTMLUI;
|
||||
|
||||
namespace OnDoc.Diverses
|
||||
{
|
||||
@@ -56,33 +57,66 @@ namespace OnDoc.Diverses
|
||||
e.DrawDefault = true;
|
||||
}
|
||||
}
|
||||
public void PopulateTree(string dir, TreeNode node)
|
||||
{
|
||||
DirectoryInfo directory = new DirectoryInfo(dir);
|
||||
foreach (DirectoryInfo d in directory.GetDirectories())
|
||||
{
|
||||
TreeNode t = new TreeNode(d.Name);
|
||||
t.ImageIndex = 3;
|
||||
PopulateTree(d.FullName, t);
|
||||
node.Nodes.Add(t);
|
||||
}
|
||||
foreach (FileInfo f in directory.GetFiles())
|
||||
{
|
||||
TreeNode t = new TreeNode(f.Name);
|
||||
string ext = System.IO.Path.GetExtension(f.Name);
|
||||
ext = ext.Substring(0, 3).ToUpper();
|
||||
t.ImageIndex = 4;
|
||||
t.SelectedImageIndex = 4;
|
||||
if (ext == ".DO") { t.ImageIndex = 0; t.SelectedImageIndex = 0; };
|
||||
if (ext == ".XL") { t.ImageIndex = 1; t.SelectedImageIndex = 1; };
|
||||
if (ext == ".PP") { t.ImageIndex = 2; t.SelectedImageIndex = 2; };
|
||||
if (ext == ".PD") { t.ImageIndex = 5; t.SelectedImageIndex = 5; };
|
||||
t.Tag = f.FullName;
|
||||
node.Nodes.Add(t);
|
||||
}
|
||||
}
|
||||
|
||||
private void NativVorlagen_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
TreeNode root = new TreeNode();
|
||||
root.Text = "Vorlagen";
|
||||
root.ImageIndex = 3;
|
||||
root.SelectedImageIndex = 3;
|
||||
treeView.Nodes.Add(root);
|
||||
PopulateTree(AppParams.pathNativVorlagen, root);
|
||||
treeView.Nodes[0].Expand();
|
||||
return;
|
||||
string line = "";
|
||||
int i = 1;
|
||||
StreamReader sr = new StreamReader(AppParams.pathNativVorlagen+@"\klassifizierung.txt");
|
||||
line = sr.ReadLine();
|
||||
while (line != null)
|
||||
{
|
||||
RadioButton rb = new RadioButton();
|
||||
rb.Name = "rb"+i.ToString();
|
||||
rb.Text = line;
|
||||
rb.Left = label1.Left;
|
||||
rb.Top = label1.Top + (i*25);
|
||||
rb.Width = 180;
|
||||
i++;
|
||||
this.Controls.Add(rb);
|
||||
line = sr.ReadLine();
|
||||
}
|
||||
sr.Close();
|
||||
TotalKlassifizierung = i - 1;
|
||||
try
|
||||
{
|
||||
RadioButton rb = this.Controls.Find("rb1", true).FirstOrDefault() as RadioButton;
|
||||
rb.Checked = true;
|
||||
}
|
||||
catch { }
|
||||
//StreamReader sr = new StreamReader(AppParams.pathNativVorlagen+@"\klassifizierung.txt");
|
||||
//line = sr.ReadLine();
|
||||
//while (line != null)
|
||||
//{
|
||||
// RadioButton rb = new RadioButton();
|
||||
// rb.Name = "rb"+i.ToString();
|
||||
// rb.Text = line;
|
||||
// rb.Left = label1.Left;
|
||||
// rb.Top = label1.Top + (i*25);
|
||||
// rb.Width = 180;
|
||||
// i++;
|
||||
// this.Controls.Add(rb);
|
||||
// line = sr.ReadLine();
|
||||
//}
|
||||
//sr.Close();
|
||||
//TotalKlassifizierung = i - 1;
|
||||
//try
|
||||
//{
|
||||
// RadioButton rb = this.Controls.Find("rb1", true).FirstOrDefault() as RadioButton;
|
||||
// rb.Checked = true;
|
||||
//}
|
||||
//catch { }
|
||||
|
||||
string ext = "";
|
||||
DirectoryInfo directoryInfo = new DirectoryInfo(AppParams.pathNativVorlagen);
|
||||
@@ -90,7 +124,7 @@ namespace OnDoc.Diverses
|
||||
{
|
||||
try
|
||||
{
|
||||
TreeNode root = new TreeNode();
|
||||
TreeNode root1 = new TreeNode();
|
||||
root.Text = "Vorlagen";
|
||||
root.ImageIndex = 3;
|
||||
root.SelectedImageIndex = 3;
|
||||
@@ -274,7 +308,8 @@ namespace OnDoc.Diverses
|
||||
switch (ext)
|
||||
{
|
||||
case ".DO":
|
||||
System.Diagnostics.Process.Start("winword.exe", " /t" + tempfilename);
|
||||
System.Diagnostics.Process.Start("winword.exe", "/t" + tempfilename);
|
||||
//MessageBox.Show(tempfilename);
|
||||
break;
|
||||
case ".XL":
|
||||
System.Diagnostics.Process.Start("excel.exe", " /t " + tempfilename);
|
||||
|
||||
Reference in New Issue
Block a user