Archived
Changed: purge
This commit is contained in:
1 parent
a85699f751
commit
c96adbd366
132 files changed
-16294
No files matched your search
@@ -1,41 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AppLauncher.Models
|
||||
{
|
||||
public class LauncherSession
|
||||
{
|
||||
public class HotKeyOptions
|
||||
{
|
||||
public bool IsCtrl { get; set; } = false;
|
||||
public bool IsAlt { get; set; } = false;
|
||||
public bool IsShift { get; set; } = false;
|
||||
public int Key { get; set; } = (int)System.Windows.Forms.Keys.None;
|
||||
|
||||
public int ModifierCode => ((this.IsAlt ? 1 : 0) + (this.IsCtrl ? 2 : 0) + (this.IsShift ? 4 : 0));
|
||||
|
||||
public System.Windows.Forms.Keys KeyCode => (System.Windows.Forms.Keys)this.Key;
|
||||
}
|
||||
|
||||
public enum AutoSaveOption
|
||||
{
|
||||
Prompt = 0,
|
||||
Yes,
|
||||
No
|
||||
}
|
||||
|
||||
public int DefaultHeight { get; set; } = 280;
|
||||
public HotKeyOptions HotKey { get; set; } = null;
|
||||
|
||||
public bool AlwaysOnTop { get; set; } = false;
|
||||
public bool EnableAnimation { get; set; } = false;
|
||||
public bool EnableBigIconInFolder { get; set; } = false;
|
||||
|
||||
public bool HideOnClose { get; set; } = false;
|
||||
public bool HideOnClick { get; set; } = false;
|
||||
public AutoSaveOption AutoSave { get; set; } = AutoSaveOption.Prompt;
|
||||
public List<TileGroupModel> Groups { get; set; } = new List<TileGroupModel>();
|
||||
public Point StartPosition { get; set; } = Point.Empty;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AppLauncher.Models
|
||||
{
|
||||
public class TileGroupModel
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public bool IsExpanded { get; set; } = false;
|
||||
public bool IsExclusive { get; set; } = false;
|
||||
public List<TileModel> Items { get; set; } = new List<TileModel>();
|
||||
public Size GridSize = new Size(0, 0);
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
|
||||
namespace AppLauncher.Models
|
||||
{
|
||||
public class TileModel
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string ProcessFilename { get; set; }
|
||||
public string ProcessArgument { get; set; }
|
||||
public string ProcessWorkingDirectory { get; set; }
|
||||
public ProcessWindowStyle ProcessWindowStyle { get; set; } = ProcessWindowStyle.Normal;
|
||||
public bool ProcessAsAdmin { get; set; } = false;
|
||||
public Point Position { get; set; }
|
||||
|
||||
public bool IsGroup { get; set; } = false;
|
||||
public List<TileModel> Items { get; set; } = new List<TileModel>();
|
||||
|
||||
public override string ToString() => this.Title ?? string.Empty;
|
||||
|
||||
public string CleanProcessFilename => (string.IsNullOrWhiteSpace(this.ProcessFilename) ? string.Empty : resolvePath(this.ProcessFilename));
|
||||
|
||||
public string CleanProcessArgument => (string.IsNullOrWhiteSpace(this.ProcessArgument) ? string.Empty : resolvePath(this.ProcessArgument));
|
||||
|
||||
public string CleanProcessWorkingDirectory => (string.IsNullOrWhiteSpace(this.ProcessWorkingDirectory) ? string.Empty : resolvePath(this.ProcessWorkingDirectory));
|
||||
|
||||
protected string resolvePath(string value)
|
||||
{
|
||||
string rv = Environment.ExpandEnvironmentVariables(value);
|
||||
|
||||
rv = resolveFirstPath(rv);
|
||||
rv = resolveLastPath(rv);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
protected string resolveFirstPath(string value)
|
||||
{
|
||||
const string last = "%FIRST%";
|
||||
if (!value.Contains(last))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
string head = value.Substring(0, value.IndexOf(last));
|
||||
string tail = value.Substring(value.IndexOf(last) + last.Length);
|
||||
|
||||
string[] dirList = new string[0];
|
||||
|
||||
try
|
||||
{
|
||||
dirList = System.IO.Directory.GetDirectories(head, "*", System.IO.SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
if (dirList.Length <= 0)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
return dirList[0] + tail;
|
||||
}
|
||||
|
||||
protected string resolveLastPath(string value)
|
||||
{
|
||||
const string last = "%LAST%";
|
||||
if (!value.Contains(last))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
string head = value.Substring(0, value.IndexOf(last));
|
||||
string tail = value.Substring(value.IndexOf(last) + last.Length);
|
||||
|
||||
string[] dirList = new string[0];
|
||||
|
||||
try
|
||||
{
|
||||
dirList = System.IO.Directory.GetDirectories(head, "*", System.IO.SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
if (dirList.Length <= 0)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
return dirList[(dirList.Length - 1)] + tail;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user