mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Added code menu to screen color picker textbox, improvements to CodeMenuEntry
This commit is contained in:
parent
0dd8f40b61
commit
e6a894dd3b
16 changed files with 210 additions and 226 deletions
|
@ -23,25 +23,26 @@ You should have received a copy of the GNU General Public License
|
|||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public abstract class CodeMenuEntry
|
||||
{
|
||||
protected readonly string _value, _description, _category;
|
||||
protected abstract string Prefix { get; }
|
||||
|
||||
public string Value { get; private set; }
|
||||
public string Description { get; private set; }
|
||||
public string Category { get; private set; }
|
||||
|
||||
public CodeMenuEntry(string value, string description, string category = null)
|
||||
{
|
||||
_value = value;
|
||||
_description = description;
|
||||
_category = category;
|
||||
Value = value;
|
||||
Description = description;
|
||||
Category = category;
|
||||
}
|
||||
|
||||
public string Value { get { return _value; } }
|
||||
public string Description { get { return _description; } }
|
||||
public string Category { get { return _category; } }
|
||||
|
||||
public abstract string ToPrefixString();
|
||||
public string ToPrefixString()
|
||||
{
|
||||
return Prefix + Value;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,22 +24,18 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib.Properties;
|
||||
using System;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public class ActionsCodeMenuEntry : CodeMenuEntry
|
||||
public class CodeMenuEntryActions : CodeMenuEntry
|
||||
{
|
||||
public ActionsCodeMenuEntry(string value, string description) : base(value, description)
|
||||
protected override string Prefix { get; } = "%";
|
||||
|
||||
public static readonly CodeMenuEntryActions FilePath = new CodeMenuEntryActions("input", Resources.ActionsCodeMenuEntry_FilePath_File_path);
|
||||
public static readonly CodeMenuEntryActions OutputFilePath = new CodeMenuEntryActions("output", Resources.ActionsCodeMenuEntry_OutputFilePath_File_path_without_extension____Output_file_name_extension_);
|
||||
|
||||
public CodeMenuEntryActions(string value, string description) : base(value, description)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToPrefixString()
|
||||
{
|
||||
return '%' + _value;
|
||||
}
|
||||
|
||||
public static readonly ActionsCodeMenuEntry FilePath = new ActionsCodeMenuEntry("input", Resources.ActionsCodeMenuEntry_FilePath_File_path);
|
||||
public static readonly ActionsCodeMenuEntry OutputFilePath = new ActionsCodeMenuEntry("output", Resources.ActionsCodeMenuEntry_OutputFilePath_File_path_without_extension____Output_file_name_extension_);
|
||||
}
|
||||
}
|
71
ShareX.HelpersLib/NameParser/CodeMenuEntryFilename.cs
Normal file
71
ShareX.HelpersLib/NameParser/CodeMenuEntryFilename.cs
Normal file
|
@ -0,0 +1,71 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (c) 2007-2016 ShareX Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib.Properties;
|
||||
using System;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public class CodeMenuEntryFilename : CodeMenuEntry
|
||||
{
|
||||
protected override string Prefix { get; } = "%";
|
||||
|
||||
public static readonly CodeMenuEntryFilename t = new CodeMenuEntryFilename("t", Resources.ReplCodeMenuEntry_t_Title_of_active_window, Resources.ReplCodeMenuCategory_Target);
|
||||
public static readonly CodeMenuEntryFilename pn = new CodeMenuEntryFilename("pn", Resources.ReplCodeMenuEntry_pn_Process_name_of_active_window, Resources.ReplCodeMenuCategory_Target);
|
||||
public static readonly CodeMenuEntryFilename y = new CodeMenuEntryFilename("y", Resources.ReplCodeMenuEntry_y_Current_year, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename yy = new CodeMenuEntryFilename("yy", Resources.ReplCodeMenuEntry_yy_Current_year__2_digits_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename mo = new CodeMenuEntryFilename("mo", Resources.ReplCodeMenuEntry_mo_Current_month, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename mon = new CodeMenuEntryFilename("mon", Resources.ReplCodeMenuEntry_mon_Current_month_name__Local_language_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename mon2 = new CodeMenuEntryFilename("mon2", Resources.ReplCodeMenuEntry_mon2_Current_month_name__English_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename d = new CodeMenuEntryFilename("d", Resources.ReplCodeMenuEntry_d_Current_day, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename h = new CodeMenuEntryFilename("h", Resources.ReplCodeMenuEntry_h_Current_hour, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename mi = new CodeMenuEntryFilename("mi", Resources.ReplCodeMenuEntry_mi_Current_minute, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename s = new CodeMenuEntryFilename("s", Resources.ReplCodeMenuEntry_s_Current_second, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename ms = new CodeMenuEntryFilename("ms", Resources.ReplCodeMenuEntry_ms_Current_millisecond, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename pm = new CodeMenuEntryFilename("pm", Resources.ReplCodeMenuEntry_pm_Gets_AM_PM, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename w = new CodeMenuEntryFilename("w", Resources.ReplCodeMenuEntry_w_Current_week_name__Local_language_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename w2 = new CodeMenuEntryFilename("w2", Resources.ReplCodeMenuEntry_w2_Current_week_name__English_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename unix = new CodeMenuEntryFilename("unix", Resources.ReplCodeMenuEntry_unix_Unix_timestamp, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly CodeMenuEntryFilename i = new CodeMenuEntryFilename("i", Resources.ReplCodeMenuEntry_i_Auto_increment_number, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly CodeMenuEntryFilename ia = new CodeMenuEntryFilename("ia", Resources.ReplCodeMenuEntry_ia_Auto_increment_alphanumeric, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly CodeMenuEntryFilename iAa = new CodeMenuEntryFilename("iAa", Resources.ReplCodeMenuEntry_iAa_Auto_increment_alphanumeric_all, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly CodeMenuEntryFilename ib = new CodeMenuEntryFilename("ib", Resources.ReplCodeMenuEntry_ib_Auto_increment_base_alphanumeric, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly CodeMenuEntryFilename ix = new CodeMenuEntryFilename("ix", Resources.ReplCodeMenuEntry_ix_Auto_increment_hexadecimal, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly CodeMenuEntryFilename rn = new CodeMenuEntryFilename("rn", Resources.ReplCodeMenuEntry_rn_Random_number_0_to_9, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly CodeMenuEntryFilename ra = new CodeMenuEntryFilename("ra", Resources.ReplCodeMenuEntry_ra_Random_alphanumeric_char, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly CodeMenuEntryFilename rx = new CodeMenuEntryFilename("rx", Resources.ReplCodeMenuEntry_rx_Random_hexadecimal, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly CodeMenuEntryFilename guid = new CodeMenuEntryFilename("guid", Resources.ReplCodeMenuEntry_guid_Random_guid, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly CodeMenuEntryFilename width = new CodeMenuEntryFilename("width", Resources.ReplCodeMenuEntry_width_Gets_image_width, Resources.ReplCodeMenuCategory_Image);
|
||||
public static readonly CodeMenuEntryFilename height = new CodeMenuEntryFilename("height", Resources.ReplCodeMenuEntry_height_Gets_image_height, Resources.ReplCodeMenuCategory_Image);
|
||||
public static readonly CodeMenuEntryFilename un = new CodeMenuEntryFilename("un", Resources.ReplCodeMenuEntry_un_User_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly CodeMenuEntryFilename uln = new CodeMenuEntryFilename("uln", Resources.ReplCodeMenuEntry_uln_User_login_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly CodeMenuEntryFilename cn = new CodeMenuEntryFilename("cn", Resources.ReplCodeMenuEntry_cn_Computer_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly CodeMenuEntryFilename n = new CodeMenuEntryFilename("n", Resources.ReplCodeMenuEntry_n_New_line);
|
||||
|
||||
public CodeMenuEntryFilename(string value, string description, string category = null) : base(value, description, category)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
44
ShareX.HelpersLib/NameParser/CodeMenuEntryPixelInfo.cs
Normal file
44
ShareX.HelpersLib/NameParser/CodeMenuEntryPixelInfo.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (c) 2007-2016 ShareX Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public class CodeMenuEntryPixelInfo : CodeMenuEntry
|
||||
{
|
||||
protected override string Prefix { get; } = "$";
|
||||
|
||||
public static readonly CodeMenuEntryPixelInfo x = new CodeMenuEntryPixelInfo("x", "X position");
|
||||
public static readonly CodeMenuEntryPixelInfo y = new CodeMenuEntryPixelInfo("y", "Y position");
|
||||
public static readonly CodeMenuEntryPixelInfo r = new CodeMenuEntryPixelInfo("r", "Red color (0-255)");
|
||||
public static readonly CodeMenuEntryPixelInfo g = new CodeMenuEntryPixelInfo("g", "Green color (0-255)");
|
||||
public static readonly CodeMenuEntryPixelInfo b = new CodeMenuEntryPixelInfo("b", "Blue color (0-255)");
|
||||
public static readonly CodeMenuEntryPixelInfo hex = new CodeMenuEntryPixelInfo("hex", "Hex color value");
|
||||
public static readonly CodeMenuEntryPixelInfo n = new CodeMenuEntryPixelInfo("n", "New line");
|
||||
|
||||
public CodeMenuEntryPixelInfo(string value, string description) : base(value, description)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -83,12 +83,12 @@ public string Parse(string pattern)
|
|||
{
|
||||
windowText = windowText.Remove(MaxTitleLength);
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.t.ToPrefixString(), windowText);
|
||||
sb.Replace(CodeMenuEntryFilename.t.ToPrefixString(), windowText);
|
||||
}
|
||||
|
||||
if (ProcessName != null)
|
||||
{
|
||||
sb.Replace(ReplCodeMenuEntry.pn.ToPrefixString(), ProcessName);
|
||||
sb.Replace(CodeMenuEntryFilename.pn.ToPrefixString(), ProcessName);
|
||||
}
|
||||
|
||||
string width = "", height = "";
|
||||
|
@ -103,8 +103,8 @@ public string Parse(string pattern)
|
|||
height = ImageHeight.ToString();
|
||||
}
|
||||
|
||||
sb.Replace(ReplCodeMenuEntry.width.ToPrefixString(), width);
|
||||
sb.Replace(ReplCodeMenuEntry.height.ToPrefixString(), height);
|
||||
sb.Replace(CodeMenuEntryFilename.width.ToPrefixString(), width);
|
||||
sb.Replace(CodeMenuEntryFilename.height.ToPrefixString(), height);
|
||||
|
||||
DateTime dt = DateTime.Now;
|
||||
|
||||
|
@ -113,16 +113,16 @@ public string Parse(string pattern)
|
|||
dt = TimeZoneInfo.ConvertTime(dt, CustomTimeZone);
|
||||
}
|
||||
|
||||
sb.Replace(ReplCodeMenuEntry.mon2.ToPrefixString(), CultureInfo.InvariantCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.mon.ToPrefixString(), CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.yy.ToPrefixString(), dt.ToString("yy"))
|
||||
.Replace(ReplCodeMenuEntry.y.ToPrefixString(), dt.Year.ToString())
|
||||
.Replace(ReplCodeMenuEntry.mo.ToPrefixString(), Helpers.AddZeroes(dt.Month))
|
||||
.Replace(ReplCodeMenuEntry.d.ToPrefixString(), Helpers.AddZeroes(dt.Day));
|
||||
sb.Replace(CodeMenuEntryFilename.mon2.ToPrefixString(), CultureInfo.InvariantCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(CodeMenuEntryFilename.mon.ToPrefixString(), CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(dt.Month))
|
||||
.Replace(CodeMenuEntryFilename.yy.ToPrefixString(), dt.ToString("yy"))
|
||||
.Replace(CodeMenuEntryFilename.y.ToPrefixString(), dt.Year.ToString())
|
||||
.Replace(CodeMenuEntryFilename.mo.ToPrefixString(), Helpers.AddZeroes(dt.Month))
|
||||
.Replace(CodeMenuEntryFilename.d.ToPrefixString(), Helpers.AddZeroes(dt.Day));
|
||||
|
||||
string hour;
|
||||
|
||||
if (sb.ToString().Contains(ReplCodeMenuEntry.pm.ToPrefixString()))
|
||||
if (sb.ToString().Contains(CodeMenuEntryFilename.pm.ToPrefixString()))
|
||||
{
|
||||
hour = Helpers.HourTo12(dt.Hour);
|
||||
}
|
||||
|
@ -131,36 +131,36 @@ public string Parse(string pattern)
|
|||
hour = Helpers.AddZeroes(dt.Hour);
|
||||
}
|
||||
|
||||
sb.Replace(ReplCodeMenuEntry.h.ToPrefixString(), hour)
|
||||
.Replace(ReplCodeMenuEntry.mi.ToPrefixString(), Helpers.AddZeroes(dt.Minute))
|
||||
.Replace(ReplCodeMenuEntry.s.ToPrefixString(), Helpers.AddZeroes(dt.Second))
|
||||
.Replace(ReplCodeMenuEntry.ms.ToPrefixString(), Helpers.AddZeroes(dt.Millisecond, 3))
|
||||
.Replace(ReplCodeMenuEntry.w2.ToPrefixString(), CultureInfo.InvariantCulture.DateTimeFormat.GetDayName(dt.DayOfWeek))
|
||||
.Replace(ReplCodeMenuEntry.w.ToPrefixString(), CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(dt.DayOfWeek))
|
||||
.Replace(ReplCodeMenuEntry.pm.ToPrefixString(), dt.Hour >= 12 ? "PM" : "AM");
|
||||
sb.Replace(CodeMenuEntryFilename.h.ToPrefixString(), hour)
|
||||
.Replace(CodeMenuEntryFilename.mi.ToPrefixString(), Helpers.AddZeroes(dt.Minute))
|
||||
.Replace(CodeMenuEntryFilename.s.ToPrefixString(), Helpers.AddZeroes(dt.Second))
|
||||
.Replace(CodeMenuEntryFilename.ms.ToPrefixString(), Helpers.AddZeroes(dt.Millisecond, 3))
|
||||
.Replace(CodeMenuEntryFilename.w2.ToPrefixString(), CultureInfo.InvariantCulture.DateTimeFormat.GetDayName(dt.DayOfWeek))
|
||||
.Replace(CodeMenuEntryFilename.w.ToPrefixString(), CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(dt.DayOfWeek))
|
||||
.Replace(CodeMenuEntryFilename.pm.ToPrefixString(), dt.Hour >= 12 ? "PM" : "AM");
|
||||
|
||||
sb.Replace(ReplCodeMenuEntry.unix.ToPrefixString(), DateTime.UtcNow.ToUnix().ToString());
|
||||
sb.Replace(CodeMenuEntryFilename.unix.ToPrefixString(), DateTime.UtcNow.ToUnix().ToString());
|
||||
|
||||
if (sb.ToString().Contains(ReplCodeMenuEntry.i.ToPrefixString())
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ib.ToPrefixString())
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ib.ToPrefixString().Replace('b', 'B'))
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.iAa.ToPrefixString())
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.iAa.ToPrefixString().Replace("Aa", "aA"))
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ia.ToPrefixString())
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ia.ToPrefixString().Replace('a', 'A'))
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ix.ToPrefixString())
|
||||
|| sb.ToString().Contains(ReplCodeMenuEntry.ix.ToPrefixString().Replace('x', 'X')))
|
||||
if (sb.ToString().Contains(CodeMenuEntryFilename.i.ToPrefixString())
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ib.ToPrefixString())
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ib.ToPrefixString().Replace('b', 'B'))
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.iAa.ToPrefixString())
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.iAa.ToPrefixString().Replace("Aa", "aA"))
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ia.ToPrefixString())
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ia.ToPrefixString().Replace('a', 'A'))
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ix.ToPrefixString())
|
||||
|| sb.ToString().Contains(CodeMenuEntryFilename.ix.ToPrefixString().Replace('x', 'X')))
|
||||
{
|
||||
AutoIncrementNumber++;
|
||||
|
||||
// Base
|
||||
try
|
||||
{
|
||||
foreach (Tuple<string, int[]> entry in ListEntryWithValues(sb.ToString(), ReplCodeMenuEntry.ib.ToPrefixString(), 2))
|
||||
foreach (Tuple<string, int[]> entry in ListEntryWithValues(sb.ToString(), CodeMenuEntryFilename.ib.ToPrefixString(), 2))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(entry.Item2[0], Helpers.AlphanumericInverse), entry.Item2[1]));
|
||||
}
|
||||
foreach (Tuple<string, int[]> entry in ListEntryWithValues(sb.ToString(), ReplCodeMenuEntry.ib.ToPrefixString().Replace('b', 'B'), 2))
|
||||
foreach (Tuple<string, int[]> entry in ListEntryWithValues(sb.ToString(), CodeMenuEntryFilename.ib.ToPrefixString().Replace('b', 'B'), 2))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(entry.Item2[0], Helpers.Alphanumeric), entry.Item2[1]));
|
||||
}
|
||||
|
@ -170,90 +170,90 @@ public string Parse(string pattern)
|
|||
}
|
||||
|
||||
// Alphanumeric Dual Case (Base 62)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.iAa.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.iAa.ToPrefixString()))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(62, Helpers.Alphanumeric), entry.Item2));
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.iAa.ToPrefixString(), AutoIncrementNumber.ToBase(62, Helpers.Alphanumeric));
|
||||
sb.Replace(CodeMenuEntryFilename.iAa.ToPrefixString(), AutoIncrementNumber.ToBase(62, Helpers.Alphanumeric));
|
||||
|
||||
// Alphanumeric Dual Case (Base 62)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.iAa.ToPrefixString().Replace("Aa", "aA")))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.iAa.ToPrefixString().Replace("Aa", "aA")))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(62, Helpers.AlphanumericInverse), entry.Item2));
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.iAa.ToPrefixString().Replace("Aa", "aA"), AutoIncrementNumber.ToBase(62, Helpers.AlphanumericInverse));
|
||||
sb.Replace(CodeMenuEntryFilename.iAa.ToPrefixString().Replace("Aa", "aA"), AutoIncrementNumber.ToBase(62, Helpers.AlphanumericInverse));
|
||||
|
||||
// Alphanumeric Single Case (Base 36)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.ia.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.ia.ToPrefixString()))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric), entry.Item2).ToLowerInvariant());
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.ia.ToPrefixString(), AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric).ToLowerInvariant());
|
||||
sb.Replace(CodeMenuEntryFilename.ia.ToPrefixString(), AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric).ToLowerInvariant());
|
||||
|
||||
// Alphanumeric Single Case Capital (Base 36)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.ia.ToPrefixString().Replace('a', 'A')))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.ia.ToPrefixString().Replace('a', 'A')))
|
||||
{
|
||||
sb.Replace(entry.Item1, Helpers.AddZeroes(AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric), entry.Item2).ToUpperInvariant());
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.ia.ToPrefixString().Replace('a', 'A'), AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric).ToUpperInvariant());
|
||||
sb.Replace(CodeMenuEntryFilename.ia.ToPrefixString().Replace('a', 'A'), AutoIncrementNumber.ToBase(36, Helpers.Alphanumeric).ToUpperInvariant());
|
||||
|
||||
// Hexadecimal (Base 16)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.ix.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.ix.ToPrefixString()))
|
||||
{
|
||||
sb.Replace(entry.Item1, AutoIncrementNumber.ToString("x" + entry.Item2.ToString()));
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.ix.ToPrefixString(), AutoIncrementNumber.ToString("x"));
|
||||
sb.Replace(CodeMenuEntryFilename.ix.ToPrefixString(), AutoIncrementNumber.ToString("x"));
|
||||
|
||||
// Hexadecimal Capital (Base 16)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.ix.ToPrefixString().Replace('x', 'X')))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.ix.ToPrefixString().Replace('x', 'X')))
|
||||
{
|
||||
sb.Replace(entry.Item1, AutoIncrementNumber.ToString("X" + entry.Item2.ToString()));
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.ix.ToPrefixString().Replace('x', 'X'), AutoIncrementNumber.ToString("X"));
|
||||
sb.Replace(CodeMenuEntryFilename.ix.ToPrefixString().Replace('x', 'X'), AutoIncrementNumber.ToString("X"));
|
||||
|
||||
// Number (Base 10)
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), ReplCodeMenuEntry.i.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(sb.ToString(), CodeMenuEntryFilename.i.ToPrefixString()))
|
||||
{
|
||||
sb.Replace(entry.Item1, AutoIncrementNumber.ToString("d" + entry.Item2.ToString()));
|
||||
}
|
||||
sb.Replace(ReplCodeMenuEntry.i.ToPrefixString(), AutoIncrementNumber.ToString("d"));
|
||||
sb.Replace(CodeMenuEntryFilename.i.ToPrefixString(), AutoIncrementNumber.ToString("d"));
|
||||
}
|
||||
|
||||
sb.Replace(ReplCodeMenuEntry.un.ToPrefixString(), Environment.UserName);
|
||||
sb.Replace(ReplCodeMenuEntry.uln.ToPrefixString(), Environment.UserDomainName);
|
||||
sb.Replace(ReplCodeMenuEntry.cn.ToPrefixString(), Environment.MachineName);
|
||||
sb.Replace(CodeMenuEntryFilename.un.ToPrefixString(), Environment.UserName);
|
||||
sb.Replace(CodeMenuEntryFilename.uln.ToPrefixString(), Environment.UserDomainName);
|
||||
sb.Replace(CodeMenuEntryFilename.cn.ToPrefixString(), Environment.MachineName);
|
||||
|
||||
if (Type == NameParserType.Text)
|
||||
{
|
||||
sb.Replace(ReplCodeMenuEntry.n.ToPrefixString(), Environment.NewLine);
|
||||
sb.Replace(CodeMenuEntryFilename.n.ToPrefixString(), Environment.NewLine);
|
||||
}
|
||||
|
||||
string result = sb.ToString();
|
||||
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, ReplCodeMenuEntry.rn.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, CodeMenuEntryFilename.rn.ToPrefixString()))
|
||||
{
|
||||
result = result.ReplaceAll(entry.Item1, () => Helpers.RepeatGenerator(entry.Item2, () => Helpers.GetRandomChar(Helpers.Numbers).ToString()));
|
||||
}
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, ReplCodeMenuEntry.ra.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, CodeMenuEntryFilename.ra.ToPrefixString()))
|
||||
{
|
||||
result = result.ReplaceAll(entry.Item1, () => Helpers.RepeatGenerator(entry.Item2, () => Helpers.GetRandomChar(Helpers.Alphanumeric).ToString()));
|
||||
}
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, ReplCodeMenuEntry.rx.ToPrefixString()))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, CodeMenuEntryFilename.rx.ToPrefixString()))
|
||||
{
|
||||
result = result.ReplaceAll(entry.Item1, () => Helpers.RepeatGenerator(entry.Item2, () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToLowerInvariant()).ToString()));
|
||||
}
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, ReplCodeMenuEntry.rx.ToPrefixString().Replace('x', 'X')))
|
||||
foreach (Tuple<string, int> entry in ListEntryWithValue(result, CodeMenuEntryFilename.rx.ToPrefixString().Replace('x', 'X')))
|
||||
{
|
||||
result = result.ReplaceAll(entry.Item1, () => Helpers.RepeatGenerator(entry.Item2, () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToUpperInvariant()).ToString()));
|
||||
}
|
||||
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.rn.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Numbers).ToString());
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.ra.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Alphanumeric).ToString());
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.rx.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToLowerInvariant()).ToString());
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.rx.ToPrefixString().Replace('x', 'X'), () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToUpperInvariant()).ToString());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.rn.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Numbers).ToString());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.ra.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Alphanumeric).ToString());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.rx.ToPrefixString(), () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToLowerInvariant()).ToString());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.rx.ToPrefixString().Replace('x', 'X'), () => Helpers.GetRandomChar(Helpers.Hexadecimal.ToUpperInvariant()).ToString());
|
||||
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.guid.ToPrefixString().ToLowerInvariant(), () => Guid.NewGuid().ToString().ToLowerInvariant());
|
||||
result = result.ReplaceAll(ReplCodeMenuEntry.guid.ToPrefixString().ToUpperInvariant(), () => Guid.NewGuid().ToString().ToUpperInvariant());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.guid.ToPrefixString().ToLowerInvariant(), () => Guid.NewGuid().ToString().ToLowerInvariant());
|
||||
result = result.ReplaceAll(CodeMenuEntryFilename.guid.ToPrefixString().ToUpperInvariant(), () => Guid.NewGuid().ToString().ToUpperInvariant());
|
||||
|
||||
if (Type == NameParserType.FolderPath)
|
||||
{
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (c) 2007-2016 ShareX Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public class RegionCaptureInfoTextCodeMenuEntry : CodeMenuEntry
|
||||
{
|
||||
public RegionCaptureInfoTextCodeMenuEntry(string value, string description) : base(value, description)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToPrefixString()
|
||||
{
|
||||
return '$' + _value;
|
||||
}
|
||||
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry x = new RegionCaptureInfoTextCodeMenuEntry("x", "X position");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry y = new RegionCaptureInfoTextCodeMenuEntry("y", "Y position");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry r = new RegionCaptureInfoTextCodeMenuEntry("r", "Red color (0-255)");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry g = new RegionCaptureInfoTextCodeMenuEntry("g", "Green color (0-255)");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry b = new RegionCaptureInfoTextCodeMenuEntry("b", "Blue color (0-255)");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry hex = new RegionCaptureInfoTextCodeMenuEntry("hex", "Hex color value");
|
||||
public static readonly RegionCaptureInfoTextCodeMenuEntry n = new RegionCaptureInfoTextCodeMenuEntry("n", "New line");
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
#region License Information (GPL v3)
|
||||
|
||||
/*
|
||||
ShareX - A program that allows you to take screenshots and share any file type
|
||||
Copyright (c) 2007-2016 ShareX Team
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib.Properties;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace ShareX.HelpersLib
|
||||
{
|
||||
public class ReplCodeMenuEntry : CodeMenuEntry
|
||||
{
|
||||
public ReplCodeMenuEntry(string value, string description, string category = null) : base(value, description, category)
|
||||
{
|
||||
}
|
||||
|
||||
public override string ToPrefixString()
|
||||
{
|
||||
return '%' + _value;
|
||||
}
|
||||
|
||||
public static readonly ReplCodeMenuEntry t = new ReplCodeMenuEntry("t", Resources.ReplCodeMenuEntry_t_Title_of_active_window, Resources.ReplCodeMenuCategory_Target);
|
||||
public static readonly ReplCodeMenuEntry pn = new ReplCodeMenuEntry("pn", Resources.ReplCodeMenuEntry_pn_Process_name_of_active_window, Resources.ReplCodeMenuCategory_Target);
|
||||
public static readonly ReplCodeMenuEntry y = new ReplCodeMenuEntry("y", Resources.ReplCodeMenuEntry_y_Current_year, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry yy = new ReplCodeMenuEntry("yy", Resources.ReplCodeMenuEntry_yy_Current_year__2_digits_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry mo = new ReplCodeMenuEntry("mo", Resources.ReplCodeMenuEntry_mo_Current_month, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry mon = new ReplCodeMenuEntry("mon", Resources.ReplCodeMenuEntry_mon_Current_month_name__Local_language_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry mon2 = new ReplCodeMenuEntry("mon2", Resources.ReplCodeMenuEntry_mon2_Current_month_name__English_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry d = new ReplCodeMenuEntry("d", Resources.ReplCodeMenuEntry_d_Current_day, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry h = new ReplCodeMenuEntry("h", Resources.ReplCodeMenuEntry_h_Current_hour, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry mi = new ReplCodeMenuEntry("mi", Resources.ReplCodeMenuEntry_mi_Current_minute, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry s = new ReplCodeMenuEntry("s", Resources.ReplCodeMenuEntry_s_Current_second, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry ms = new ReplCodeMenuEntry("ms", Resources.ReplCodeMenuEntry_ms_Current_millisecond, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry pm = new ReplCodeMenuEntry("pm", Resources.ReplCodeMenuEntry_pm_Gets_AM_PM, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry w = new ReplCodeMenuEntry("w", Resources.ReplCodeMenuEntry_w_Current_week_name__Local_language_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry w2 = new ReplCodeMenuEntry("w2", Resources.ReplCodeMenuEntry_w2_Current_week_name__English_, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry unix = new ReplCodeMenuEntry("unix", Resources.ReplCodeMenuEntry_unix_Unix_timestamp, Resources.ReplCodeMenuCategory_Date_and_Time);
|
||||
public static readonly ReplCodeMenuEntry i = new ReplCodeMenuEntry("i", Resources.ReplCodeMenuEntry_i_Auto_increment_number, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly ReplCodeMenuEntry ia = new ReplCodeMenuEntry("ia", Resources.ReplCodeMenuEntry_ia_Auto_increment_alphanumeric, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly ReplCodeMenuEntry iAa = new ReplCodeMenuEntry("iAa", Resources.ReplCodeMenuEntry_iAa_Auto_increment_alphanumeric_all, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly ReplCodeMenuEntry ib = new ReplCodeMenuEntry("ib", Resources.ReplCodeMenuEntry_ib_Auto_increment_base_alphanumeric, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly ReplCodeMenuEntry ix = new ReplCodeMenuEntry("ix", Resources.ReplCodeMenuEntry_ix_Auto_increment_hexadecimal, Resources.ReplCodeMenuCategory_Incremental);
|
||||
public static readonly ReplCodeMenuEntry rn = new ReplCodeMenuEntry("rn", Resources.ReplCodeMenuEntry_rn_Random_number_0_to_9, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly ReplCodeMenuEntry ra = new ReplCodeMenuEntry("ra", Resources.ReplCodeMenuEntry_ra_Random_alphanumeric_char, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly ReplCodeMenuEntry rx = new ReplCodeMenuEntry("rx", Resources.ReplCodeMenuEntry_rx_Random_hexadecimal, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly ReplCodeMenuEntry guid = new ReplCodeMenuEntry("guid", Resources.ReplCodeMenuEntry_guid_Random_guid, Resources.ReplCodeMenuCategory_Random);
|
||||
public static readonly ReplCodeMenuEntry width = new ReplCodeMenuEntry("width", Resources.ReplCodeMenuEntry_width_Gets_image_width, Resources.ReplCodeMenuCategory_Image);
|
||||
public static readonly ReplCodeMenuEntry height = new ReplCodeMenuEntry("height", Resources.ReplCodeMenuEntry_height_Gets_image_height, Resources.ReplCodeMenuCategory_Image);
|
||||
public static readonly ReplCodeMenuEntry un = new ReplCodeMenuEntry("un", Resources.ReplCodeMenuEntry_un_User_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly ReplCodeMenuEntry uln = new ReplCodeMenuEntry("uln", Resources.ReplCodeMenuEntry_uln_User_login_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly ReplCodeMenuEntry cn = new ReplCodeMenuEntry("cn", Resources.ReplCodeMenuEntry_cn_Computer_name, Resources.ReplCodeMenuCategory_Computer);
|
||||
public static readonly ReplCodeMenuEntry n = new ReplCodeMenuEntry("n", Resources.ReplCodeMenuEntry_n_New_line);
|
||||
}
|
||||
}
|
|
@ -88,7 +88,7 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="NameParser\ActionsCodeMenuEntry.cs" />
|
||||
<Compile Include="NameParser\CodeMenuEntryActions.cs" />
|
||||
<Compile Include="Automate\AutomateForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -192,7 +192,7 @@
|
|||
<Compile Include="Input\InputManager.cs" />
|
||||
<Compile Include="ListViewColumnSorter.cs" />
|
||||
<Compile Include="MimeTypes.cs" />
|
||||
<Compile Include="NameParser\RegionCaptureInfoTextCodeMenuEntry.cs" />
|
||||
<Compile Include="NameParser\CodeMenuEntryPixelInfo.cs" />
|
||||
<Compile Include="Native\LayeredForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
@ -228,7 +228,7 @@
|
|||
<Compile Include="Controls\TabToTreeView.Designer.cs">
|
||||
<DependentUpon>TabToTreeView.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="NameParser\ReplCodeMenuEntry.cs" />
|
||||
<Compile Include="NameParser\CodeMenuEntryFilename.cs" />
|
||||
<Compile Include="TaskEx.cs" />
|
||||
<Compile Include="TextBoxTraceListener.cs" />
|
||||
<Compile Include="UITypeEditors\EnumDescriptionConverter.cs" />
|
||||
|
|
|
@ -41,7 +41,7 @@ public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext contex
|
|||
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
Point pos = Cursor.Position;
|
||||
CodeMenu.Create(ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn).Show(pos.X, pos.Y);
|
||||
CodeMenu.Create(CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn).Show(pos.X, pos.Y);
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public WatermarkForm(WatermarkConfig watermarkConfig)
|
|||
InitializeComponent();
|
||||
Icon = ShareXResources.Icon;
|
||||
config = watermarkConfig;
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtWatermarkText, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtWatermarkText, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
}
|
||||
|
||||
private void WatermarkUI_Load(object sender, EventArgs e)
|
||||
|
|
|
@ -94,11 +94,11 @@ private void InitializeControls()
|
|||
ttlvMain.MainTabControl = tcUploaders;
|
||||
ttlvMain.FocusListView();
|
||||
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtDropboxPath, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtAmazonS3ObjectPrefix, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtMediaFirePath, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtCustomUploaderArgValue, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtCustomUploaderHeaderValue, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtDropboxPath, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtAmazonS3ObjectPrefix, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtMediaFirePath, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtCustomUploaderArgValue, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtCustomUploaderHeaderValue, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
|
||||
txtCustomUploaderLog.AddContextMenu();
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public ActionsForm(ExternalProgram fileAction)
|
|||
txtName.Text = fileAction.Name ?? "";
|
||||
txtPath.Text = fileAction.Path ?? "";
|
||||
txtArguments.Text = fileAction.Args ?? "";
|
||||
CodeMenu.Create<ActionsCodeMenuEntry>(txtArguments);
|
||||
CodeMenu.Create<CodeMenuEntryActions>(txtArguments);
|
||||
txtOutputExtension.Text = fileAction.OutputExtension ?? "";
|
||||
txtExtensions.Text = fileAction.Extensions ?? "";
|
||||
cbHiddenWindow.Checked = fileAction.HiddenWindow;
|
||||
|
|
|
@ -79,7 +79,7 @@ private void InitializeControls()
|
|||
cbTrayLeftClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<HotkeyType>());
|
||||
cbTrayMiddleClickAction.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<HotkeyType>());
|
||||
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtSaveImageSubFolderPattern, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn, ReplCodeMenuEntry.i, ReplCodeMenuEntry.width, ReplCodeMenuEntry.height, ReplCodeMenuEntry.n);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtSaveImageSubFolderPattern, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn, CodeMenuEntryFilename.i, CodeMenuEntryFilename.width, CodeMenuEntryFilename.height, CodeMenuEntryFilename.n);
|
||||
|
||||
cbProxyMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions<ProxyMethod>());
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public ClipboardFormatForm(ClipboardFormat cbf)
|
|||
ClipboardFormat = cbf;
|
||||
txtDescription.Text = cbf.Description ?? "";
|
||||
txtFormat.Text = cbf.Format ?? "";
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtFormat);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtFormat);
|
||||
lblExample.Text = string.Format(Resources.ClipboardFormatForm_ClipboardFormatForm_Supported_variables___0__and_other_variables_such_as__1__etc_,
|
||||
"$result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $thumbnailfilename, $thumbnailfilenamenoext, $folderpath, $foldername, $uploadtime",
|
||||
"%y, %mo, %d");
|
||||
|
|
|
@ -249,7 +249,7 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
|||
cbRegionCaptureUseCustomInfoText.Checked = TaskSettings.CaptureSettings.SurfaceOptions.UseCustomInfoText;
|
||||
txtRegionCaptureCustomInfoText.Enabled = TaskSettings.CaptureSettings.SurfaceOptions.UseCustomInfoText;
|
||||
TaskSettings.CaptureSettings.SurfaceOptions.CustomInfoText = TaskSettings.CaptureSettings.SurfaceOptions.CustomInfoText.Replace("\r\n", "$n").Replace("\n", "$n");
|
||||
CodeMenu.Create<RegionCaptureInfoTextCodeMenuEntry>(txtRegionCaptureCustomInfoText);
|
||||
CodeMenu.Create<CodeMenuEntryPixelInfo>(txtRegionCaptureCustomInfoText);
|
||||
txtRegionCaptureCustomInfoText.Text = TaskSettings.CaptureSettings.SurfaceOptions.CustomInfoText;
|
||||
cbRegionCaptureSnapSizes.Items.AddRange(TaskSettings.CaptureSettings.SurfaceOptions.SnapSizes.ToArray());
|
||||
cbRegionCaptureShowTips.Checked = TaskSettings.CaptureSettings.SurfaceOptions.ShowTips;
|
||||
|
@ -303,8 +303,8 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
|||
|
||||
txtNameFormatPattern.Text = TaskSettings.UploadSettings.NameFormatPattern;
|
||||
txtNameFormatPatternActiveWindow.Text = TaskSettings.UploadSettings.NameFormatPatternActiveWindow;
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtNameFormatPattern, ReplCodeMenuEntry.n, ReplCodeMenuEntry.t, ReplCodeMenuEntry.pn);
|
||||
CodeMenu.Create<ReplCodeMenuEntry>(txtNameFormatPatternActiveWindow, ReplCodeMenuEntry.n);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtNameFormatPattern, CodeMenuEntryFilename.n, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
|
||||
CodeMenu.Create<CodeMenuEntryFilename>(txtNameFormatPatternActiveWindow, CodeMenuEntryFilename.n);
|
||||
cbRegionCaptureUseWindowPattern.Checked = TaskSettings.UploadSettings.RegionCaptureUseWindowPattern;
|
||||
cbFileUploadUseNamePattern.Checked = TaskSettings.UploadSettings.FileUploadUseNamePattern;
|
||||
UpdateNameFormatPreviews();
|
||||
|
@ -359,6 +359,7 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
|||
|
||||
#region Tools
|
||||
|
||||
CodeMenu.Create<CodeMenuEntryPixelInfo>(txtToolsScreenColorPickerFormat);
|
||||
txtToolsScreenColorPickerFormat.Text = TaskSettings.ToolsSettings.ScreenColorPickerFormat;
|
||||
|
||||
#endregion Tools
|
||||
|
|
|
@ -376,7 +376,7 @@ public class TaskSettingsUpload
|
|||
|
||||
public class TaskSettingsTools
|
||||
{
|
||||
public string ScreenColorPickerFormat = "$r, $g, $b"; // $r, $g, $b, $hex, $HEX, $x, $y
|
||||
public string ScreenColorPickerFormat = "$r, $g, $b";
|
||||
public IndexerSettings IndexerSettings = new IndexerSettings();
|
||||
public ImageCombinerOptions ImageCombinerOptions = new ImageCombinerOptions();
|
||||
public VideoThumbnailOptions VideoThumbnailOptions = new VideoThumbnailOptions();
|
||||
|
|
Loading…
Reference in a new issue