Compare commits
11 Commits
688652a703
...
02-28-a
| Author | SHA1 | Date | |
|---|---|---|---|
| e66eea0c83 | |||
| 3044da0413 | |||
| 7cb819d401 | |||
| b3476e455a | |||
| a68b36c02e | |||
| 87914ff327 | |||
| 1726eb9301 | |||
| 8156351973 | |||
| fa80b22ad0 | |||
| 2ef355bb2d | |||
| a622e419a1 |
1
.vscode/format-report.json
vendored
Normal file
1
.vscode/format-report.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[]
|
||||
19
.vscode/launch.json
vendored
Normal file
19
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "node Launch Current Opened File",
|
||||
"program": "${file}"
|
||||
}
|
||||
]
|
||||
}
|
||||
31
.vscode/mklink.md
vendored
Normal file
31
.vscode/mklink.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
type: "note"
|
||||
created: "2023-10-20T03:53:13.742Z"
|
||||
updated: "2023-10-20T04:00:37.259Z"
|
||||
---
|
||||
|
||||
# mklink
|
||||
|
||||
```bash
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.kanbn" "D:\5-Other-Small\Kanban\File-Folder-Helper"
|
||||
```
|
||||
|
||||
```bash
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.kanbn" "D:\5-Other-Small\Kanban\File-Folder-Helper"
|
||||
```
|
||||
|
||||
```bash
|
||||
del "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode"
|
||||
del "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode-oss"
|
||||
del "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode-insiders"
|
||||
mkdir "C:\Users\phares\.vscode\extensions\ifx.type-script-helper-1.111.0\net8.0\win-x64\publish"
|
||||
mkdir "C:\Users\phares\.vscode-oss\extensions\ifx.type-script-helper-1.111.0\net8.0\win-x64\publish"
|
||||
mkdir "C:\Users\phares\.vscode-insiders\extensions\ifx.type-script-helper-1.111.0\net8.0\win-x64\publish"
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode" "C:\Users\phares\.vscode\extensions\ifx.type-script-helper-1.111.0"
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode-oss" "C:\Users\phares\.vscode-oss\extensions\ifx.type-script-helper-1.111.0"
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.extensions-vscode-insiders" "C:\Users\phares\.vscode-insiders\extensions\ifx.type-script-helper-1.111.0"
|
||||
```
|
||||
|
||||
```bash Thu Jul 18 2024 13:47:40 GMT-0700 (Mountain Standard Time)
|
||||
mklink /J "L:\DevOps\Mesa_FI\File-Folder-Helper\.vscode\.UserSecrets" "C:\Users\phares\AppData\Roaming\Microsoft\UserSecrets\8da397d4-13ec-4576-9722-3c79cad25563"
|
||||
```
|
||||
20
.vscode/settings.json
vendored
Normal file
20
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"[markdown]": {
|
||||
"editor.wordWrap": "off"
|
||||
},
|
||||
"cSpell.words": [
|
||||
"Amstrad",
|
||||
"doesnt",
|
||||
"dont",
|
||||
"Doubleclick",
|
||||
"Finalizers",
|
||||
"harddrive",
|
||||
"propval",
|
||||
"propvals",
|
||||
"refrences",
|
||||
"SETTINGSROOT",
|
||||
"subdirs",
|
||||
"subfolders",
|
||||
"treeview"
|
||||
]
|
||||
}
|
||||
163
.vscode/tasks.json
vendored
Normal file
163
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,163 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "User Secrets Init",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"user-secrets",
|
||||
"-p",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"init"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "User Secrets Set",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"user-secrets",
|
||||
"-p",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"set",
|
||||
"_UserSecretsId",
|
||||
"0c43f9aa-96e9-4298-967c-ed069d79e262"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Format",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"format",
|
||||
"--report",
|
||||
".vscode",
|
||||
"--verbosity",
|
||||
"detailed",
|
||||
"--severity",
|
||||
"warn"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Format-Whitespaces",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"format",
|
||||
"whitespace"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"-r",
|
||||
"win-x64",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "build Linux",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"-r",
|
||||
"linux-x64",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/Snap2HTML.sln"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Publish AOT",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"-r",
|
||||
"win-x64",
|
||||
"-c",
|
||||
"Release",
|
||||
"-p:PublishAot=true",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Publish AOT Linux",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"-r",
|
||||
"linux-x64",
|
||||
"-c",
|
||||
"Release",
|
||||
"-p:PublishAot=true",
|
||||
"${workspaceFolder}/Snap2HTML.sln",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "MSBuild for EAF Deployment Packages",
|
||||
"command": "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"/target:Build",
|
||||
"/restore:True",
|
||||
"/p:RestoreSources=https://artifactory.intra.infineon.com/artifactory/api/nuget/ngt-fi-package-main-vir/%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF/nuget/v3/index.json%3Bhttps://tfs.intra.infineon.com/tfs/FactoryIntegration/_packaging/EAF%40Local/nuget/v3/index.json%3Bhttps://api.nuget.org/v3/index.json",
|
||||
"/detailedsummary",
|
||||
"/consoleloggerparameters:PerformanceSummary;ErrorsOnly;",
|
||||
"/property:Configuration=Debug;TargetFrameworkVersion=v4.8",
|
||||
"Snap2HTML.sln"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "Jest",
|
||||
"type": "shell",
|
||||
"command": "npx jest",
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -118,9 +118,9 @@ namespace CommandLine.Utility
|
||||
//Because of the split index 0 will be a empty string
|
||||
string valuesWithoutQuotes = RemoveMatchingQuotes(parts[2]);
|
||||
|
||||
// MOD: Don't split on commas
|
||||
// MOD: Don't split on commas
|
||||
//AddListValues(parts[1], valuesWithoutQuotes.Split(','));
|
||||
Add( parts[1], valuesWithoutQuotes );
|
||||
Add(parts[1], valuesWithoutQuotes);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,63 +5,91 @@ using System.Text;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
public class SnapSettings
|
||||
{
|
||||
public string rootFolder { get; set; }
|
||||
public string title { get; set; }
|
||||
public string outputFile { get; set; }
|
||||
public bool skipHiddenItems { get; set; }
|
||||
public bool skipSystemItems { get; set; }
|
||||
public bool openInBrowser { get; set; }
|
||||
public bool linkFiles { get; set; }
|
||||
public string linkRoot { get; set; }
|
||||
}
|
||||
public class SnapSettings
|
||||
{
|
||||
public string rootFolder { get; set; }
|
||||
public string title { get; set; }
|
||||
public string outputFile { get; set; }
|
||||
public bool skipHiddenItems { get; set; }
|
||||
public bool skipSystemItems { get; set; }
|
||||
public bool openInBrowser { get; set; }
|
||||
public bool linkFiles { get; set; }
|
||||
public string linkRoot { get; set; }
|
||||
|
||||
public SnapSettings()
|
||||
{
|
||||
this.skipHiddenItems = true;
|
||||
this.skipSystemItems = true;
|
||||
this.openInBrowser = false;
|
||||
this.linkFiles = false;
|
||||
this.linkRoot = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class SnappedFile
|
||||
{
|
||||
public SnappedFile( string name )
|
||||
{
|
||||
this.Name = name;
|
||||
this.Properties = new Dictionary<string, string>();
|
||||
}
|
||||
public class SnappedFile
|
||||
{
|
||||
public SnappedFile(string name)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Properties = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
public string Name { get; set; }
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
|
||||
public string GetProp( string key )
|
||||
{
|
||||
if( this.Properties.ContainsKey( key ) )
|
||||
return this.Properties[key];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
public string GetProp(string key)
|
||||
{
|
||||
if (this.Properties.ContainsKey(key))
|
||||
return this.Properties[key];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class SnappedFolder
|
||||
{
|
||||
public SnappedFolder( string name, string path )
|
||||
{
|
||||
this.Name = name;
|
||||
this.Path = path;
|
||||
this.Properties = new Dictionary<string, string>();
|
||||
this.Files = new List<SnappedFile>();
|
||||
this.FullPath = ( this.Path + "\\" + this.Name ).Replace( "\\\\", "\\" );
|
||||
}
|
||||
public class SnappedFolder
|
||||
{
|
||||
public SnappedFolder(string name, string path)
|
||||
{
|
||||
this.Name = name;
|
||||
this.Path = path;
|
||||
this.Properties = new Dictionary<string, string>();
|
||||
this.Files = new List<SnappedFile>();
|
||||
}
|
||||
|
||||
public string Name { get; set; }
|
||||
public string Path { get; set; }
|
||||
public string FullPath { get; set; }
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
public List<SnappedFile> Files { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Path { get; set; }
|
||||
public Dictionary<string, string> Properties { get; set; }
|
||||
public List<SnappedFile> Files { get; set; }
|
||||
|
||||
public string GetProp( string key )
|
||||
{
|
||||
if( this.Properties.ContainsKey( key ) )
|
||||
return this.Properties[key];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
public string GetFullPath()
|
||||
{
|
||||
string path;
|
||||
|
||||
if (this.Path.EndsWith(@"\"))
|
||||
path = this.Path + this.Name;
|
||||
else
|
||||
path = this.Path + @"\" + this.Name;
|
||||
|
||||
if (path.EndsWith(@"\")) // remove trailing backslash
|
||||
{
|
||||
if (!Utils.IsWildcardMatch(@"?:\", path, false)) // except for drive letters
|
||||
{
|
||||
path = path.Remove(path.Length - 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
public string GetProp(string key)
|
||||
{
|
||||
if (this.Properties.ContainsKey(key))
|
||||
return this.Properties[key];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,198 +4,240 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Specialized;
|
||||
using System.Configuration;
|
||||
using System.Configuration.Provider;
|
||||
using System.Windows.Forms;
|
||||
using System.Collections.Specialized;
|
||||
using Microsoft.Win32;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
|
||||
public class PortableSettingsProvider : SettingsProvider {
|
||||
|
||||
const string SETTINGSROOT = "Settings";
|
||||
//XML Root Node
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using Microsoft.Win32;
|
||||
|
||||
public override void Initialize(string name, NameValueCollection col) {
|
||||
base.Initialize(this.ApplicationName, col);
|
||||
}
|
||||
|
||||
public override string ApplicationName {
|
||||
get {
|
||||
if (Application.ProductName.Trim().Length > 0) {
|
||||
return Application.ProductName;
|
||||
}
|
||||
else {
|
||||
FileInfo fi = new FileInfo(Application.ExecutablePath);
|
||||
return fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
|
||||
}
|
||||
public class PortableSettingsProvider : SettingsProvider
|
||||
{
|
||||
|
||||
const string SETTINGSROOT = "Settings";
|
||||
//XML Root Node
|
||||
|
||||
public override void Initialize(string name, NameValueCollection col)
|
||||
{
|
||||
base.Initialize(this.ApplicationName, col);
|
||||
}
|
||||
set { }
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
get { return "PortableSettingsProvider"; }
|
||||
}
|
||||
public virtual string GetAppSettingsPath() {
|
||||
//Used to determine where to store the settings
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(Application.ExecutablePath);
|
||||
return fi.DirectoryName;
|
||||
}
|
||||
|
||||
public virtual string GetAppSettingsFilename() {
|
||||
//Used to determine the filename to store the settings
|
||||
return ApplicationName + ".settings";
|
||||
}
|
||||
|
||||
public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection propvals) {
|
||||
//Iterate through the settings to be stored
|
||||
//Only dirty settings are included in propvals, and only ones relevant to this provider
|
||||
foreach (SettingsPropertyValue propval in propvals) {
|
||||
SetValue(propval);
|
||||
}
|
||||
|
||||
try {
|
||||
SettingsXML.Save(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
}
|
||||
//Ignore if cant save, device been ejected
|
||||
}
|
||||
|
||||
public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection props) {
|
||||
//Create new collection of values
|
||||
SettingsPropertyValueCollection values = new SettingsPropertyValueCollection();
|
||||
|
||||
//Iterate through the settings to be retrieved
|
||||
foreach (SettingsProperty setting in props) {
|
||||
|
||||
SettingsPropertyValue value = new SettingsPropertyValue(setting);
|
||||
value.IsDirty = false;
|
||||
value.SerializedValue = GetValue(setting);
|
||||
values.Add(value);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
private XmlDocument _settingsXML = null;
|
||||
|
||||
private XmlDocument SettingsXML {
|
||||
get {
|
||||
//If we dont hold an xml document, try opening one.
|
||||
//If it doesnt exist then create a new one ready.
|
||||
if (_settingsXML == null) {
|
||||
_settingsXML = new XmlDocument();
|
||||
|
||||
try {
|
||||
_settingsXML.Load(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
|
||||
public override string ApplicationName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Application.ProductName.Trim().Length > 0)
|
||||
{
|
||||
return Application.ProductName;
|
||||
}
|
||||
else
|
||||
{
|
||||
FileInfo fi = new FileInfo(Application.ExecutablePath);
|
||||
return fi.Name.Substring(0, fi.Name.Length - fi.Extension.Length);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
//Create new document
|
||||
XmlDeclaration dec = _settingsXML.CreateXmlDeclaration("1.0", "utf-8", string.Empty);
|
||||
_settingsXML.AppendChild(dec);
|
||||
|
||||
XmlNode nodeRoot = default(XmlNode);
|
||||
|
||||
nodeRoot = _settingsXML.CreateNode(XmlNodeType.Element, SETTINGSROOT, "");
|
||||
_settingsXML.AppendChild(nodeRoot);
|
||||
set { }
|
||||
//Do nothing
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "PortableSettingsProvider"; }
|
||||
}
|
||||
public virtual string GetAppSettingsPath()
|
||||
{
|
||||
//Used to determine where to store the settings
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(Application.ExecutablePath);
|
||||
return fi.DirectoryName;
|
||||
}
|
||||
|
||||
public virtual string GetAppSettingsFilename()
|
||||
{
|
||||
//Used to determine the filename to store the settings
|
||||
return ApplicationName + ".settings";
|
||||
}
|
||||
|
||||
public override void SetPropertyValues(SettingsContext context, SettingsPropertyValueCollection propvals)
|
||||
{
|
||||
//Iterate through the settings to be stored
|
||||
//Only dirty settings are included in propvals, and only ones relevant to this provider
|
||||
foreach (SettingsPropertyValue propval in propvals)
|
||||
{
|
||||
SetValue(propval);
|
||||
}
|
||||
}
|
||||
|
||||
return _settingsXML;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetValue(SettingsProperty setting) {
|
||||
string ret = "";
|
||||
|
||||
try {
|
||||
if (IsRoaming(setting)) {
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + setting.Name).InnerText;
|
||||
}
|
||||
else {
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + setting.Name).InnerText;
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception ex) {
|
||||
if ((setting.DefaultValue != null)) {
|
||||
ret = setting.DefaultValue.ToString();
|
||||
}
|
||||
else {
|
||||
ret = "";
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SetValue(SettingsPropertyValue propVal) {
|
||||
|
||||
XmlElement MachineNode = default(XmlElement);
|
||||
XmlElement SettingNode = default(XmlElement);
|
||||
|
||||
//Determine if the setting is roaming.
|
||||
//If roaming then the value is stored as an element under the root
|
||||
//Otherwise it is stored under a machine name node
|
||||
try {
|
||||
if (IsRoaming(propVal.Property)) {
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + propVal.Name);
|
||||
}
|
||||
else {
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + propVal.Name);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
SettingNode = null;
|
||||
}
|
||||
|
||||
//Check to see if the node exists, if so then set its new value
|
||||
if ((SettingNode != null)) {
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
}
|
||||
else {
|
||||
if (IsRoaming(propVal.Property)) {
|
||||
//Store the value as an element of the Settings Root Node
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(SettingNode);
|
||||
}
|
||||
else {
|
||||
//Its machine specific, store as an element of the machine name node,
|
||||
//creating a new machine name node if one doesnt exist.
|
||||
try {
|
||||
|
||||
MachineNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName);
|
||||
|
||||
try
|
||||
{
|
||||
SettingsXML.Save(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
}
|
||||
catch (Exception ex) {
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
if (MachineNode == null) {
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
//Ignore if cant save, device been ejected
|
||||
}
|
||||
|
||||
public override SettingsPropertyValueCollection GetPropertyValues(SettingsContext context, SettingsPropertyCollection props)
|
||||
{
|
||||
//Create new collection of values
|
||||
SettingsPropertyValueCollection values = new SettingsPropertyValueCollection();
|
||||
|
||||
//Iterate through the settings to be retrieved
|
||||
foreach (SettingsProperty setting in props)
|
||||
{
|
||||
|
||||
SettingsPropertyValue value = new SettingsPropertyValue(setting);
|
||||
value.IsDirty = false;
|
||||
value.SerializedValue = GetValue(setting);
|
||||
values.Add(value);
|
||||
}
|
||||
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
MachineNode.AppendChild(SettingNode);
|
||||
}
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsRoaming(SettingsProperty prop) {
|
||||
//Determine if the setting is marked as Roaming
|
||||
foreach (DictionaryEntry d in prop.Attributes) {
|
||||
Attribute a = (Attribute)d.Value;
|
||||
if (a is System.Configuration.SettingsManageabilityAttribute) {
|
||||
return true;
|
||||
}
|
||||
|
||||
private XmlDocument _settingsXML = null;
|
||||
|
||||
private XmlDocument SettingsXML
|
||||
{
|
||||
get
|
||||
{
|
||||
//If we dont hold an xml document, try opening one.
|
||||
//If it doesnt exist then create a new one ready.
|
||||
if (_settingsXML == null)
|
||||
{
|
||||
_settingsXML = new XmlDocument();
|
||||
|
||||
try
|
||||
{
|
||||
_settingsXML.Load(Path.Combine(GetAppSettingsPath(), GetAppSettingsFilename()));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Create new document
|
||||
XmlDeclaration dec = _settingsXML.CreateXmlDeclaration("1.0", "utf-8", string.Empty);
|
||||
_settingsXML.AppendChild(dec);
|
||||
|
||||
XmlNode nodeRoot = default(XmlNode);
|
||||
|
||||
nodeRoot = _settingsXML.CreateNode(XmlNodeType.Element, SETTINGSROOT, "");
|
||||
_settingsXML.AppendChild(nodeRoot);
|
||||
}
|
||||
}
|
||||
|
||||
return _settingsXML;
|
||||
}
|
||||
}
|
||||
|
||||
private string GetValue(SettingsProperty setting)
|
||||
{
|
||||
string ret = "";
|
||||
|
||||
try
|
||||
{
|
||||
if (IsRoaming(setting))
|
||||
{
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + setting.Name).InnerText;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + setting.Name).InnerText;
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
if ((setting.DefaultValue != null))
|
||||
{
|
||||
ret = setting.DefaultValue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = "";
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void SetValue(SettingsPropertyValue propVal)
|
||||
{
|
||||
|
||||
XmlElement MachineNode = default(XmlElement);
|
||||
XmlElement SettingNode = default(XmlElement);
|
||||
|
||||
//Determine if the setting is roaming.
|
||||
//If roaming then the value is stored as an element under the root
|
||||
//Otherwise it is stored under a machine name node
|
||||
try
|
||||
{
|
||||
if (IsRoaming(propVal.Property))
|
||||
{
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + propVal.Name);
|
||||
}
|
||||
else
|
||||
{
|
||||
SettingNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName + "/" + propVal.Name);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
SettingNode = null;
|
||||
}
|
||||
|
||||
//Check to see if the node exists, if so then set its new value
|
||||
if ((SettingNode != null))
|
||||
{
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsRoaming(propVal.Property))
|
||||
{
|
||||
//Store the value as an element of the Settings Root Node
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(SettingNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Its machine specific, store as an element of the machine name node,
|
||||
//creating a new machine name node if one doesnt exist.
|
||||
try
|
||||
{
|
||||
|
||||
MachineNode = (XmlElement)SettingsXML.SelectSingleNode(SETTINGSROOT + "/" + Environment.MachineName);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
}
|
||||
|
||||
if (MachineNode == null)
|
||||
{
|
||||
MachineNode = SettingsXML.CreateElement(Environment.MachineName);
|
||||
SettingsXML.SelectSingleNode(SETTINGSROOT).AppendChild(MachineNode);
|
||||
}
|
||||
|
||||
SettingNode = SettingsXML.CreateElement(propVal.Name);
|
||||
SettingNode.InnerText = propVal.SerializedValue.ToString();
|
||||
MachineNode.AppendChild(SettingNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsRoaming(SettingsProperty prop)
|
||||
{
|
||||
//Determine if the setting is marked as Roaming
|
||||
foreach (DictionaryEntry d in prop.Attributes)
|
||||
{
|
||||
Attribute a = (Attribute)d.Value;
|
||||
if (a is System.Configuration.SettingsManageabilityAttribute)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ using System.Runtime.InteropServices;
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("RL Vision")]
|
||||
[assembly: AssemblyProduct("Snap2HTML")]
|
||||
[assembly: AssemblyCopyright( "Copyright © RL Vision 2011-2020" )]
|
||||
[assembly: AssemblyCopyright("Copyright © RL Vision 2011-2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion( "2.11.0.0" )]
|
||||
[assembly: AssemblyFileVersion( "2.11.0.0" )]
|
||||
[assembly: AssemblyVersion("2.14.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.14.0.0")]
|
||||
|
||||
@ -99,9 +99,9 @@
|
||||
Starts the program with the given root path already set
|
||||
|
||||
|
||||
Full: Snap2HTMl.exe [-path:"root folder path"] [-outfile:"filename"]
|
||||
Full: Snap2HTMl.exe -path:"root folder path" -outfile:"filename"
|
||||
[-link:"link to path"] [-title:"page title"]
|
||||
[-hidden] [-system]
|
||||
[-hidden] [-system] [-silent]
|
||||
|
||||
-path:"root folder path" - The root path to load.
|
||||
Example: -path:"c:\temp"
|
||||
@ -113,23 +113,26 @@
|
||||
-link:"link to path" - The path to link files to.
|
||||
Example: -link:"c:\temp"
|
||||
|
||||
-title:"page title" - Set the page title
|
||||
-title:"page title" - Set the page title. If omitted, title
|
||||
is generated based on path.
|
||||
|
||||
-hidden - Include hidden items
|
||||
|
||||
-hidden - Include hidden items
|
||||
|
||||
-system - Include system items
|
||||
|
||||
-silent - Run without showing the window (only
|
||||
if both -path and -outfile are used)
|
||||
|
||||
|
||||
Notes: Using -path and -outfile will cause the program to automatically
|
||||
start generating the snapshot, and quit when done!
|
||||
Notes: When both -path and -outfile are specified, the program will
|
||||
automatically start generating the snapshot, and quit when done.
|
||||
|
||||
Always surround paths and filenames with quotes ("")!
|
||||
|
||||
Do not include the [sqaure brackets] when you write your command
|
||||
line. (Sqaure brackets signify optional command line parameters)
|
||||
In silent mode, in case or error the program will just quit
|
||||
without telling why.
|
||||
|
||||
Do not include the [square brackets] when you write your command
|
||||
line. (Square brackets signify optional command line parameters)
|
||||
|
||||
|
||||
--- Template Design ---------------------------------------------------------
|
||||
@ -229,6 +232,20 @@
|
||||
v2.11 (2020-04-18)
|
||||
Fixed a threading issue that caused the program to hang on some systems
|
||||
|
||||
v2.12 (2020-04-29)
|
||||
Reduced memory consumption when generating HTML
|
||||
Parent folder link [..] is now sticky
|
||||
Reworked command line code to fix issues in 2.11
|
||||
A few small tweaks too
|
||||
|
||||
v2.13 (2020-05-05)
|
||||
Fixed an encoding issue causing EncoderFallbackException while saving
|
||||
|
||||
v2.14 (2020-08-09)
|
||||
UNC paths work again (including linking)
|
||||
Searches returning lots of items should be a bit faster now
|
||||
And a few smaller fixes as usual
|
||||
|
||||
|
||||
--- End User License Agreement -----------------------------------------------
|
||||
|
||||
|
||||
@ -1,36 +1,37 @@
|
||||
namespace Snap2HTML.Properties {
|
||||
namespace Snap2HTML.Properties
|
||||
{
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Settings
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
internal sealed partial class Settings
|
||||
{
|
||||
public Settings()
|
||||
{
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
|
||||
this.SettingsLoaded += this.SettingsLoadedEventHandler;
|
||||
}
|
||||
this.SettingsLoaded += this.SettingsLoadedEventHandler;
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler( object sender, System.Configuration.SettingChangingEventArgs e )
|
||||
{
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
|
||||
{
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler( object sender, System.ComponentModel.CancelEventArgs e )
|
||||
{
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
System.Console.WriteLine( "Settings Saving..." );
|
||||
}
|
||||
private void SettingsLoadedEventHandler( object sender, System.Configuration.SettingsLoadedEventArgs e )
|
||||
{
|
||||
System.Console.WriteLine( "Settings Loaded..." );
|
||||
}
|
||||
}
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
System.Console.WriteLine("Settings Saving...");
|
||||
}
|
||||
private void SettingsLoadedEventHandler(object sender, System.Configuration.SettingsLoadedEventArgs e)
|
||||
{
|
||||
System.Console.WriteLine("Settings Loaded...");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,80 +11,80 @@ using System.Diagnostics;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
class Utils
|
||||
{
|
||||
// Hack to sort folders correctly even if they have spaces/periods in them
|
||||
public static List<string> SortDirList( List<string> lstDirs )
|
||||
{
|
||||
for( int n = 0; n < lstDirs.Count; n++ )
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace( " ", "1|1" );
|
||||
lstDirs[n] = lstDirs[n].Replace( ".", "2|2" );
|
||||
}
|
||||
lstDirs.Sort();
|
||||
for( int n = 0; n < lstDirs.Count; n++ )
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace( "1|1", " " );
|
||||
lstDirs[n] = lstDirs[n].Replace( "2|2", "." );
|
||||
}
|
||||
return lstDirs;
|
||||
}
|
||||
class Utils
|
||||
{
|
||||
// Hack to sort folders correctly even if they have spaces/periods in them
|
||||
public static List<string> SortDirList(List<string> lstDirs)
|
||||
{
|
||||
for (int n = 0; n < lstDirs.Count; n++)
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace(" ", "1|1");
|
||||
lstDirs[n] = lstDirs[n].Replace(".", "2|2");
|
||||
}
|
||||
lstDirs.Sort();
|
||||
for (int n = 0; n < lstDirs.Count; n++)
|
||||
{
|
||||
lstDirs[n] = lstDirs[n].Replace("1|1", " ");
|
||||
lstDirs[n] = lstDirs[n].Replace("2|2", ".");
|
||||
}
|
||||
return lstDirs;
|
||||
}
|
||||
|
||||
// Replaces characters that may appear in filenames/paths that have special meaning to JavaScript
|
||||
// Info on u2028/u2029: https://en.wikipedia.org/wiki/Newline#Unicode
|
||||
public static string MakeCleanJsString( string s )
|
||||
{
|
||||
return s.Replace( "\\", "\\\\" )
|
||||
.Replace( "&", "&" )
|
||||
.Replace( "\u2028", "" )
|
||||
.Replace( "\u2029", "" )
|
||||
.Replace( "\u0004", "" );
|
||||
}
|
||||
// Replaces characters that may appear in filenames/paths that have special meaning to JavaScript
|
||||
// Info on u2028/u2029: https://en.wikipedia.org/wiki/Newline#Unicode
|
||||
public static string MakeCleanJsString(string s)
|
||||
{
|
||||
return s.Replace("\\", "\\\\")
|
||||
.Replace("&", "&")
|
||||
.Replace("\u2028", "")
|
||||
.Replace("\u2029", "")
|
||||
.Replace("\u0004", "");
|
||||
}
|
||||
|
||||
// Test string for matches against a wildcard pattern. Use ? and * as wildcards. (Wrapper around RegEx)
|
||||
public static bool IsWildcardMatch( String wildcard, String text, bool casesensitive )
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder( wildcard.Length + 10 );
|
||||
sb.Append( "^" );
|
||||
for( int i = 0; i < wildcard.Length; i++ )
|
||||
{
|
||||
char c = wildcard[i];
|
||||
switch( c )
|
||||
{
|
||||
case '*':
|
||||
sb.Append( ".*" );
|
||||
break;
|
||||
case '?':
|
||||
sb.Append( "." );
|
||||
break;
|
||||
default:
|
||||
sb.Append( System.Text.RegularExpressions.Regex.Escape( wildcard[i].ToString() ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
sb.Append( "$" );
|
||||
System.Text.RegularExpressions.Regex regex;
|
||||
if( casesensitive )
|
||||
regex = new System.Text.RegularExpressions.Regex( sb.ToString(), System.Text.RegularExpressions.RegexOptions.None );
|
||||
else
|
||||
regex = new System.Text.RegularExpressions.Regex( sb.ToString(), System.Text.RegularExpressions.RegexOptions.IgnoreCase );
|
||||
// Test string for matches against a wildcard pattern. Use ? and * as wildcards. (Wrapper around RegEx)
|
||||
public static bool IsWildcardMatch(String wildcard, String text, bool casesensitive)
|
||||
{
|
||||
System.Text.StringBuilder sb = new System.Text.StringBuilder(wildcard.Length + 10);
|
||||
sb.Append("^");
|
||||
for (int i = 0; i < wildcard.Length; i++)
|
||||
{
|
||||
char c = wildcard[i];
|
||||
switch (c)
|
||||
{
|
||||
case '*':
|
||||
sb.Append(".*");
|
||||
break;
|
||||
case '?':
|
||||
sb.Append(".");
|
||||
break;
|
||||
default:
|
||||
sb.Append(System.Text.RegularExpressions.Regex.Escape(wildcard[i].ToString()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
sb.Append("$");
|
||||
System.Text.RegularExpressions.Regex regex;
|
||||
if (casesensitive)
|
||||
regex = new System.Text.RegularExpressions.Regex(sb.ToString(), System.Text.RegularExpressions.RegexOptions.None);
|
||||
else
|
||||
regex = new System.Text.RegularExpressions.Regex(sb.ToString(), System.Text.RegularExpressions.RegexOptions.IgnoreCase);
|
||||
|
||||
return regex.IsMatch( text );
|
||||
}
|
||||
return regex.IsMatch(text);
|
||||
}
|
||||
|
||||
public static int ToUnixTimestamp( DateTime value )
|
||||
{
|
||||
return (int)Math.Truncate( ( value.ToUniversalTime().Subtract( new DateTime( 1970, 1, 1 ) ) ).TotalSeconds );
|
||||
}
|
||||
public static int ToUnixTimestamp(DateTime value)
|
||||
{
|
||||
return (int)Math.Truncate((value.ToUniversalTime().Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
|
||||
}
|
||||
|
||||
public static long ParseLong(string s)
|
||||
{
|
||||
long num;
|
||||
if( Int64.TryParse( s, out num ) )
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static long ParseLong(string s)
|
||||
{
|
||||
long num;
|
||||
if (Int64.TryParse(s, out num))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
53
Snap2HTML/frmMain.Designer.cs
generated
53
Snap2HTML/frmMain.Designer.cs
generated
@ -54,6 +54,7 @@
|
||||
this.pictureBox4 = new System.Windows.Forms.PictureBox();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.tabPage2 = new System.Windows.Forms.TabPage();
|
||||
this.pictureBoxDonate = new System.Windows.Forms.PictureBox();
|
||||
this.groupBoxMoreApps = new System.Windows.Forms.GroupBox();
|
||||
this.label33 = new System.Windows.Forms.Label();
|
||||
this.label32 = new System.Windows.Forms.Label();
|
||||
@ -78,6 +79,7 @@
|
||||
this.tabPage3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
|
||||
this.tabPage2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxDonate)).BeginInit();
|
||||
this.groupBoxMoreApps.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
|
||||
@ -354,6 +356,7 @@
|
||||
//
|
||||
// tabPage2
|
||||
//
|
||||
this.tabPage2.Controls.Add(this.pictureBoxDonate);
|
||||
this.tabPage2.Controls.Add(this.groupBoxMoreApps);
|
||||
this.tabPage2.Controls.Add(this.pictureBox1);
|
||||
this.tabPage2.Controls.Add(this.linkLabel1);
|
||||
@ -368,6 +371,18 @@
|
||||
this.tabPage2.Text = "About";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pictureBoxDonate
|
||||
//
|
||||
this.pictureBoxDonate.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.pictureBoxDonate.Image = ((System.Drawing.Image)(resources.GetObject("pictureBoxDonate.Image")));
|
||||
this.pictureBoxDonate.Location = new System.Drawing.Point(193, 132);
|
||||
this.pictureBoxDonate.Name = "pictureBoxDonate";
|
||||
this.pictureBoxDonate.Size = new System.Drawing.Size(74, 21);
|
||||
this.pictureBoxDonate.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBoxDonate.TabIndex = 6;
|
||||
this.pictureBoxDonate.TabStop = false;
|
||||
this.pictureBoxDonate.Click += new System.EventHandler(this.pictureBoxDonate_Click);
|
||||
//
|
||||
// groupBoxMoreApps
|
||||
//
|
||||
this.groupBoxMoreApps.Controls.Add(this.label33);
|
||||
@ -378,9 +393,9 @@
|
||||
this.groupBoxMoreApps.Controls.Add(this.label11);
|
||||
this.groupBoxMoreApps.Controls.Add(this.pictureBox3);
|
||||
this.groupBoxMoreApps.Controls.Add(this.pictureBox2);
|
||||
this.groupBoxMoreApps.Location = new System.Drawing.Point(6, 174);
|
||||
this.groupBoxMoreApps.Location = new System.Drawing.Point(6, 176);
|
||||
this.groupBoxMoreApps.Name = "groupBoxMoreApps";
|
||||
this.groupBoxMoreApps.Size = new System.Drawing.Size(318, 130);
|
||||
this.groupBoxMoreApps.Size = new System.Drawing.Size(318, 128);
|
||||
this.groupBoxMoreApps.TabIndex = 5;
|
||||
this.groupBoxMoreApps.TabStop = false;
|
||||
this.groupBoxMoreApps.Text = "More utilities by me";
|
||||
@ -389,7 +404,7 @@
|
||||
//
|
||||
this.label33.AutoSize = true;
|
||||
this.label33.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label33.Location = new System.Drawing.Point(210, 29);
|
||||
this.label33.Location = new System.Drawing.Point(209, 27);
|
||||
this.label33.Name = "label33";
|
||||
this.label33.Size = new System.Drawing.Size(91, 13);
|
||||
this.label33.TabIndex = 13;
|
||||
@ -399,18 +414,18 @@
|
||||
//
|
||||
this.label32.AutoSize = true;
|
||||
this.label32.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.label32.Location = new System.Drawing.Point(66, 29);
|
||||
this.label32.Location = new System.Drawing.Point(58, 27);
|
||||
this.label32.Name = "label32";
|
||||
this.label32.Size = new System.Drawing.Size(66, 13);
|
||||
this.label32.Size = new System.Drawing.Size(108, 13);
|
||||
this.label32.TabIndex = 10;
|
||||
this.label32.Text = "Snap2IMG";
|
||||
this.label32.Text = "Exif Tag Remover";
|
||||
//
|
||||
// linkLabel3
|
||||
//
|
||||
this.linkLabel3.AutoSize = true;
|
||||
this.linkLabel3.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel3.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel3.Location = new System.Drawing.Point(66, 100);
|
||||
this.linkLabel3.Location = new System.Drawing.Point(58, 100);
|
||||
this.linkLabel3.Name = "linkLabel3";
|
||||
this.linkLabel3.Size = new System.Drawing.Size(51, 13);
|
||||
this.linkLabel3.TabIndex = 12;
|
||||
@ -421,18 +436,18 @@
|
||||
//
|
||||
// label17
|
||||
//
|
||||
this.label17.Location = new System.Drawing.Point(66, 42);
|
||||
this.label17.Location = new System.Drawing.Point(58, 40);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(100, 74);
|
||||
this.label17.Size = new System.Drawing.Size(108, 74);
|
||||
this.label17.TabIndex = 11;
|
||||
this.label17.Text = "Generate contact sheets (thumbnail index) for folders on your hard drive.";
|
||||
this.label17.Text = "Delete all metadata before publishing images to protect your privacy.";
|
||||
//
|
||||
// linkLabel2
|
||||
//
|
||||
this.linkLabel2.AutoSize = true;
|
||||
this.linkLabel2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel2.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel2.Location = new System.Drawing.Point(210, 100);
|
||||
this.linkLabel2.Location = new System.Drawing.Point(209, 100);
|
||||
this.linkLabel2.Name = "linkLabel2";
|
||||
this.linkLabel2.Size = new System.Drawing.Size(51, 13);
|
||||
this.linkLabel2.TabIndex = 10;
|
||||
@ -443,16 +458,16 @@
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.Location = new System.Drawing.Point(210, 42);
|
||||
this.label11.Location = new System.Drawing.Point(209, 40);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(102, 71);
|
||||
this.label11.TabIndex = 9;
|
||||
this.label11.Text = "File renaming utility with lots of time saving automation features.";
|
||||
this.label11.Text = "Advanced file renaming utility that will save you lots of time.";
|
||||
//
|
||||
// pictureBox3
|
||||
//
|
||||
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
|
||||
this.pictureBox3.Location = new System.Drawing.Point(169, 29);
|
||||
this.pictureBox3.Location = new System.Drawing.Point(169, 27);
|
||||
this.pictureBox3.Name = "pictureBox3";
|
||||
this.pictureBox3.Size = new System.Drawing.Size(39, 48);
|
||||
this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
@ -462,9 +477,9 @@
|
||||
// pictureBox2
|
||||
//
|
||||
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
|
||||
this.pictureBox2.Location = new System.Drawing.Point(12, 29);
|
||||
this.pictureBox2.Location = new System.Drawing.Point(10, 27);
|
||||
this.pictureBox2.Name = "pictureBox2";
|
||||
this.pictureBox2.Size = new System.Drawing.Size(48, 48);
|
||||
this.pictureBox2.Size = new System.Drawing.Size(46, 39);
|
||||
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
|
||||
this.pictureBox2.TabIndex = 0;
|
||||
this.pictureBox2.TabStop = false;
|
||||
@ -484,7 +499,7 @@
|
||||
this.linkLabel1.AutoSize = true;
|
||||
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
|
||||
this.linkLabel1.LinkColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(192)))));
|
||||
this.linkLabel1.Location = new System.Drawing.Point(163, 104);
|
||||
this.linkLabel1.Location = new System.Drawing.Point(163, 101);
|
||||
this.linkLabel1.Name = "linkLabel1";
|
||||
this.linkLabel1.Size = new System.Drawing.Size(120, 13);
|
||||
this.linkLabel1.TabIndex = 3;
|
||||
@ -495,7 +510,7 @@
|
||||
// labelAboutSoftware
|
||||
//
|
||||
this.labelAboutSoftware.AutoSize = true;
|
||||
this.labelAboutSoftware.Location = new System.Drawing.Point(163, 87);
|
||||
this.labelAboutSoftware.Location = new System.Drawing.Point(163, 84);
|
||||
this.labelAboutSoftware.Name = "labelAboutSoftware";
|
||||
this.labelAboutSoftware.Size = new System.Drawing.Size(135, 13);
|
||||
this.labelAboutSoftware.TabIndex = 2;
|
||||
@ -564,6 +579,7 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
|
||||
this.tabPage2.ResumeLayout(false);
|
||||
this.tabPage2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBoxDonate)).EndInit();
|
||||
this.groupBoxMoreApps.ResumeLayout(false);
|
||||
this.groupBoxMoreApps.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
|
||||
@ -618,6 +634,7 @@
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.LinkLabel linkLabel5;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.PictureBox pictureBoxDonate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -11,56 +11,57 @@ namespace Snap2HTML
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
private string outFile = ""; // set when automating via command line
|
||||
private bool initDone = false;
|
||||
private bool initDone = false;
|
||||
private bool runningAutomated = false;
|
||||
|
||||
public frmMain()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void frmMain_Load( object sender, EventArgs e )
|
||||
{
|
||||
this.Text = Application.ProductName + " (Press F1 for Help)";
|
||||
labelAboutVersion.Text = "version " + Application.ProductVersion.Split( '.' )[0] + "." + Application.ProductVersion.Split( '.' )[1];
|
||||
private void frmMain_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Text = Application.ProductName + " (Press F1 for Help)";
|
||||
labelAboutVersion.Text = "version " + Application.ProductVersion.Split('.')[0] + "." + Application.ProductVersion.Split('.')[1];
|
||||
|
||||
// initialize some settings
|
||||
int left = Snap2HTML.Properties.Settings.Default.WindowLeft;
|
||||
int top = Snap2HTML.Properties.Settings.Default.WindowTop;
|
||||
if( left >= 0 ) this.Left = left;
|
||||
if( top >= 0 ) this.Top = top;
|
||||
// initialize some settings
|
||||
int left = Snap2HTML.Properties.Settings.Default.WindowLeft;
|
||||
int top = Snap2HTML.Properties.Settings.Default.WindowTop;
|
||||
if (left >= 0) this.Left = left;
|
||||
if (top >= 0) this.Top = top;
|
||||
|
||||
if( System.IO.Directory.Exists( txtRoot.Text ) )
|
||||
{
|
||||
SetRootPath( txtRoot.Text , true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRootPath( "" , false );
|
||||
}
|
||||
if (System.IO.Directory.Exists(txtRoot.Text))
|
||||
{
|
||||
SetRootPath(txtRoot.Text, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRootPath("", false);
|
||||
}
|
||||
|
||||
txtLinkRoot.Enabled = chkLinkFiles.Checked;
|
||||
txtLinkRoot.Enabled = chkLinkFiles.Checked;
|
||||
|
||||
// setup drag & drop handlers
|
||||
tabPage1.DragDrop += DragDropHandler;
|
||||
tabPage1.DragEnter += DragEnterHandler;
|
||||
tabPage1.AllowDrop = true;
|
||||
foreach( Control cnt in tabPage1.Controls )
|
||||
{
|
||||
cnt.DragDrop += DragDropHandler;
|
||||
cnt.DragEnter += DragEnterHandler;
|
||||
cnt.AllowDrop = true;
|
||||
}
|
||||
// setup drag & drop handlers
|
||||
tabPage1.DragDrop += DragDropHandler;
|
||||
tabPage1.DragEnter += DragEnterHandler;
|
||||
tabPage1.AllowDrop = true;
|
||||
foreach (Control cnt in tabPage1.Controls)
|
||||
{
|
||||
cnt.DragDrop += DragDropHandler;
|
||||
cnt.DragEnter += DragEnterHandler;
|
||||
cnt.AllowDrop = true;
|
||||
}
|
||||
|
||||
Opacity = 0; // for silent mode
|
||||
Opacity = 0; // for silent mode
|
||||
|
||||
initDone = true;
|
||||
}
|
||||
initDone = true;
|
||||
}
|
||||
|
||||
private void frmMain_Shown( object sender, EventArgs e )
|
||||
private void frmMain_Shown(object sender, EventArgs e)
|
||||
{
|
||||
// parse command line
|
||||
var commandLine = Environment.CommandLine;
|
||||
commandLine = commandLine.Replace("-output:", "-outfile:"); // correct wrong parameter to avoid confusion
|
||||
var splitCommandLine = Arguments.SplitCommandLine(commandLine);
|
||||
var arguments = new Arguments(splitCommandLine);
|
||||
|
||||
@ -69,175 +70,191 @@ namespace Snap2HTML
|
||||
{
|
||||
if (System.IO.Directory.Exists(splitCommandLine[1]))
|
||||
{
|
||||
SetRootPath( splitCommandLine[1] );
|
||||
SetRootPath(splitCommandLine[1]);
|
||||
}
|
||||
}
|
||||
|
||||
var autoRun = false;
|
||||
|
||||
if (arguments.IsTrue("hidden")) chkHidden.Checked = true;
|
||||
if (arguments.IsTrue("system")) chkSystem.Checked = true;
|
||||
if( arguments.Exists( "path" ) )
|
||||
var settings = new SnapSettings();
|
||||
if (arguments.Exists("path") && arguments.Exists("outfile"))
|
||||
{
|
||||
// note: relative paths not handled
|
||||
string path = arguments.Single( "path" );
|
||||
if( !System.IO.Directory.Exists( path ) ) path = Environment.CurrentDirectory + System.IO.Path.DirectorySeparatorChar + path;
|
||||
this.runningAutomated = true;
|
||||
|
||||
if( System.IO.Directory.Exists( path ) )
|
||||
settings.rootFolder = arguments.Single("path");
|
||||
settings.outputFile = arguments.Single("outfile");
|
||||
|
||||
// First validate paths
|
||||
if (!System.IO.Directory.Exists(settings.rootFolder))
|
||||
{
|
||||
SetRootPath( path );
|
||||
|
||||
// if outfile is also given, start generating snapshot
|
||||
if (arguments.Exists("outfile"))
|
||||
if (!arguments.Exists("silent"))
|
||||
{
|
||||
autoRun = true;
|
||||
outFile = arguments.Single("outfile");
|
||||
cmdCreate.PerformClick();
|
||||
MessageBox.Show("Input path does not exist: " + settings.rootFolder, "Automation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
Application.Exit();
|
||||
}
|
||||
if (!System.IO.Directory.Exists(System.IO.Path.GetDirectoryName(settings.outputFile)))
|
||||
{
|
||||
if (!arguments.Exists("silent"))
|
||||
{
|
||||
MessageBox.Show("Output path does not exist: " + System.IO.Path.GetDirectoryName(settings.outputFile), "Automation Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
// Rest of settings
|
||||
|
||||
settings.skipHiddenItems = !arguments.Exists("hidden");
|
||||
settings.skipSystemItems = !arguments.Exists("system");
|
||||
settings.openInBrowser = false;
|
||||
|
||||
settings.linkFiles = false;
|
||||
if (arguments.Exists("link"))
|
||||
{
|
||||
settings.linkFiles = true;
|
||||
settings.linkRoot = arguments.Single("link");
|
||||
}
|
||||
|
||||
settings.title = "Snapshot of " + settings.rootFolder;
|
||||
if (arguments.Exists("title"))
|
||||
{
|
||||
settings.title = arguments.Single("title");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// keep window hidden in silent mode
|
||||
if( arguments.IsTrue( "silent" ) && autoRun )
|
||||
{
|
||||
Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Opacity = 100;
|
||||
}
|
||||
// keep window hidden in silent mode
|
||||
if (arguments.IsTrue("silent") && this.runningAutomated)
|
||||
{
|
||||
Visible = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Opacity = 100;
|
||||
}
|
||||
|
||||
// run link/title after path, since path automatically updates title
|
||||
if( arguments.Exists( "link" ) )
|
||||
{
|
||||
chkLinkFiles.Checked = true;
|
||||
txtLinkRoot.Text = arguments.Single( "link" );
|
||||
txtLinkRoot.Enabled = true;
|
||||
}
|
||||
if( arguments.Exists( "title" ) )
|
||||
{
|
||||
txtTitle.Text = arguments.Single( "title" );
|
||||
}
|
||||
if (this.runningAutomated)
|
||||
{
|
||||
StartProcessing(settings);
|
||||
}
|
||||
}
|
||||
|
||||
private void frmMain_FormClosing( object sender, FormClosingEventArgs e )
|
||||
{
|
||||
if( backgroundWorker.IsBusy ) e.Cancel = true;
|
||||
|
||||
if( outFile == "" ) // don't save settings when automated through command line
|
||||
{
|
||||
Snap2HTML.Properties.Settings.Default.WindowLeft = this.Left;
|
||||
Snap2HTML.Properties.Settings.Default.WindowTop = this.Top;
|
||||
Snap2HTML.Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdBrowse_Click(object sender, EventArgs e)
|
||||
private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Desktop; // this makes it possible to select network paths too
|
||||
folderBrowserDialog1.SelectedPath = txtRoot.Text;
|
||||
if (backgroundWorker.IsBusy) e.Cancel = true;
|
||||
|
||||
if (!this.runningAutomated) // don't save settings when automated through command line
|
||||
{
|
||||
Snap2HTML.Properties.Settings.Default.WindowLeft = this.Left;
|
||||
Snap2HTML.Properties.Settings.Default.WindowTop = this.Top;
|
||||
Snap2HTML.Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdBrowse_Click(object sender, EventArgs e)
|
||||
{
|
||||
folderBrowserDialog1.RootFolder = Environment.SpecialFolder.Desktop; // this makes it possible to select network paths too
|
||||
folderBrowserDialog1.SelectedPath = txtRoot.Text;
|
||||
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
try
|
||||
{
|
||||
SetRootPath( folderBrowserDialog1.SelectedPath );
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
MessageBox.Show( "Could not select folder: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
SetRootPath( "", false );
|
||||
}
|
||||
{
|
||||
try
|
||||
{
|
||||
SetRootPath(folderBrowserDialog1.SelectedPath);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show("Could not select folder:\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
SetRootPath("", false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void cmdCreate_Click(object sender, EventArgs e)
|
||||
{
|
||||
// ensure source path format
|
||||
txtRoot.Text = System.IO.Path.GetFullPath( txtRoot.Text );
|
||||
if (txtRoot.Text.EndsWith(@"\")) txtRoot.Text = txtRoot.Text.Substring(0, txtRoot.Text.Length - 1);
|
||||
if( Utils.IsWildcardMatch( "?:", txtRoot.Text, false ) ) txtRoot.Text += @"\"; // add backslash to path if only letter and colon eg "c:"
|
||||
|
||||
// add slash or backslash to end of link (in cases where it is clearthat we we can)
|
||||
if( !txtLinkRoot.Text.EndsWith( @"/" ) && txtLinkRoot.Text.ToLower().StartsWith( @"http" ) ) // web site
|
||||
{
|
||||
txtLinkRoot.Text += @"/";
|
||||
}
|
||||
if( !txtLinkRoot.Text.EndsWith( @"\" ) && Utils.IsWildcardMatch( "?:*", txtLinkRoot.Text, false ) ) // local disk
|
||||
{
|
||||
txtLinkRoot.Text += @"\";
|
||||
}
|
||||
|
||||
// get output file
|
||||
if( outFile == "" )
|
||||
{
|
||||
// ask for output file
|
||||
string fileName = new System.IO.DirectoryInfo(txtRoot.Text + @"\").Name;
|
||||
char[] invalid = System.IO.Path.GetInvalidFileNameChars();
|
||||
for (int i = 0; i < invalid.Length; i++)
|
||||
{
|
||||
string fileName = new System.IO.DirectoryInfo( txtRoot.Text + @"\" ).Name;
|
||||
char[] invalid = System.IO.Path.GetInvalidFileNameChars();
|
||||
for (int i = 0; i < invalid.Length; i++)
|
||||
{
|
||||
fileName = fileName.Replace(invalid[i].ToString(), "");
|
||||
}
|
||||
|
||||
saveFileDialog1.DefaultExt = "html";
|
||||
if( !fileName.ToLower().EndsWith( ".html" ) ) fileName += ".html";
|
||||
saveFileDialog1.FileName = fileName;
|
||||
saveFileDialog1.Filter = "HTML files (*.html)|*.html|All files (*.*)|*.*";
|
||||
saveFileDialog1.InitialDirectory = System.IO.Path.GetDirectoryName(txtRoot.Text);
|
||||
if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
|
||||
}
|
||||
else // command line
|
||||
{
|
||||
saveFileDialog1.FileName = outFile;
|
||||
fileName = fileName.Replace(invalid[i].ToString(), "");
|
||||
}
|
||||
|
||||
if( !saveFileDialog1.FileName.ToLower().EndsWith( ".html" ) ) saveFileDialog1.FileName += ".html";
|
||||
saveFileDialog1.DefaultExt = "html";
|
||||
if (!fileName.ToLower().EndsWith(".html")) fileName += ".html";
|
||||
saveFileDialog1.FileName = fileName;
|
||||
saveFileDialog1.Filter = "HTML files (*.html)|*.html|All files (*.*)|*.*";
|
||||
saveFileDialog1.InitialDirectory = System.IO.Path.GetDirectoryName(txtRoot.Text);
|
||||
saveFileDialog1.CheckPathExists = true;
|
||||
if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
|
||||
|
||||
// make sure output path exists
|
||||
if( !System.IO.Directory.Exists( System.IO.Path.GetDirectoryName( saveFileDialog1.FileName ) ) )
|
||||
{
|
||||
MessageBox.Show( "The output folder does not exists...\n\n" + System.IO.Path.GetDirectoryName( saveFileDialog1.FileName ), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
return;
|
||||
}
|
||||
if (!saveFileDialog1.FileName.ToLower().EndsWith(".html")) saveFileDialog1.FileName += ".html";
|
||||
|
||||
// begin generating html
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
this.Text = "Snap2HTML (Working... Press Escape to Cancel)";
|
||||
tabControl1.Enabled = false;
|
||||
// begin generating html
|
||||
var settings = new SnapSettings()
|
||||
{
|
||||
rootFolder = txtRoot.Text,
|
||||
title = txtTitle.Text,
|
||||
outputFile = saveFileDialog1.FileName,
|
||||
skipHiddenItems = !chkHidden.Checked,
|
||||
skipSystemItems = !chkSystem.Checked,
|
||||
openInBrowser = chkOpenOutput.Checked,
|
||||
linkFiles = chkLinkFiles.Checked,
|
||||
linkRoot = txtLinkRoot.Text,
|
||||
};
|
||||
StartProcessing(settings);
|
||||
}
|
||||
|
||||
var settings = new SnapSettings()
|
||||
{
|
||||
rootFolder = txtRoot.Text,
|
||||
title = txtTitle.Text,
|
||||
outputFile = saveFileDialog1.FileName,
|
||||
skipHiddenItems = !chkHidden.Checked,
|
||||
skipSystemItems = !chkSystem.Checked,
|
||||
openInBrowser = chkOpenOutput.Checked,
|
||||
linkFiles = chkLinkFiles.Checked,
|
||||
linkRoot = txtLinkRoot.Text,
|
||||
};
|
||||
backgroundWorker.RunWorkerAsync(argument: settings);
|
||||
private void StartProcessing(SnapSettings settings)
|
||||
{
|
||||
// ensure source path format
|
||||
settings.rootFolder = System.IO.Path.GetFullPath(settings.rootFolder);
|
||||
if (settings.rootFolder.EndsWith(@"\")) settings.rootFolder = settings.rootFolder.Substring(0, settings.rootFolder.Length - 1);
|
||||
if (Utils.IsWildcardMatch("?:", settings.rootFolder, false)) settings.rootFolder += @"\"; // add backslash to path if only letter and colon eg "c:"
|
||||
|
||||
}
|
||||
// add slash or backslash to end of link (in cases where it is clear that we we can)
|
||||
if (settings.linkFiles)
|
||||
{
|
||||
if (!settings.linkRoot.EndsWith(@"/"))
|
||||
{
|
||||
if (settings.linkRoot.ToLower().StartsWith(@"http")) // web site
|
||||
{
|
||||
settings.linkRoot += @"/";
|
||||
}
|
||||
if (Utils.IsWildcardMatch("?:*", settings.linkRoot, false)) // local disk
|
||||
{
|
||||
settings.linkRoot += @"\";
|
||||
}
|
||||
if (settings.linkRoot.StartsWith(@"\\")) // unc path
|
||||
{
|
||||
settings.linkRoot += @"\";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void backgroundWorker_ProgressChanged( object sender, ProgressChangedEventArgs e )
|
||||
{
|
||||
toolStripStatusLabel1.Text = e.UserState.ToString();
|
||||
}
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
this.Text = "Snap2HTML (Working... Press Escape to Cancel)";
|
||||
tabControl1.Enabled = false;
|
||||
backgroundWorker.RunWorkerAsync(argument: settings);
|
||||
}
|
||||
|
||||
private void backgroundWorker_RunWorkerCompleted( object sender, RunWorkerCompletedEventArgs e )
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
private void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
|
||||
{
|
||||
toolStripStatusLabel1.Text = e.UserState.ToString();
|
||||
}
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
tabControl1.Enabled = true;
|
||||
this.Text = "Snap2HTML";
|
||||
private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
|
||||
{
|
||||
GC.Collect();
|
||||
GC.WaitForPendingFinalizers();
|
||||
|
||||
// Quit when finished if automated via command line
|
||||
if( outFile != "" )
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
Cursor.Current = Cursors.Default;
|
||||
tabControl1.Enabled = true;
|
||||
this.Text = "Snap2HTML";
|
||||
|
||||
// Quit when finished if automated via command line
|
||||
if (this.runningAutomated)
|
||||
{
|
||||
Application.Exit();
|
||||
}
|
||||
}
|
||||
|
||||
private void chkLinkFiles_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
@ -247,97 +264,101 @@ namespace Snap2HTML
|
||||
txtLinkRoot.Enabled = false;
|
||||
}
|
||||
|
||||
// Link Label handlers
|
||||
private void linkLabel1_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com" );
|
||||
}
|
||||
private void linkLabel3_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/snap2img/about.asp" );
|
||||
}
|
||||
private void linkLabel2_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/flashren/about.asp" );
|
||||
}
|
||||
private void linkLabel4_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( "notepad.exe", System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + "\\template.html" );
|
||||
}
|
||||
private void linkLabel5_LinkClicked( object sender, LinkLabelLinkClickedEventArgs e )
|
||||
{
|
||||
System.Diagnostics.Process.Start( @"http://www.rlvision.com/contact.asp" );
|
||||
}
|
||||
// Link Label handlers
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(@"http://www.rlvision.com");
|
||||
}
|
||||
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(@"https://rlvision.com/exif/about.php");
|
||||
}
|
||||
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(@"http://www.rlvision.com/flashren/about.php");
|
||||
}
|
||||
private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start("notepad.exe", System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\template.html");
|
||||
}
|
||||
private void linkLabel5_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(@"http://www.rlvision.com/contact.php");
|
||||
}
|
||||
private void pictureBoxDonate_Click(object sender, EventArgs e)
|
||||
{
|
||||
System.Diagnostics.Process.Start(@"https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=U3E4HE8HMY9Q4&item_name=Snap2HTML¤cy_code=USD&source=url");
|
||||
}
|
||||
|
||||
// Drag & Drop handlers
|
||||
private void DragEnterHandler( object sender, DragEventArgs e )
|
||||
{
|
||||
if( e.Data.GetDataPresent( DataFormats.FileDrop ) )
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
private void DragDropHandler( object sender, DragEventArgs e )
|
||||
{
|
||||
if( e.Data.GetDataPresent( DataFormats.FileDrop ) )
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData( DataFormats.FileDrop );
|
||||
if( files.Length == 1 && System.IO.Directory.Exists( files[0] ) )
|
||||
{
|
||||
SetRootPath( files[0] );
|
||||
}
|
||||
}
|
||||
}
|
||||
// Drag & Drop handlers
|
||||
private void DragEnterHandler(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
private void DragDropHandler(object sender, DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
if (files.Length == 1 && System.IO.Directory.Exists(files[0]))
|
||||
{
|
||||
SetRootPath(files[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Escape to cancel
|
||||
private void frmMain_KeyUp( object sender, KeyEventArgs e )
|
||||
{
|
||||
if( backgroundWorker.IsBusy )
|
||||
{
|
||||
if( e.KeyCode == Keys.Escape )
|
||||
{
|
||||
backgroundWorker.CancelAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( e.KeyCode == Keys.F1 )
|
||||
{
|
||||
System.Diagnostics.Process.Start( System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + "\\ReadMe.txt" );
|
||||
}
|
||||
}
|
||||
}
|
||||
// Escape to cancel
|
||||
private void frmMain_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (backgroundWorker.IsBusy)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
backgroundWorker.CancelAsync();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.KeyCode == Keys.F1)
|
||||
{
|
||||
System.Diagnostics.Process.Start(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\ReadMe.txt");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sets the root path input box and makes related gui parts ready to use
|
||||
private void SetRootPath( string path, bool pathIsValid = true )
|
||||
{
|
||||
if( pathIsValid )
|
||||
{
|
||||
txtRoot.Text = path;
|
||||
cmdCreate.Enabled = true;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if( initDone )
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "Snapshot of " + txtRoot.Text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtRoot.Text = "";
|
||||
cmdCreate.Enabled = false;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if( initDone )
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sets the root path input box and makes related gui parts ready to use
|
||||
private void SetRootPath(string path, bool pathIsValid = true)
|
||||
{
|
||||
if (pathIsValid)
|
||||
{
|
||||
txtRoot.Text = path;
|
||||
cmdCreate.Enabled = true;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if (initDone)
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "Snapshot of " + txtRoot.Text;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
txtRoot.Text = "";
|
||||
cmdCreate.Enabled = false;
|
||||
toolStripStatusLabel1.Text = "";
|
||||
if (initDone)
|
||||
{
|
||||
txtLinkRoot.Text = txtRoot.Text;
|
||||
txtTitle.Text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,6 +494,35 @@
|
||||
jTImu2uXMzlKjrHmOMi2HdX5XuWSJmvKfmgyh+cNp8H6sf+27Lsm+y3Dfgvqr611T/8VtDTJLpqNOUXr
|
||||
pv6L5CL5mS0+oHBCISJ/spaaoiaNUoPpu7oB1TR69G3yfkUeX0J/vgj+zvwzMC20NMkumo3v+d9Bs/E9
|
||||
/ztoNr7nfwfNxvf8rwDl/wALZf6ZRmxttQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="pictureBoxDonate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
R0lGODlhSgAVAIfPAP7DOf7DONqnMf7EOSgeCNmmMAgGAeCsMmNMFv/DOfC4NfzBOOqzNP/EOvS7Nv/F
|
||||
PgkGAgEAAAIBAAUDAVlEE+mzNP/GQf7COZx3IiAYB0AxDg4KAwMCAPe9NyIaB//aguGsMv/QYdimMPO6
|
||||
NTYpDPvLWOizN9qoMP/OW9yoMf3CON+rMtyoMPO6NkMzDiogCe21NP/LU+iyM//JSv7TcPC4NlVBExgS
|
||||
BfjCRO64OOKtM2JLFQcFAcucLSEZB0k4EPzJTvvAOCUcCAYEATAkCv/ciRUQBP7QZv3FQvi+N/rCQT8w
|
||||
DrmOKfTHV1xGFOKvMvm/N/m+N6Z/JfjBPlpFFDImC+y0NZNwIPrAN66FJv7PYdelMJVyIcycLfq/OBsU
|
||||
BvzEP39hHHdbGtWjL3NYGU88Ee62Nf/DOu22Nf3QZfG5NRENA0o4EGRMFjUoC+eyNOWwNDkrDM6eLrCH
|
||||
J7uPKf/ISDwuDXldG/W+PvG9Q0U1DwoHAnpdG29VGDstDXZaGjElCtuoMBwVBpd0IWFKFfW8Nt6qMmhP
|
||||
FzosDCwhCffETey1NVdCE//XeYNkHZl1IqF7I+WwMriNKYdnHhQPBPfAPuy1NNakL/q/N+u0NJ96I+22
|
||||
NuWwM9GgLnxfGxkTBcWXLPK9RPfETt+rMfvDP3teG8OVK7yQKj0uDUExDkc2D/7PXw8LAwsIAoBiHAQD
|
||||
ANCfLt6pMsmaLJFvIP3COZRxIfa+P1E+Ev/HQZBuIP/JSf/Wd96qMS0iCr6SKlZCE+eyMx8XBnVZGrqO
|
||||
Kf7QZW1TGGVNFtOiL//Wdv/YesiZLNqnMP/cigAAAP/EOQAAA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g1Gj1HAptuBGlUANvBglkCErwNDBAt+G61cCC3QAwwqxmEvQCSmwEEgByxTAL7/LCBCwwAIvY/DB
|
||||
BxNMsMEKB2zwv/8ifDALKZxgVEAAOw==
|
||||
</value>
|
||||
</data>
|
||||
<data name="pictureBox3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
@ -552,110 +581,62 @@
|
||||
</data>
|
||||
<data name="pictureBox2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29m
|
||||
dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAABfoSURBVGhD1VlnVFXXut1J7CFq7BpjTYzYRYo06R3p
|
||||
7dARxIIIShcRFekdEcUOYgMbEQQUFLFXpBc59K4iSBPbfN/eicklV+944433564xJmuzzj5rffPrCxgA
|
||||
/9X44uJ/E/56SM+4xq9r6kR9yzs0t71DfesHev6M99zvDW3vUdf0BjV1Taipb0Z1QzNqG9pQ2/4add1v
|
||||
UdvWg9rmTtS2dtH8CnWNTWhpf4lXnd1of9WFFy870PriFdraX+BlRxe6e/vR1dNLa/TOmz50dPfhVXc/
|
||||
Pf+NFyy6+vCiswellZXYvjtg+radexhP392DCTwtrKnD29voqFoP/hMPdDx3Qefzreis2IKuane8rnJB
|
||||
S+F6DLyMp9dpDLQC/XXAh2oMFGWjK9QLaDuJ9y/S0V9xGp8acrjXaisqkJGahLyrx/Ds6S1UVFSiqqoa
|
||||
OdkZiIgIQ3z8fjTW1+LMgVAkH92L1MRYXDm1D+mEzNP0TEhNiMT1i8fQ/3YAu4Mjpvn6BzFEZDCB/JKW
|
||||
6s6aMDxNZZCWIIDHFxkUZo7BtUQBlF4dgvRDDLITGBTcNWblwqfu5/jYUYSP/ffQetIA7Q6z8GbXMnRn
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gun6OuG3p/mb/v74k4R3D7DRa1P2mJzYblxizLLfMVks/wE0U6nUjzfnyQAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
|
||||
@ -2,423 +2,433 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using CommandLine.Utility;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Snap2HTML
|
||||
{
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
// This runs on a separate thread from the GUI
|
||||
private void backgroundWorker_DoWork( object sender, DoWorkEventArgs e )
|
||||
{
|
||||
var settings = (SnapSettings)e.Argument;
|
||||
public partial class frmMain : Form
|
||||
{
|
||||
// This runs on a separate thread from the GUI
|
||||
private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
var settings = (SnapSettings)e.Argument;
|
||||
|
||||
// Get files & folders
|
||||
var content = GetContent( settings, backgroundWorker );
|
||||
if( backgroundWorker.CancellationPending )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "User cancelled" );
|
||||
return;
|
||||
}
|
||||
if( content == null )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Error reading source" );
|
||||
return;
|
||||
}
|
||||
// Get files & folders
|
||||
var content = GetContent(settings, backgroundWorker);
|
||||
if (backgroundWorker.CancellationPending)
|
||||
{
|
||||
backgroundWorker.ReportProgress(0, "User cancelled");
|
||||
return;
|
||||
}
|
||||
if (content == null)
|
||||
{
|
||||
backgroundWorker.ReportProgress(0, "Error reading source");
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate some stats
|
||||
int totDirs = 0;
|
||||
int totFiles = 0;
|
||||
long totSize = 0;
|
||||
foreach( var folder in content )
|
||||
{
|
||||
totDirs++;
|
||||
foreach( var file in folder.Files )
|
||||
{
|
||||
totFiles++;
|
||||
totSize += Utils.ParseLong( file.GetProp( "Size" ) );
|
||||
}
|
||||
}
|
||||
|
||||
// Let's generate the output
|
||||
// Calculate some stats
|
||||
int totDirs = 0;
|
||||
int totFiles = 0;
|
||||
long totSize = 0;
|
||||
foreach (var folder in content)
|
||||
{
|
||||
totDirs++;
|
||||
foreach (var file in folder.Files)
|
||||
{
|
||||
totFiles++;
|
||||
totSize += Utils.ParseLong(file.GetProp("Size"));
|
||||
}
|
||||
}
|
||||
|
||||
backgroundWorker.ReportProgress( 0, "Generating HTML file..." );
|
||||
// Let's generate the output
|
||||
|
||||
// Read template
|
||||
var sbTemplate = new StringBuilder();
|
||||
try
|
||||
{
|
||||
using( System.IO.StreamReader reader = new System.IO.StreamReader( System.IO.Path.GetDirectoryName( Application.ExecutablePath ) + System.IO.Path.DirectorySeparatorChar + "template.html" ) )
|
||||
{
|
||||
sbTemplate.Append(reader.ReadToEnd());
|
||||
}
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
MessageBox.Show( "Failed to open 'Template.html' for reading...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
backgroundWorker.ReportProgress( 0, "An error occurred..." );
|
||||
return;
|
||||
}
|
||||
backgroundWorker.ReportProgress(0, "Generating HTML file...");
|
||||
|
||||
// Build HTML
|
||||
sbTemplate.Replace( "[TITLE]", settings.title );
|
||||
sbTemplate.Replace( "[APP LINK]", "http://www.rlvision.com" );
|
||||
sbTemplate.Replace( "[APP NAME]", Application.ProductName );
|
||||
sbTemplate.Replace( "[APP VER]", Application.ProductVersion.Split( '.' )[0] + "." + Application.ProductVersion.Split( '.' )[1] );
|
||||
sbTemplate.Replace( "[GEN TIME]", DateTime.Now.ToString( "t" ) );
|
||||
sbTemplate.Replace( "[GEN DATE]", DateTime.Now.ToString( "d" ) );
|
||||
sbTemplate.Replace( "[NUM FILES]", totFiles.ToString() );
|
||||
sbTemplate.Replace( "[NUM DIRS]", totDirs.ToString() );
|
||||
sbTemplate.Replace( "[TOT SIZE]", totSize.ToString() );
|
||||
if( chkLinkFiles.Checked )
|
||||
{
|
||||
sbTemplate.Replace( "[LINK FILES]", "true" );
|
||||
sbTemplate.Replace( "[LINK ROOT]", settings.linkRoot.Replace( @"\", "/" ) );
|
||||
sbTemplate.Replace( "[SOURCE ROOT]", settings.rootFolder.Replace( @"\", "/" ) );
|
||||
// Read template
|
||||
var sbTemplate = new StringBuilder();
|
||||
try
|
||||
{
|
||||
using (System.IO.StreamReader reader = new System.IO.StreamReader(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + System.IO.Path.DirectorySeparatorChar + "template.html", Encoding.UTF8))
|
||||
{
|
||||
sbTemplate.Append(reader.ReadToEnd());
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
MessageBox.Show("Failed to open 'Template.html' for reading:\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
backgroundWorker.ReportProgress(0, "An error occurred...");
|
||||
return;
|
||||
}
|
||||
|
||||
string link_root = settings.linkRoot.Replace( @"\", "/" );
|
||||
if( Utils.IsWildcardMatch( @"?:/*", link_root, false ) ) // "file://" is needed in the browser if path begins with drive letter, else it should not be used
|
||||
{
|
||||
sbTemplate.Replace( "[LINK PROTOCOL]", @"file://" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sbTemplate.Replace( "[LINK PROTOCOL]", "" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sbTemplate.Replace( "[LINK FILES]", "false" );
|
||||
sbTemplate.Replace( "[LINK PROTOCOL]", "" );
|
||||
sbTemplate.Replace( "[LINK ROOT]", "" );
|
||||
sbTemplate.Replace( "[SOURCE ROOT]", settings.rootFolder.Replace( @"\", "/" ) );
|
||||
}
|
||||
// Build HTML
|
||||
sbTemplate.Replace("[TITLE]", settings.title);
|
||||
sbTemplate.Replace("[APP LINK]", "http://www.rlvision.com");
|
||||
sbTemplate.Replace("[APP NAME]", Application.ProductName);
|
||||
sbTemplate.Replace("[APP VER]", Application.ProductVersion.Split('.')[0] + "." + Application.ProductVersion.Split('.')[1]);
|
||||
sbTemplate.Replace("[GEN TIME]", DateTime.Now.ToString("t"));
|
||||
sbTemplate.Replace("[GEN DATE]", DateTime.Now.ToString("d"));
|
||||
sbTemplate.Replace("[NUM FILES]", totFiles.ToString());
|
||||
sbTemplate.Replace("[NUM DIRS]", totDirs.ToString());
|
||||
sbTemplate.Replace("[TOT SIZE]", totSize.ToString());
|
||||
if (settings.linkFiles)
|
||||
{
|
||||
sbTemplate.Replace("[LINK FILES]", "true");
|
||||
sbTemplate.Replace("[LINK ROOT]", settings.linkRoot.Replace(@"\", "/"));
|
||||
sbTemplate.Replace("[SOURCE ROOT]", settings.rootFolder.Replace(@"\", "/"));
|
||||
|
||||
// Write output file
|
||||
try
|
||||
{
|
||||
using( System.IO.StreamWriter writer = new System.IO.StreamWriter( settings.outputFile ) )
|
||||
{
|
||||
var template = sbTemplate.ToString();
|
||||
var startOfData = template.IndexOf( "[DIR DATA]" );
|
||||
string link_root = settings.linkRoot.Replace(@"\", "/");
|
||||
if (Utils.IsWildcardMatch(@"?:/*", link_root, false)) // "file://" is needed in the browser if path begins with drive letter, else it should not be used
|
||||
{
|
||||
sbTemplate.Replace("[LINK PROTOCOL]", @"file://");
|
||||
}
|
||||
else if (link_root.StartsWith("//")) // for UNC paths e.g. \\server\path
|
||||
{
|
||||
sbTemplate.Replace("[LINK PROTOCOL]", @"file://///");
|
||||
}
|
||||
else
|
||||
{
|
||||
sbTemplate.Replace("[LINK PROTOCOL]", "");
|
||||
}
|
||||
|
||||
writer.Write(template.Substring(0, startOfData));
|
||||
}
|
||||
else
|
||||
{
|
||||
sbTemplate.Replace("[LINK FILES]", "false");
|
||||
sbTemplate.Replace("[LINK PROTOCOL]", "");
|
||||
sbTemplate.Replace("[LINK ROOT]", "");
|
||||
sbTemplate.Replace("[SOURCE ROOT]", settings.rootFolder.Replace(@"\", "/"));
|
||||
}
|
||||
|
||||
BuildJavascriptContentArray( content, 0, writer, backgroundWorker );
|
||||
// Write output file
|
||||
try
|
||||
{
|
||||
using (System.IO.StreamWriter writer = new System.IO.StreamWriter(settings.outputFile, false, Encoding.UTF8))
|
||||
{
|
||||
writer.AutoFlush = true;
|
||||
|
||||
if( backgroundWorker.CancellationPending )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "User cancelled" );
|
||||
return;
|
||||
}
|
||||
var template = sbTemplate.ToString();
|
||||
var startOfData = template.IndexOf("[DIR DATA]");
|
||||
|
||||
writer.Write( template.Substring( startOfData + 10) );
|
||||
}
|
||||
writer.Write(template.Substring(0, startOfData));
|
||||
|
||||
sbTemplate = null;
|
||||
BuildJavascriptContentArray(content, 0, writer, backgroundWorker);
|
||||
|
||||
if( settings.openInBrowser )
|
||||
{
|
||||
System.Diagnostics.Process.Start( settings.outputFile );
|
||||
}
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
MessageBox.Show( "Failed to open file for writing:\n\n" + ex, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error );
|
||||
backgroundWorker.ReportProgress( 0, "An error occurred..." );
|
||||
return;
|
||||
}
|
||||
if (backgroundWorker.CancellationPending)
|
||||
{
|
||||
backgroundWorker.ReportProgress(0, "User cancelled");
|
||||
return;
|
||||
}
|
||||
|
||||
// Ready!
|
||||
Cursor.Current = Cursors.Default;
|
||||
backgroundWorker.ReportProgress( 100, "Ready!" );
|
||||
}
|
||||
writer.Write(template.Substring(startOfData + 10));
|
||||
}
|
||||
|
||||
sbTemplate = null;
|
||||
|
||||
if (settings.openInBrowser)
|
||||
{
|
||||
System.Diagnostics.Process.Start(settings.outputFile);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show("Failed to open file for writing:\n\n" + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
backgroundWorker.ReportProgress(0, "An error occurred...");
|
||||
return;
|
||||
}
|
||||
|
||||
// Ready!
|
||||
Cursor.Current = Cursors.Default;
|
||||
backgroundWorker.ReportProgress(100, "Ready!");
|
||||
}
|
||||
|
||||
|
||||
// --- Helper functions (must be static to avoid thread problems) ---
|
||||
// --- Helper functions (must be static to avoid thread problems) ---
|
||||
|
||||
private static List<SnappedFolder> GetContent( SnapSettings settings, BackgroundWorker bgWorker )
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
private static List<SnappedFolder> GetContent(SnapSettings settings, BackgroundWorker bgWorker)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
|
||||
var result = new List<SnappedFolder>();
|
||||
var result = new List<SnappedFolder>();
|
||||
|
||||
// Get all folders
|
||||
var dirs = new List<string>();
|
||||
dirs.Insert( 0, settings.rootFolder );
|
||||
DirSearch( settings.rootFolder, dirs, settings.skipHiddenItems, settings.skipSystemItems, stopwatch, bgWorker );
|
||||
dirs = Utils.SortDirList( dirs );
|
||||
// Get all folders
|
||||
var dirs = new List<string>();
|
||||
dirs.Insert(0, settings.rootFolder);
|
||||
DirSearch(settings.rootFolder, dirs, settings.skipHiddenItems, settings.skipSystemItems, stopwatch, bgWorker);
|
||||
dirs = Utils.SortDirList(dirs);
|
||||
|
||||
if( bgWorker.CancellationPending )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (bgWorker.CancellationPending)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var totFiles = 0;
|
||||
var totFiles = 0;
|
||||
|
||||
stopwatch.Restart();
|
||||
stopwatch.Restart();
|
||||
|
||||
try
|
||||
{
|
||||
string modified_date;
|
||||
string created_date;
|
||||
try
|
||||
{
|
||||
string modified_date;
|
||||
string created_date;
|
||||
|
||||
// Parse each folder
|
||||
for( int d = 0; d < dirs.Count; d++ )
|
||||
{
|
||||
// Get folder properties
|
||||
var dirName = dirs[d];
|
||||
var currentDir = new SnappedFolder( Path.GetFileName( dirName ), Path.GetDirectoryName( dirName ) );
|
||||
if( dirName == Path.GetPathRoot( dirName ) )
|
||||
{
|
||||
currentDir = new SnappedFolder( "", dirName );
|
||||
}
|
||||
// Parse each folder
|
||||
for (int d = 0; d < dirs.Count; d++)
|
||||
{
|
||||
// Get folder properties
|
||||
var dirName = dirs[d];
|
||||
var currentDir = new SnappedFolder(Path.GetFileName(dirName), Path.GetDirectoryName(dirName));
|
||||
if (dirName == Path.GetPathRoot(dirName))
|
||||
{
|
||||
currentDir = new SnappedFolder("", dirName);
|
||||
}
|
||||
|
||||
modified_date = "";
|
||||
created_date = "";
|
||||
try
|
||||
{
|
||||
modified_date = Utils.ToUnixTimestamp( System.IO.Directory.GetLastWriteTime( dirName ).ToLocalTime() ).ToString();
|
||||
created_date = Utils.ToUnixTimestamp( System.IO.Directory.GetCreationTime( dirName ).ToLocalTime() ).ToString();
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
}
|
||||
currentDir.Properties.Add( "Modified", modified_date );
|
||||
currentDir.Properties.Add( "Created", created_date );
|
||||
modified_date = "";
|
||||
created_date = "";
|
||||
try
|
||||
{
|
||||
modified_date = Utils.ToUnixTimestamp(System.IO.Directory.GetLastWriteTime(dirName).ToLocalTime()).ToString();
|
||||
created_date = Utils.ToUnixTimestamp(System.IO.Directory.GetCreationTime(dirName).ToLocalTime()).ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} Exception caught.", ex);
|
||||
}
|
||||
currentDir.Properties.Add("Modified", modified_date);
|
||||
currentDir.Properties.Add("Created", created_date);
|
||||
|
||||
// Get files in folder
|
||||
List<string> files;
|
||||
try
|
||||
{
|
||||
files = new List<string>( System.IO.Directory.GetFiles( dirName, "*.*", System.IO.SearchOption.TopDirectoryOnly ) );
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
result.Add( currentDir );
|
||||
continue;
|
||||
}
|
||||
files.Sort();
|
||||
// Get files in folder
|
||||
List<string> files;
|
||||
try
|
||||
{
|
||||
files = new List<string>(System.IO.Directory.GetFiles(dirName, "*.*", System.IO.SearchOption.TopDirectoryOnly));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} Exception caught.", ex);
|
||||
result.Add(currentDir);
|
||||
continue;
|
||||
}
|
||||
files.Sort();
|
||||
|
||||
// Get file properties
|
||||
foreach( string sFile in files )
|
||||
{
|
||||
totFiles++;
|
||||
if(stopwatch.ElapsedMilliseconds >= 50)
|
||||
{
|
||||
bgWorker.ReportProgress( 0, "Reading files... " + totFiles + " (" + sFile + ")" );
|
||||
stopwatch.Restart();
|
||||
}
|
||||
// Get file properties
|
||||
foreach (string sFile in files)
|
||||
{
|
||||
totFiles++;
|
||||
if (stopwatch.ElapsedMilliseconds >= 50)
|
||||
{
|
||||
bgWorker.ReportProgress(0, "Reading files... " + totFiles + " (" + sFile + ")");
|
||||
stopwatch.Restart();
|
||||
}
|
||||
|
||||
if( bgWorker.CancellationPending )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (bgWorker.CancellationPending)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var currentFile = new SnappedFile( Path.GetFileName( sFile ) );
|
||||
try
|
||||
{
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo( sFile );
|
||||
var isHidden = ( fi.Attributes & System.IO.FileAttributes.Hidden ) == System.IO.FileAttributes.Hidden;
|
||||
var isSystem = ( fi.Attributes & System.IO.FileAttributes.System ) == System.IO.FileAttributes.System;
|
||||
var currentFile = new SnappedFile(Path.GetFileName(sFile));
|
||||
try
|
||||
{
|
||||
System.IO.FileInfo fi = new System.IO.FileInfo(sFile);
|
||||
var isHidden = (fi.Attributes & System.IO.FileAttributes.Hidden) == System.IO.FileAttributes.Hidden;
|
||||
var isSystem = (fi.Attributes & System.IO.FileAttributes.System) == System.IO.FileAttributes.System;
|
||||
|
||||
if( ( isHidden && settings.skipHiddenItems ) || ( isSystem && settings.skipSystemItems ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ((isHidden && settings.skipHiddenItems) || (isSystem && settings.skipSystemItems))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
currentFile.Properties.Add( "Size", fi.Length.ToString() );
|
||||
currentFile.Properties.Add("Size", fi.Length.ToString());
|
||||
|
||||
modified_date = "-";
|
||||
created_date = "-";
|
||||
try
|
||||
{
|
||||
modified_date = Utils.ToUnixTimestamp( fi.LastWriteTime.ToLocalTime() ).ToString();
|
||||
created_date = Utils.ToUnixTimestamp( fi.CreationTime.ToLocalTime() ).ToString();
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
}
|
||||
modified_date = "-";
|
||||
created_date = "-";
|
||||
try
|
||||
{
|
||||
modified_date = Utils.ToUnixTimestamp(fi.LastWriteTime.ToLocalTime()).ToString();
|
||||
created_date = Utils.ToUnixTimestamp(fi.CreationTime.ToLocalTime()).ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} Exception caught.", ex);
|
||||
}
|
||||
|
||||
currentFile.Properties.Add( "Modified", modified_date );
|
||||
currentFile.Properties.Add( "Created", created_date );
|
||||
currentFile.Properties.Add("Modified", modified_date);
|
||||
currentFile.Properties.Add("Created", created_date);
|
||||
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} Exception caught.", ex );
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} Exception caught.", ex);
|
||||
}
|
||||
|
||||
currentDir.Files.Add( currentFile );
|
||||
}
|
||||
currentDir.Files.Add(currentFile);
|
||||
}
|
||||
|
||||
result.Add( currentDir );
|
||||
}
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
Console.WriteLine( "{0} exception caught: {1}", ex, ex.Message );
|
||||
}
|
||||
result.Add(currentDir);
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} exception caught: {1}", ex, ex.Message);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Recursive function to get all folders and subfolders of given path path
|
||||
private static void DirSearch( string sDir, List<string> lstDirs, bool skipHidden, bool skipSystem, Stopwatch stopwatch, BackgroundWorker backgroundWorker )
|
||||
{
|
||||
if( backgroundWorker.CancellationPending ) return;
|
||||
// Recursive function to get all folders and subfolders of given path path
|
||||
private static void DirSearch(string sDir, List<string> lstDirs, bool skipHidden, bool skipSystem, Stopwatch stopwatch, BackgroundWorker backgroundWorker)
|
||||
{
|
||||
if (backgroundWorker.CancellationPending) return;
|
||||
|
||||
try
|
||||
{
|
||||
foreach( string d in System.IO.Directory.GetDirectories( sDir ) )
|
||||
{
|
||||
bool includeThisFolder = true;
|
||||
try
|
||||
{
|
||||
foreach (string d in System.IO.Directory.GetDirectories(sDir))
|
||||
{
|
||||
bool includeThisFolder = true;
|
||||
|
||||
//if( d.ToUpper().EndsWith( "SYSTEM VOLUME INFORMATION" ) ) includeThisFolder = false;
|
||||
//if( d.ToUpper().EndsWith( "SYSTEM VOLUME INFORMATION" ) ) includeThisFolder = false;
|
||||
|
||||
// exclude folders that have the system or hidden attr set (if required)
|
||||
if( skipHidden || skipSystem )
|
||||
{
|
||||
var attr = new DirectoryInfo( d ).Attributes;
|
||||
// exclude folders that have the system or hidden attr set (if required)
|
||||
if (skipHidden || skipSystem)
|
||||
{
|
||||
var attr = new DirectoryInfo(d).Attributes;
|
||||
|
||||
if( skipHidden )
|
||||
{
|
||||
if( ( attr & FileAttributes.Hidden ) == FileAttributes.Hidden )
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
if (skipHidden)
|
||||
{
|
||||
if ((attr & FileAttributes.Hidden) == FileAttributes.Hidden)
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
|
||||
if( skipSystem )
|
||||
{
|
||||
if( ( attr & FileAttributes.System ) == FileAttributes.System )
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (skipSystem)
|
||||
{
|
||||
if ((attr & FileAttributes.System) == FileAttributes.System)
|
||||
{
|
||||
includeThisFolder = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( includeThisFolder )
|
||||
{
|
||||
lstDirs.Add( d );
|
||||
if (includeThisFolder)
|
||||
{
|
||||
lstDirs.Add(d);
|
||||
|
||||
if( stopwatch.ElapsedMilliseconds >= 50 )
|
||||
{
|
||||
backgroundWorker.ReportProgress( 0, "Getting folders... " + lstDirs.Count + " (" + d + ")" );
|
||||
stopwatch.Restart();
|
||||
}
|
||||
if (stopwatch.ElapsedMilliseconds >= 50)
|
||||
{
|
||||
backgroundWorker.ReportProgress(0, "Getting folders... " + lstDirs.Count + " (" + d + ")");
|
||||
stopwatch.Restart();
|
||||
}
|
||||
|
||||
DirSearch( d, lstDirs, skipHidden, skipSystem, stopwatch, backgroundWorker );
|
||||
}
|
||||
}
|
||||
}
|
||||
catch( System.Exception ex )
|
||||
{
|
||||
Console.WriteLine( "ERROR in DirSearch():" + ex.Message );
|
||||
}
|
||||
}
|
||||
DirSearch(d, lstDirs, skipHidden, skipSystem, stopwatch, backgroundWorker);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Console.WriteLine("ERROR in DirSearch():" + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private static void BuildJavascriptContentArray( List<SnappedFolder> content, int startIndex, StreamWriter writer, BackgroundWorker bgWorker )
|
||||
{
|
||||
// Data format:
|
||||
// Each index in "dirs" array is an array representing a directory:
|
||||
// First item in array: "directory path*always 0*directory modified date"
|
||||
// Note that forward slashes are used instead of (Windows style) backslashes
|
||||
// Then, for each each file in the directory: "filename*size of file*file modified date"
|
||||
// Second to last item in array tells the total size of directory content
|
||||
// Last item in array refrences IDs to all subdirectories of this dir (if any).
|
||||
// ID is the item index in dirs array.
|
||||
// Note: Modified date is in UNIX format
|
||||
private static void BuildJavascriptContentArray(List<SnappedFolder> content, int startIndex, StreamWriter writer, BackgroundWorker bgWorker)
|
||||
{
|
||||
// Data format:
|
||||
// Each index in "dirs" array is an array representing a directory:
|
||||
// First item in array: "directory path*always 0*directory modified date"
|
||||
// Note that forward slashes are used instead of (Windows style) backslashes
|
||||
// Then, for each each file in the directory: "filename*size of file*file modified date"
|
||||
// Second to last item in array tells the total size of directory content
|
||||
// Last item in array refrences IDs to all subdirectories of this dir (if any).
|
||||
// ID is the item index in dirs array.
|
||||
// Note: Modified date is in UNIX format
|
||||
|
||||
var lineBreakSymbol = ""; // Could be set to \n to make the html output more readable, at the expense of increased size
|
||||
var lineBreakSymbol = ""; // Could be set to \n to make the html output more readable, at the expense of increased size
|
||||
|
||||
// Assign an ID to each folder. This is equal to the index in the JS data array
|
||||
var dirIndexes = new Dictionary<string, string>();
|
||||
for( var i = 0; i < content.Count; i++ )
|
||||
{
|
||||
dirIndexes.Add( content[i].FullPath, ( i + startIndex ).ToString() );
|
||||
}
|
||||
// Assign an ID to each folder. This is equal to the index in the JS data array
|
||||
var dirIndexes = new Dictionary<string, string>();
|
||||
for (var i = 0; i < content.Count; i++)
|
||||
{
|
||||
dirIndexes.Add(content[i].GetFullPath(), (i + startIndex).ToString());
|
||||
}
|
||||
|
||||
// Build a lookup table with subfolder IDs for each folder
|
||||
var subdirs = new Dictionary<string, List<string>>();
|
||||
foreach( var dir in content )
|
||||
{
|
||||
subdirs.Add( dir.FullPath, new List<string>() );
|
||||
}
|
||||
if( !subdirs.ContainsKey( content[0].Path ) && content[0].Name != "" )
|
||||
{
|
||||
subdirs.Add( content[0].Path, new List<string>() );
|
||||
}
|
||||
foreach( var dir in content )
|
||||
{
|
||||
if( dir.Name != "" )
|
||||
{
|
||||
try
|
||||
{
|
||||
subdirs[dir.Path].Add( dirIndexes[dir.FullPath] );
|
||||
}
|
||||
catch( Exception ex )
|
||||
{
|
||||
// orphan file or folder?
|
||||
}
|
||||
}
|
||||
}
|
||||
// Build a lookup table with subfolder IDs for each folder
|
||||
var subdirs = new Dictionary<string, List<string>>();
|
||||
foreach (var dir in content)
|
||||
{
|
||||
// add all folders as keys
|
||||
subdirs.Add(dir.GetFullPath(), new List<string>());
|
||||
}
|
||||
if (!subdirs.ContainsKey(content[0].Path) && content[0].Name != "")
|
||||
{
|
||||
// ensure that root folder is not missed missed
|
||||
subdirs.Add(content[0].Path, new List<string>());
|
||||
}
|
||||
foreach (var dir in content)
|
||||
{
|
||||
if (dir.Name != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
// for each folder, add its index to its parent folder list of subdirs
|
||||
subdirs[dir.Path].Add(dirIndexes[dir.GetFullPath()]);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// orphan file or folder?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the data array
|
||||
var result = new StringBuilder();
|
||||
foreach( var currentDir in content )
|
||||
{
|
||||
result.Append( "D.p([" + lineBreakSymbol );
|
||||
// Generate the data array
|
||||
var result = new StringBuilder();
|
||||
foreach (var currentDir in content)
|
||||
{
|
||||
result.Append("D.p([" + lineBreakSymbol);
|
||||
|
||||
var sDirWithForwardSlash = currentDir.FullPath.Replace( @"\", "/" );
|
||||
result.Append( "\"" ).Append( Utils.MakeCleanJsString( sDirWithForwardSlash ) ).Append( "*" ).Append( "0" ).Append( "*" ).Append( currentDir.GetProp( "Modified" ) ).Append( "\"," + lineBreakSymbol );
|
||||
var sDirWithForwardSlash = currentDir.GetFullPath().Replace(@"\", "/");
|
||||
result.Append("\"").Append(Utils.MakeCleanJsString(sDirWithForwardSlash)).Append("*").Append("0").Append("*").Append(currentDir.GetProp("Modified")).Append("\"," + lineBreakSymbol);
|
||||
|
||||
long dirSize = 0;
|
||||
long dirSize = 0;
|
||||
|
||||
foreach( var currentFile in currentDir.Files )
|
||||
{
|
||||
result.Append( "\"" ).Append( Utils.MakeCleanJsString( currentFile.Name ) ).Append( "*" ).Append( currentFile.GetProp( "Size" ) ).Append( "*" ).Append( currentFile.GetProp( "Modified" ) ).Append( "\"," + lineBreakSymbol );
|
||||
dirSize += Utils.ParseLong( currentFile.GetProp( "Size" ) );
|
||||
}
|
||||
foreach (var currentFile in currentDir.Files)
|
||||
{
|
||||
result.Append("\"").Append(Utils.MakeCleanJsString(currentFile.Name)).Append("*").Append(currentFile.GetProp("Size")).Append("*").Append(currentFile.GetProp("Modified")).Append("\"," + lineBreakSymbol);
|
||||
dirSize += Utils.ParseLong(currentFile.GetProp("Size"));
|
||||
}
|
||||
|
||||
// Add total dir size
|
||||
result.Append( "" ).Append( dirSize ).Append( "," + lineBreakSymbol );
|
||||
// Add total dir size
|
||||
result.Append("").Append(dirSize).Append("," + lineBreakSymbol);
|
||||
|
||||
// Add reference to subdirs
|
||||
result.Append( "\"" ).Append( String.Join( "*", subdirs[currentDir.FullPath].ToArray() ) ).Append( "\"" + lineBreakSymbol ); // subdirs
|
||||
// Add reference to subdirs
|
||||
result.Append("\"").Append(String.Join("*", subdirs[currentDir.GetFullPath()].ToArray())).Append("\"" + lineBreakSymbol);
|
||||
|
||||
// Finalize
|
||||
result.Append( "])" );
|
||||
result.Append( "\n" );
|
||||
// Finalize
|
||||
result.Append("])");
|
||||
result.Append("\n");
|
||||
|
||||
// Write result in chunks to limit memory consumtion
|
||||
if( result.Length > 10240 )
|
||||
{
|
||||
writer.Write( result.ToString() );
|
||||
result.Clear();
|
||||
}
|
||||
// Write result in chunks to limit memory consumption
|
||||
if (result.Length > 10240)
|
||||
{
|
||||
writer.Write(result.ToString());
|
||||
result.Clear();
|
||||
}
|
||||
|
||||
if( bgWorker.CancellationPending )
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (bgWorker.CancellationPending)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
writer.Write( result.ToString() );
|
||||
writer.Write(result.ToString());
|
||||
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!DOCTYPE HTML>
|
||||
<!DOCTYPE HTML>
|
||||
<!-- saved from url=(0016)http://localhost -->
|
||||
<!-- This file was generated by [APP NAME] [APP VER] at [GEN DATE] [GEN TIME]. See [APP LINK] for more information -->
|
||||
<html>
|
||||
@ -172,6 +172,22 @@
|
||||
|
||||
.list_files {
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.search_indicator {
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
top: 0px;
|
||||
bottom: 0px;
|
||||
background-color: white;
|
||||
opacity: 0.7;
|
||||
text-align: center;
|
||||
padding-top: 100px;
|
||||
font-size: 18px;
|
||||
display: none;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
/* --- Splitter --- */
|
||||
@ -188,6 +204,7 @@
|
||||
font-family:arial;
|
||||
background-color: #cdcdcd;
|
||||
font-size: 8pt;
|
||||
line-height: 1.25em;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
border-spacing: 0px;
|
||||
@ -216,7 +233,11 @@
|
||||
border-top: 1px solid #e0e0e0;
|
||||
padding: 3px 4px 3px 4px;
|
||||
}
|
||||
#files.tablesorter tbody tr:nth-child(even) td {
|
||||
|
||||
#files.tablesorter:not(.has-parent-folder) tbody tr:nth-child(even) td {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
#files.tablesorter.has-parent-folder tbody tr:nth-child(odd) td {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
@ -276,6 +297,28 @@
|
||||
}
|
||||
|
||||
|
||||
/* make room for [..] */
|
||||
#files.tablesorter.has-parent-folder th {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
|
||||
#files.tablesorter.has-parent-folder tbody tr:first-child td {
|
||||
border-top: 20px solid white;
|
||||
}
|
||||
#parent_folder {
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
left: 4px;
|
||||
}
|
||||
#parent_folder_border {
|
||||
background-color: #e0e0e0;
|
||||
height: 1px;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
top: 42px;
|
||||
}
|
||||
|
||||
|
||||
/* --- Breadcrumb --- */
|
||||
|
||||
.list_header {
|
||||
@ -369,7 +412,7 @@
|
||||
}
|
||||
.export_text {
|
||||
width: 100%;
|
||||
height: calc(100% - 5em); /* two .export_options => 4em + save link*/
|
||||
height: calc(100% - 5.25em); /* two .export_options => 4em + save link*/
|
||||
}
|
||||
.export_close:link, .export_close:visited {
|
||||
float: right;
|
||||
@ -773,6 +816,7 @@
|
||||
var originalHash = location.hash.replace(/#/,"");
|
||||
var SelectedFolderID = "-1";
|
||||
var currentView;
|
||||
var onlyLinkExtensions = []; // example: ["jpg","png"]
|
||||
|
||||
/* --- Init --- */
|
||||
|
||||
@ -942,13 +986,17 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var showLocationColumn = true;
|
||||
|
||||
if( numberOfFiles > 5000 ) {
|
||||
$("#list_header").html( "Searching..." );
|
||||
$("#search_indicator").show();
|
||||
//$("#list_header").html( "Searching..." );
|
||||
showLocationColumn = false;
|
||||
}
|
||||
|
||||
location.hash = "";
|
||||
|
||||
setTimeout(function(){ // timeout allows redrawing screen before possible timeconsuming search
|
||||
setTimeout(function(){ // timeout allows redrawing screen before possible time consuming search
|
||||
|
||||
if( SelectedFolderID != -1 )
|
||||
{
|
||||
@ -1005,9 +1053,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
var locationHtml = "";
|
||||
|
||||
if(showLocationColumn) locationHtml = "<th>Folder</th>";
|
||||
|
||||
currentView = [];
|
||||
var table_html = "";
|
||||
table_html += "<table id='files' class='tablesorter'><thead><tr><th>Name</th><th>Folder</th><th>Size</th><th>Modified</th></tr></thead><tbody>\n";
|
||||
table_html += "<table id='files' class='tablesorter'><thead><tr><th>Name</th>" +
|
||||
locationHtml +
|
||||
"<th>Size</th><th>Modified</th></tr></thead><tbody>";
|
||||
|
||||
var countFiles = 0;
|
||||
var countDirs = 0;
|
||||
@ -1051,18 +1105,23 @@
|
||||
sizeDirs += SearchFilenames[index][1];
|
||||
var subdir_id = parent_folders[ SearchLocationsID[index] ];
|
||||
|
||||
var located_in = SearchLocations[index];
|
||||
if( located_in === "" ) located_in = "[.]"
|
||||
located_in = located_in.substring( 0, located_in.lastIndexOf("\\") );
|
||||
var timestamp = timestampToDate(SearchFilenames[index][2]);
|
||||
|
||||
locationHtml = "";
|
||||
if(showLocationColumn) {
|
||||
var located_in = SearchLocations[index];
|
||||
if( located_in === "" ) located_in = "[.]"
|
||||
located_in = located_in.substring( 0, located_in.lastIndexOf("\\") );
|
||||
locationHtml = "<td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + subdir_id + "\"> " + located_in + "</a></span></td>";
|
||||
}
|
||||
|
||||
table_html +=
|
||||
"<tr>" +
|
||||
"<td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + SearchLocationsID[index] + "\"> " + SearchFilenames[index][3] + "</a></span></td>" +
|
||||
"<td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + subdir_id + "\"> " + located_in + "</a></span></td>" +
|
||||
locationHtml +
|
||||
"<td class='size' data-sort='" + SearchFilenames[index][1] + "'>" + bytesToSize( SearchFilenames[index][1] ) + "</td>" +
|
||||
"<td class='date' data-sort='" + SearchFilenames[index][2] + "'>" + timestamp + "</td>" +
|
||||
"</tr>\n";
|
||||
"</tr>";
|
||||
currentView.push( { "name": SearchFilenames[index][3], "path": SearchLocationsRaw[index].replace(/\//g,"\\"), "type": "dir", "size": SearchFilenames[index][1], "date": SearchFilenames[index][2] } );
|
||||
}
|
||||
else // files
|
||||
@ -1074,41 +1133,51 @@
|
||||
|
||||
if( linkFiles )
|
||||
{
|
||||
file_tmp = linkProtocol + linkRoot + dir_tmp.replace("\\","/") + SearchFilenames[index][3] + "\">";
|
||||
if( navigator.userAgent.toLowerCase().indexOf("msie") !== -1 && linkProtocol.indexOf("file:") !== -1 )
|
||||
{
|
||||
file_tmp = "javascript:alert('Internet Explorer does not allow linking to local files...')" + "\">";
|
||||
}
|
||||
if( file_tmp.substr(0,1) === "/" ) file_tmp = file_tmp.substr(1);
|
||||
file_tmp = file_tmp.replace(/\\/g,"/");
|
||||
file_tmp = file_tmp.replace(/#/g,"%23");
|
||||
|
||||
var indx = file_tmp.indexOf("://");
|
||||
if( indx !== -1 )
|
||||
{
|
||||
var protocol_tmp = file_tmp.substr(0,indx+3);
|
||||
file_tmp = file_tmp.substr(indx+3);
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
file_tmp = protocol_tmp + file_tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
}
|
||||
var ext = file_tmp.split('.').pop();
|
||||
if(onlyLinkExtensions.length === 0 || onlyLinkExtensions.indexOf(ext) !== -1) {
|
||||
|
||||
file_tmp = "<a href=\"" + file_tmp + SearchFilenames[index][3] + "</a>";
|
||||
file_tmp = linkProtocol + linkRoot + dir_tmp.replace("\\","/") + SearchFilenames[index][3] + "\">";
|
||||
if( navigator.userAgent.toLowerCase().indexOf("msie") !== -1 && linkProtocol.indexOf("file:") !== -1 )
|
||||
{
|
||||
file_tmp = "javascript:alert('Internet Explorer does not allow linking to local files...')" + "\">";
|
||||
}
|
||||
if( file_tmp.substr(0,1) === "/" ) file_tmp = file_tmp.substr(1);
|
||||
file_tmp = file_tmp.replace(/\\/g,"/");
|
||||
file_tmp = file_tmp.replace(/#/g,"%23");
|
||||
|
||||
var indx = file_tmp.indexOf("://");
|
||||
if( indx !== -1 )
|
||||
{
|
||||
var protocol_tmp = file_tmp.substr(0,indx+3);
|
||||
file_tmp = file_tmp.substr(indx+3);
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
file_tmp = protocol_tmp + file_tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
}
|
||||
|
||||
file_tmp = "<a href=\"" + file_tmp + SearchFilenames[index][3] + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var located_in = SearchLocations[index];
|
||||
if( located_in === "" ) located_in = "[.]"
|
||||
locationHtml = "";
|
||||
if(showLocationColumn) {
|
||||
var located_in = SearchLocations[index];
|
||||
if( located_in === "" ) located_in = "[.]"
|
||||
locationHtml = "<td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + SearchLocationsID[index] + "\"> " + located_in + "</a></span></td>";
|
||||
}
|
||||
|
||||
|
||||
var timestamp = timestampToDate(SearchFilenames[index][2]);
|
||||
table_html +=
|
||||
"<tr>" +
|
||||
"<td><span class='file'>" + file_tmp + "</span></td>" +
|
||||
"<td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + SearchLocationsID[index] + "\"> " + located_in + "</a></span></td>" +
|
||||
locationHtml +
|
||||
"<td class='size' data-sort='" + SearchFilenames[index][1] + "'>" + bytesToSize( SearchFilenames[index][1] ) + "</td>" +
|
||||
"<td class='date' data-sort='" + SearchFilenames[index][2] + "'>" + timestamp + "</td>" +
|
||||
"</tr>\n";
|
||||
"</tr>";
|
||||
|
||||
currentView.push( { "name": SearchFilenames[index][3], "path": SearchLocationsRaw[index].replace(/\//g,"\\"), "type": "file", "size": SearchFilenames[index][1], "date": SearchFilenames[index][2] } );
|
||||
|
||||
@ -1138,24 +1207,28 @@
|
||||
}
|
||||
}
|
||||
|
||||
table_html += "</tbody></table>\n";
|
||||
table_html += "</tbody></table>";
|
||||
|
||||
$("#list_header").html( "Search Results <span class='path_divider'></span>" );
|
||||
document.getElementById("list_files").innerHTML = table_html;
|
||||
$("#search_indicator").hide();
|
||||
addFolderClickEventHandlers();
|
||||
|
||||
var tablesorterHeaders = { 1 : { sorter: 'datasort' }, 2 : { sorter: 'datasort' } }
|
||||
if(showLocationColumn) {
|
||||
tablesorterHeaders = { 2 : { sorter: 'datasort' }, 3 : { sorter: 'datasort' } }
|
||||
}
|
||||
|
||||
$("#files").tablesorter({
|
||||
sortInitialOrder: "desc",
|
||||
headers: {
|
||||
2 : { sorter: 'datasort' },
|
||||
3 : { sorter: 'datasort' }
|
||||
}
|
||||
headers: tablesorterHeaders
|
||||
});
|
||||
|
||||
var sFiles = " files"; if(countFiles===1) sFiles = " file";
|
||||
var sDirs = " folders"; if(countDirs===1) sDirs = " folder";
|
||||
$("#list_footer_info_label").html( countDirs + sDirs + " (" + bytesToSize( sizeDirs , 0 ) + "), " + countFiles + sFiles + " (" + bytesToSize( sizeFiles , 0 ) + ")" );
|
||||
|
||||
}, 1); // end setTimeout before search
|
||||
}, 50); // end setTimeout before search
|
||||
}; // end doSearch()
|
||||
|
||||
|
||||
@ -1192,14 +1265,20 @@
|
||||
$("#list_header").html( breadcrumbs );
|
||||
|
||||
var table_html = "";
|
||||
table_html += "<table id='files' class='tablesorter'><thead><th>Name</th><th>Size</th><th>Modified</th></tr></thead><tbody>\n";
|
||||
var showParentFolderClass = "";
|
||||
if( FolderID != 0 ) {
|
||||
showParentFolderClass = " has-parent-folder"
|
||||
table_html += "<span id='parent_folder' class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + parent_folders[FolderID] + "\"> [..]</a></span>\n";
|
||||
table_html += "<div id='parent_folder_border'></div>";
|
||||
}
|
||||
table_html += "<table id='files' class='tablesorter" + showParentFolderClass + "'><thead><th>Name</th><th>Size</th><th>Modified</th></tr></thead><tbody>\n";
|
||||
|
||||
currentView = [];
|
||||
var countFiles = 0;
|
||||
var countDirs = 0;
|
||||
var subdirTotSizes = 0;
|
||||
|
||||
// folders
|
||||
if( FolderID != 0 ) table_html += "<tr><td><span class='file_folder'><a href=\"#\" class=\"folder_link\" id=\"" + parent_folders[FolderID] + "\"> [..]</a></span></td><td></td><td></td></tr>\n";
|
||||
var subdirs = getSubdirs( SelectedFolderID );
|
||||
if( subdirs != "" )
|
||||
{
|
||||
@ -1231,29 +1310,33 @@
|
||||
if( dir_tmp != "" ) dir_tmp += "/";
|
||||
if( linkFiles )
|
||||
{
|
||||
file_tmp = linkProtocol + linkRoot + dir_tmp + sTmp[0] + "\">";
|
||||
if( navigator.userAgent.toLowerCase().indexOf("msie") !== -1 && linkProtocol.indexOf("file:") !== -1 )
|
||||
{
|
||||
file_tmp = "javascript:alert('Internet Explorer does not allow linking to local files...')" + "\">";
|
||||
}
|
||||
if( file_tmp.substr(0,1) === "/" ) file_tmp = file_tmp.substr(1);
|
||||
file_tmp = file_tmp.replace(/\\/g,"/");
|
||||
file_tmp = file_tmp.replace(/#/g,"%23");
|
||||
|
||||
var indx = file_tmp.indexOf("://");
|
||||
if( indx !== -1 )
|
||||
{
|
||||
var protocol_tmp = file_tmp.substr(0,indx+3);
|
||||
file_tmp = file_tmp.substr(indx+3);
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
file_tmp = protocol_tmp + file_tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
}
|
||||
var ext = file_tmp.split('.').pop();
|
||||
if(onlyLinkExtensions.length === 0 || onlyLinkExtensions.indexOf(ext) !== -1) {
|
||||
file_tmp = linkProtocol + linkRoot + dir_tmp + sTmp[0] + "\">";
|
||||
if( navigator.userAgent.toLowerCase().indexOf("msie") !== -1 && linkProtocol.indexOf("file:") !== -1 )
|
||||
{
|
||||
file_tmp = "javascript:alert('Internet Explorer does not allow linking to local files...')" + "\">";
|
||||
}
|
||||
if( file_tmp.substr(0,1) === "/" ) file_tmp = file_tmp.substr(1);
|
||||
file_tmp = file_tmp.replace(/\\/g,"/");
|
||||
file_tmp = file_tmp.replace(/#/g,"%23");
|
||||
|
||||
file_tmp = "<a href=\"" + file_tmp + sTmp[0] + "</a>";
|
||||
var indx = file_tmp.indexOf("://");
|
||||
if( indx !== -1 )
|
||||
{
|
||||
var protocol_tmp = file_tmp.substr(0,indx+3);
|
||||
file_tmp = file_tmp.substr(indx+3);
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
file_tmp = protocol_tmp + file_tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
file_tmp = file_tmp.replace(/\/\//g,"/");
|
||||
}
|
||||
|
||||
file_tmp = "<a href=\"" + file_tmp + sTmp[0] + "</a>";
|
||||
}
|
||||
}
|
||||
|
||||
var timestamp = timestampToDate(sTmp[2]);
|
||||
@ -1600,7 +1683,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Save export to local file. Based on https://stackoverflow.com/a/29304414/1087811
|
||||
function downloadToFile(content, fileName, mimeType) {
|
||||
var a = document.createElement('a');
|
||||
@ -1648,10 +1730,12 @@
|
||||
<div id="loading" class="loading"><b>Loading...</b><p class="loading_info">(if nothing happens, make sure javascript is enabled and allowed to execute, or try another browser)</p></div>
|
||||
|
||||
<div id="content" class="content">
|
||||
|
||||
<div id="treeview" class="treeview"></div>
|
||||
|
||||
<div id="list_container" class="list_container">
|
||||
<div id="search_indicator" class="search_indicator">
|
||||
Searching...
|
||||
</div>
|
||||
<div id="list_header" class="list_header"></div>
|
||||
<div id="list_files" class="list_files"></div>
|
||||
<div id="list_footer" class='list_footer'>
|
||||
@ -1659,7 +1743,6 @@
|
||||
<span id="list_footer_info_label"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user