update 20240826
This commit is contained in:
@@ -55,17 +55,22 @@ namespace OnDoc.Diverses
|
||||
ext = System.IO.Path.GetExtension(file.Name);
|
||||
TreeNode tnnew = new TreeNode();
|
||||
tnnew.Text = file.Name;
|
||||
tnnew.Tag = file.FullName;
|
||||
tnnew.ImageIndex = 4;
|
||||
|
||||
if (ext.Length > 2)
|
||||
{
|
||||
ext = ext.Substring(0, 2).ToUpper();
|
||||
tnnew.ImageIndex = 4;
|
||||
tnnew.SelectedImageIndex = 4;
|
||||
if (ext == ".D") { tnnew.ImageIndex = 0; tnnew.SelectedImageIndex = 0; };
|
||||
if (ext == ".X") { tnnew.ImageIndex = 1; tnnew.SelectedImageIndex = 1; };
|
||||
if (ext == ".P") { tnnew.ImageIndex = 2; tnnew.SelectedImageIndex = 2; };
|
||||
}
|
||||
else
|
||||
{
|
||||
tnnew.ImageIndex = 3; tnnew.SelectedImageIndex = 3;
|
||||
tnnew.ImageIndex = 3; tnnew.SelectedImageIndex = 3;
|
||||
|
||||
}
|
||||
TreeNode treeNode = treeView.Nodes[0];
|
||||
treeNode.Nodes.Add(tnnew);
|
||||
@@ -89,18 +94,22 @@ namespace OnDoc.Diverses
|
||||
TreeNode tnnew = new TreeNode();
|
||||
tnnew.Text = file.Name;
|
||||
tnnew.Tag = file.FullName;
|
||||
tnnew.ImageIndex = 4;
|
||||
ext = System.IO.Path.GetExtension(tnnew.Text);
|
||||
if (ext.Length > 2)
|
||||
{
|
||||
ext = ext.Substring(0, 2).ToUpper();
|
||||
tnnew.ImageIndex = 4;
|
||||
tnnew.SelectedImageIndex = 4;
|
||||
|
||||
if (ext == ".D") { tnnew.ImageIndex = 0; tnnew.SelectedImageIndex = 0; };
|
||||
if (ext == ".X") { tnnew.ImageIndex = 1; tnnew.SelectedImageIndex = 1; };
|
||||
if (ext == ".P") { tnnew.ImageIndex = 2; tnnew.SelectedImageIndex = 2; };
|
||||
}
|
||||
else
|
||||
{
|
||||
tnnew.ImageIndex = 3; tnnew.SelectedImageIndex = 3;
|
||||
tnnew.Tag = "";
|
||||
tnnew.ImageIndex = 3; tnnew.SelectedImageIndex = 3;
|
||||
tnnew.Tag = "";
|
||||
}
|
||||
TreeNode tnnew2 = treeView.Nodes[0].Nodes[node.Index];
|
||||
tnnew2.Nodes.Add(tnnew);
|
||||
@@ -190,9 +199,25 @@ namespace OnDoc.Diverses
|
||||
if (ext.Length > 2)
|
||||
{
|
||||
ext = ext.Substring(0, 2).ToUpper();
|
||||
if (ext == ".D") { System.Diagnostics.Process.Start("winword.exe", " /t" + tempfilename); };
|
||||
if (ext == ".X") { System.Diagnostics.Process.Start("excel.exe", " /t " + tempfilename); };
|
||||
if (ext == ".P") { System.Diagnostics.Process.Start("POWERPNT.EXE", " /N " + tempfilename); };
|
||||
switch (ext)
|
||||
{
|
||||
case ".D":
|
||||
System.Diagnostics.Process.Start("winword.exe", " /t" + tempfilename);
|
||||
break;
|
||||
case ".X":
|
||||
System.Diagnostics.Process.Start("excel.exe", " /t " + tempfilename);
|
||||
break;
|
||||
case ".P":
|
||||
System.Diagnostics.Process.Start("POWERPNT.EXE", " /N " + tempfilename);
|
||||
break;
|
||||
default:
|
||||
string tempfilename1 = System.IO.Path.GetFileName(tempfilename);
|
||||
tempfilename1 = AppParams.tempdir+ "" + DateTime.Now.ToString("yyyyddmmhhMMss")+tempfilename1;
|
||||
System.IO.File.Copy(tempfilename,tempfilename1, true);
|
||||
Process.Start(tempfilename1);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user