Replace all string.Empty with ""

This commit is contained in:
Jaex 2016-05-24 21:15:45 +03:00
parent add923d914
commit cb7a621b73
60 changed files with 141 additions and 142 deletions

View file

@ -153,7 +153,7 @@ public bool IsValidImage
public MyPictureBox()
{
InitializeComponent();
Text = string.Empty;
Text = "";
pbMain.BackColor = SystemColors.Control;
pbMain.InitialImage = Resources.Loading;
pbMain.ErrorImage = Resources.cross;

View file

@ -70,7 +70,7 @@ private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
if (FileCheckCompleted != null)
{
string result = string.Empty;
string result = "";
if (!e.Cancelled)
{

View file

@ -134,7 +134,7 @@ public static string ToBase(this int value, int radix, string digits)
throw new ArgumentOutOfRangeException("radix", radix, string.Format("Radix has to be > 2 and < {0}", digits.Length));
}
string result = string.Empty;
string result = "";
int quotient = Math.Abs(value);
while (0 < quotient)
{

View file

@ -38,28 +38,28 @@ public static bool Contains(this string str, string value, StringComparison comp
public static string Left(this string str, int length)
{
if (length < 1) return string.Empty;
if (length < 1) return "";
if (length < str.Length) return str.Substring(0, length);
return str;
}
public static string Right(this string str, int length)
{
if (length < 1) return string.Empty;
if (length < 1) return "";
if (length < str.Length) return str.Substring(str.Length - length);
return str;
}
public static string RemoveLeft(this string str, int length)
{
if (length < 1) return string.Empty;
if (length < 1) return "";
if (length < str.Length) return str.Remove(0, length);
return str;
}
public static string RemoveRight(this string str, int length)
{
if (length < 1) return string.Empty;
if (length < 1) return "";
if (length < str.Length) return str.Remove(str.Length - length);
return str;
}

View file

@ -155,7 +155,7 @@ public static string GetElementValue(this XElement xe, XName name)
if (xeItem != null) return xeItem.Value;
}
return string.Empty;
return "";
}
public static string GetAttributeValue(this XElement xe, string name)
@ -166,7 +166,7 @@ public static string GetAttributeValue(this XElement xe, string name)
if (xaItem != null) return xaItem.Value;
}
return string.Empty;
return "";
}
public static string GetAttributeFirstValue(this XElement xe, params string[] names)
@ -181,7 +181,7 @@ public static string GetAttributeFirstValue(this XElement xe, params string[] na
}
}
return string.Empty;
return "";
}
public static XmlNode AppendElement(this XmlNode parent, string tagName)

View file

@ -70,7 +70,7 @@ private void btnStartHashCheck_Click(object sender, EventArgs e)
if (hashCheck.Start(txtFilePath.Text, hashType))
{
btnStartHashCheck.Text = Resources.Stop;
txtResult.Text = string.Empty;
txtResult.Text = "";
}
}
}

View file

@ -151,7 +151,7 @@ public static void PinUnpinTaskBar(string filePath, bool pin)
for (int i = 0; i < verbs.Count; i++)
{
FolderItemVerb verb = verbs.Item(i);
string verbName = verb.Name.Replace(@"&", string.Empty);
string verbName = verb.Name.Replace(@"&", "");
if ((pin && verbName.Equals("pin to taskbar", StringComparison.InvariantCultureIgnoreCase)) ||
(!pin && verbName.Equals("unpin from taskbar", StringComparison.InvariantCultureIgnoreCase)))

View file

@ -142,7 +142,7 @@ public static string CombineURL(string url1, string url2)
if (url1Empty && url2Empty)
{
return string.Empty;
return "";
}
if (url1Empty)
@ -296,7 +296,7 @@ public static string GetDirectoryPath(string path)
public static List<string> GetPaths(string path)
{
List<string> result = new List<string>();
string temp = string.Empty;
string temp = "";
string[] dirs = path.Split('/');
foreach (string dir in dirs)
{

View file

@ -116,7 +116,7 @@ public string Parse(string pattern)
{
if (string.IsNullOrEmpty(pattern))
{
return string.Empty;
return "";
}
StringBuilder sb = new StringBuilder(pattern);
@ -136,7 +136,7 @@ public string Parse(string pattern)
sb.Replace(ReplCodeMenuEntry.pn.ToPrefixString(), ProcessName);
}
string width = string.Empty, height = string.Empty;
string width = "", height = "";
if (ImageWidth > 0)
{

View file

@ -165,7 +165,7 @@ public string ParseString(string text)
return sb.ToString();
}
return string.Empty;
return "";
}
private void CheckIdentifier(Token token)

View file

@ -31,14 +31,14 @@ public static class HtmlHelper
{
public static string StartTag(string tag, string style = "", string otherFields = "")
{
string css = string.Empty;
string css = "";
if (!string.IsNullOrEmpty(style))
{
css = string.Format(" style=\"{0}\"", style);
}
string fields = string.Empty;
string fields = "";
if (!string.IsNullOrEmpty(otherFields))
{

View file

@ -46,7 +46,7 @@ public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options)
Options = options;
InitializeComponent();
Icon = ShareXResources.Icon;
txtMediaPath.Text = Options.LastVideoPath ?? string.Empty;
txtMediaPath.Text = Options.LastVideoPath ?? "";
pgOptions.SelectedObject = Options;
}

View file

@ -584,7 +584,7 @@ private void DrawMagnifier(Graphics g)
Rectangle currentScreenRect0Based = CaptureHelpers.GetActiveScreenBounds0Based();
int offsetX = 10, offsetY = 10, infoTextOffset = 0, infoTextPadding = 3;
Rectangle infoTextRect = Rectangle.Empty;
string infoText = string.Empty;
string infoText = "";
if (Config.ShowInfo)
{

View file

@ -129,7 +129,7 @@ private void SelectHandle()
if (simpleWindowInfo != null)
{
selectedWindow = new WindowInfo(simpleWindowInfo.Handle);
lblControlText.Text = selectedWindow.ClassName ?? string.Empty;
lblControlText.Text = selectedWindow.ClassName ?? "";
selectedRectangle = simpleWindowInfo.Rectangle;
lblSelectedRectangle.Text = selectedRectangle.ToString();
btnSelectRectangle.Enabled = btnCapture.Enabled = true;

View file

@ -98,7 +98,7 @@ public string ToErrorString()
return string.Join(Environment.NewLine, Errors);
}
return string.Empty;
return "";
}
public virtual void StopUpload()
@ -588,7 +588,7 @@ protected string CreateQuery(Dictionary<string, string> args)
return string.Join("&", args.Select(x => x.Key + "=" + HttpUtility.UrlEncode(x.Value)).ToArray());
}
return string.Empty;
return "";
}
protected string CreateQuery(string url, Dictionary<string, string> args)
@ -612,7 +612,7 @@ protected string CreateQuery(NameValueCollection args)
foreach (string key in args.AllKeys)
{
string[] values = args.GetValues(key);
string isArray = values.Length > 1 ? "[]" : string.Empty;
string isArray = values.Length > 1 ? "[]" : "";
commands.AddRange(values.Select(value => key + isArray + "=" + HttpUtility.UrlEncode(value)));
}
@ -620,7 +620,7 @@ protected string CreateQuery(NameValueCollection args)
return string.Join("&", commands.ToArray());
}
return string.Empty;
return "";
}
protected string CreateQuery(string url, NameValueCollection args)

View file

@ -51,7 +51,7 @@ public FTPClientForm(FTPAccount account)
InitializeComponent();
Icon = ShareXResources.Icon;
lblStatus.Text = string.Empty;
lblStatus.Text = "";
lvFTPList.SubItemEndEditing += lvFTPList_SubItemEndEditing;
FtpTrace.AddListener(new TextBoxTraceListener(txtDebug));
@ -139,7 +139,7 @@ private void LoadDirectory(string path)
}
else
{
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add("");
}
lvi.SubItems.Add(IconReader.GetDisplayName(file.Name, file.Type == FtpFileSystemObjectType.Directory));
@ -215,7 +215,7 @@ private void CheckFiles(bool selected)
}
}
string isSelected = selected ? "Selected " : string.Empty;
string isSelected = selected ? "Selected " : "";
int filesCount = items.Count(x => x.Type == FtpFileSystemObjectType.File);
string file = filesCount > 1 ? "files" : "file";
int directoriesCount = items.Count(x => x.Type == FtpFileSystemObjectType.Directory);
@ -436,7 +436,7 @@ private void lvFTPList_DragDrop(object sender, DragEventArgs e)
if (file.Name != filename)
{
string path = URLHelpers.CombineURL(currentDirectory, filename);
string movePath = string.Empty;
string movePath = "";
if (file.Type == FtpFileSystemObjectType.Link)
{
if (file.Name == ".")

View file

@ -462,7 +462,7 @@ public ListViewItem Item
/// </summary>
public class SubItemEndEditingEventArgs : SubItemEventArgs
{
private string _text = string.Empty;
private string _text = "";
private bool _cancel = true;
public SubItemEndEditingEventArgs(ListViewItem item, int subItem, string display, bool cancel) :

View file

@ -230,7 +230,7 @@ public string CreatePublicURL(string path, CopyURLType urlType = CopyURLType.Def
return GetLinkURL(link, path, urlType);
}
return string.Empty;
return "";
}
public string GetPublicURL(string path, CopyURLType urlType = CopyURLType.Default)
@ -246,7 +246,7 @@ public string GetPublicURL(string path, CopyURLType urlType = CopyURLType.Defaul
}
}
return string.Empty;
return "";
}
public static string TidyUploadPath(string uploadPath)
@ -256,7 +256,7 @@ public static string TidyUploadPath(string uploadPath)
return uploadPath.Trim().Replace('\\', '/').Trim('/') + "/";
}
return string.Empty;
return "";
}
}

View file

@ -60,7 +60,7 @@ public DropIO(string apiKey)
public override UploadResult Upload(Stream stream, string fileName)
{
DropName = "ShareX_" + Helpers.GetRandomAlphanumeric(10);
DropDescription = string.Empty;
DropDescription = "";
Drop drop = CreateDrop(DropName, DropDescription, false, false, false);
Dictionary<string, string> args = new Dictionary<string, string>();

View file

@ -427,7 +427,7 @@ public static string TidyUploadPath(string uploadPath)
return uploadPath.Trim().Replace('\\', '/').Trim('/') + "/";
}
return string.Empty;
return "";
}
}

View file

@ -42,7 +42,7 @@ public override bool CheckConfig(UploadersConfig config)
public override GenericUploader CreateUploader(UploadersConfig config, TaskReferenceHelper taskInfo)
{
using (EmailForm emailForm = new EmailForm(config.EmailRememberLastTo ? config.EmailLastTo : string.Empty,
using (EmailForm emailForm = new EmailForm(config.EmailRememberLastTo ? config.EmailLastTo : "",
config.EmailDefaultSubject, config.EmailDefaultBody))
{
if (emailForm.ShowDialog() == DialogResult.OK)

View file

@ -76,7 +76,7 @@ public string FTPAddress
{
if (string.IsNullOrEmpty(Host))
{
return string.Empty;
return "";
}
string serverProtocol;
@ -139,14 +139,14 @@ public FTPAccount()
Name = "New account";
Host = "host";
Port = 21;
SubFolderPath = string.Empty;
SubFolderPath = "";
BrowserProtocol = BrowserProtocol.http;
HttpHomePath = string.Empty;
HttpHomePath = "";
HttpHomePathAutoAddSubFolderPath = true;
HttpHomePathNoExtension = false;
IsActive = false;
FTPSEncryption = FTPSEncryption.Explicit;
FTPSCertificateLocation = string.Empty;
FTPSCertificateLocation = "";
}
public string GetSubFolderPath(string filename = null, NameParserType nameParserType = NameParserType.URL)
@ -171,7 +171,7 @@ public string GetUriPath(string filename, string subFolderPath = null)
{
if (string.IsNullOrEmpty(Host))
{
return string.Empty;
return "";
}
if (HttpHomePathNoExtension)
@ -249,7 +249,7 @@ public string GetFtpPath(string filemame)
{
if (string.IsNullOrEmpty(FTPAddress))
{
return string.Empty;
return "";
}
return URLHelpers.CombineURL(FTPAddress, GetSubFolderPath(filemame, NameParserType.FolderPath));

View file

@ -494,7 +494,7 @@ public void SetSize(string size)
public void SetDateTime(string year, string month, string day)
{
string time = string.Empty;
string time = "";
if (year.Contains(":"))
{

View file

@ -87,7 +87,7 @@ static Jira()
{
byte[] pfx = new byte[stream.Length];
stream.Read(pfx, 0, pfx.Length);
_jiraCertificate = new X509Certificate2(pfx, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
_jiraCertificate = new X509Certificate2(pfx, "", X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable);
}
}

View file

@ -104,7 +104,7 @@ internal class LambdaFile
public class LambdaSettings
{
public string UserAPIKey = string.Empty;
public string UserAPIKey = "";
public string UploadURL = "https://λ.pw/";
}
}

View file

@ -60,7 +60,7 @@ public Lithiio(LithiioSettings config)
private const string uploadUrl = "http://api.lithi.io/upload.php";
public static string[] UploadURLs = new string[] { "https://i.lithi.io/", "https://lithi.io/i/", "https://i.mugi.io/", "https://mugi.io/i/"};
public static string[] UploadURLs = new string[] { "https://i.lithi.io/", "https://lithi.io/i/", "https://i.mugi.io/", "https://mugi.io/i/" };
public override UploadResult Upload(Stream stream, string fileName)
{
@ -96,7 +96,7 @@ internal class LithiioFile
public class LithiioSettings
{
public string UserAPIKey { get; set; } = string.Empty;
public string UserAPIKey { get; set; } = "";
public string UploadURL { get; set; } = "https://i.lithi.io/";
}
}
}

View file

@ -71,7 +71,7 @@ public string LocalUri
{
if (string.IsNullOrEmpty(LocalhostRoot))
{
return string.Empty;
return "";
}
return new Uri(Helpers.ExpandFolderVariables(LocalhostRoot)).AbsoluteUri;
@ -101,10 +101,10 @@ public string PreviewRemotePath
public LocalhostAccount()
{
Name = "New account";
LocalhostRoot = string.Empty;
LocalhostRoot = "";
Port = 80;
SubFolderPath = string.Empty;
HttpHomePath = string.Empty;
SubFolderPath = "";
HttpHomePath = "";
HttpHomePathAutoAddSubFolderPath = true;
HttpHomePathNoExtension = false;
RemoteProtocol = BrowserProtocol.file;
@ -133,7 +133,7 @@ public string GetUriPath(string filename)
{
if (string.IsNullOrEmpty(LocalhostRoot))
{
return string.Empty;
return "";
}
if (HttpHomePathNoExtension)
@ -186,7 +186,7 @@ public string GetLocalhostPath(string fileName)
{
if (string.IsNullOrEmpty(LocalhostRoot))
{
return string.Empty;
return "";
}
return Path.Combine(Path.Combine(Helpers.ExpandFolderVariables(LocalhostRoot), GetSubFolderPath()), fileName);
}
@ -197,7 +197,7 @@ public string GetLocalhostUri(string fileName)
if (string.IsNullOrEmpty(localhostAddress))
{
return string.Empty;
return "";
}
return URLHelpers.CombineURL(localhostAddress, GetSubFolderPath(), fileName);

View file

@ -236,7 +236,7 @@ public class PushbulletDevice
public class PushbulletSettings
{
public string UserAPIKey = string.Empty;
public string UserAPIKey = "";
public List<PushbulletDevice> DeviceList = new List<PushbulletDevice>();
public int SelectedDevice = 0;

View file

@ -103,7 +103,7 @@ private string NextUploadServer()
return string.Format(rapidshareUploadURL, response);
}
return string.Empty;
return "";
}
public RapidShareFolderInfo GetRootFolderWithChilds()

View file

@ -103,7 +103,7 @@ public string GetAuthToken(string username, string password)
return AuthResult.token;
}
return string.Empty;
return "";
}
public class SeafileAuthResponse

View file

@ -2788,7 +2788,7 @@ private void btnCustomUploaderRegexpAdd_Click(object sender, EventArgs e)
if (!string.IsNullOrEmpty(regexp))
{
lvCustomUploaderRegexps.Items.Add(regexp);
txtCustomUploaderRegexp.Text = string.Empty;
txtCustomUploaderRegexp.Text = "";
txtCustomUploaderRegexp.Focus();
}
}
@ -2818,7 +2818,7 @@ private void btnCustomUploaderRegexHelp_Click(object sender, EventArgs e)
private void lvCustomUploaderRegexps_SelectedIndexChanged(object sender, EventArgs e)
{
string regex = string.Empty;
string regex = "";
if (lvCustomUploaderRegexps.SelectedItems.Count > 0)
{
@ -2954,8 +2954,8 @@ private void btnCustomUploaderArgAdd_Click(object sender, EventArgs e)
{
string value = txtCustomUploaderArgValue.Text;
lvCustomUploaderArguments.Items.Add(name).SubItems.Add(value);
txtCustomUploaderArgName.Text = string.Empty;
txtCustomUploaderArgValue.Text = string.Empty;
txtCustomUploaderArgName.Text = "";
txtCustomUploaderArgValue.Text = "";
txtCustomUploaderArgName.Focus();
}
}
@ -2985,8 +2985,8 @@ private void btnCustomUploaderArgUpdate_Click(object sender, EventArgs e)
private void lvCustomUploaderArguments_SelectedIndexChanged(object sender, EventArgs e)
{
string name = string.Empty;
string value = string.Empty;
string name = "";
string value = "";
if (lvCustomUploaderArguments.SelectedItems.Count > 0)
{
@ -3006,8 +3006,8 @@ private void btnCustomUploaderHeaderAdd_Click(object sender, EventArgs e)
{
string value = txtCustomUploaderHeaderValue.Text;
lvCustomUploaderHeaders.Items.Add(name).SubItems.Add(value);
txtCustomUploaderHeaderName.Text = string.Empty;
txtCustomUploaderHeaderValue.Text = string.Empty;
txtCustomUploaderHeaderName.Text = "";
txtCustomUploaderHeaderValue.Text = "";
txtCustomUploaderHeaderName.Focus();
}
}
@ -3037,8 +3037,8 @@ private void btnCustomUploaderHeaderUpdate_Click(object sender, EventArgs e)
private void lvCustomUploaderHeaders_SelectedIndexChanged(object sender, EventArgs e)
{
string name = string.Empty;
string value = string.Empty;
string name = "";
string value = "";
if (lvCustomUploaderHeaders.SelectedItems.Count > 0)
{

View file

@ -533,7 +533,7 @@ private void UpdateDropboxStatus()
}
else
{
lblDropboxStatus.Text = string.Empty;
lblDropboxStatus.Text = "";
}
}
@ -1066,7 +1066,7 @@ private void FTPOpenClient()
public static void TestFTPAccount(FTPAccount account)
{
string msg = string.Empty;
string msg = "";
string remotePath = account.GetSubFolderPath();
List<string> directories = new List<string>();
@ -1283,7 +1283,7 @@ private bool TwitterUpdateSelected()
}
txtTwitterDescription.Enabled = false;
txtTwitterDescription.Text = string.Empty;
txtTwitterDescription.Text = "";
oauthTwitter.Enabled = false;
return false;
}
@ -1331,7 +1331,7 @@ private void TwitterAuthComplete(string code)
if (result)
{
oauth.AuthVerifier = string.Empty;
oauth.AuthVerifier = "";
oauthTwitter.Status = OAuthLoginStatus.LoginSuccessful;
MessageBox.Show(Resources.UploadersConfigForm_Login_successful, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

View file

@ -190,7 +190,7 @@ private string ParseURL(string url)
{
if (string.IsNullOrEmpty(url))
{
return string.Empty;
return "";
}
StringBuilder result = new StringBuilder();

View file

@ -53,7 +53,7 @@ public string AddImage(string key)
}
else
{
return string.Empty;
return "";
}
}

View file

@ -184,7 +184,7 @@ private static byte[] GenerateSignature(string signatureBase, string consumerSec
using (HMACSHA1 hmacsha1 = new HMACSHA1())
{
string key = string.Format("{0}&{1}", Uri.EscapeDataString(consumerSecret),
string.IsNullOrEmpty(userSecret) ? string.Empty : Uri.EscapeDataString(userSecret));
string.IsNullOrEmpty(userSecret) ? "" : Uri.EscapeDataString(userSecret));
hmacsha1.Key = Encoding.ASCII.GetBytes(key);
@ -236,7 +236,7 @@ private static string NormalizeUrl(string url)
if (Uri.TryCreate(url, UriKind.Absolute, out uri))
{
string port = string.Empty;
string port = "";
if (uri.Scheme == "http" && uri.Port != 80 ||
uri.Scheme == "https" && uri.Port != 443 ||

View file

@ -40,7 +40,7 @@ public override UploadResult Upload(Stream stream, string fileName)
arguments.Add("description", "test");
arguments.Add("adult", "t");
arguments.Add("sfile", "Upload");
arguments.Add("url", string.Empty);
arguments.Add("url", "");
UploadResult result = UploadData(stream, "http://imagebin.ca/upload.php", fileName, "f", arguments);

View file

@ -274,7 +274,7 @@ private UploadResult InternalUpload(Stream stream, string fileName, bool refresh
result.URL = "http://imgur.com/" + imageData.id;
}
string thumbnail = string.Empty;
string thumbnail = "";
switch (ThumbnailType)
{

View file

@ -93,7 +93,7 @@ public override UploadResult Upload(Stream stream, string fileName)
arguments.Add("responsetype", "XML");
arguments.Add("upk", upk);
arguments.Add("type", "image");
arguments.Add("tags", string.Empty);
arguments.Add("tags", "");
result = UploadData(stream, URLAPI, fileName, "uploadfile", arguments);
@ -129,7 +129,7 @@ public string UserAuth(string email, string password)
return HttpUtility.HtmlEncode(result);
}
return string.Empty;
return "";
}
private string GetUploadKey(string action, string tpid, string tpk)

View file

@ -48,7 +48,7 @@ public override GenericUploader CreateUploader(UploadersConfig config, TaskRefer
return new Twitter(twitterOAuth)
{
SkipMessageBox = config.TwitterSkipMessageBox,
DefaultMessage = config.TwitterDefaultMessage ?? string.Empty
DefaultMessage = config.TwitterDefaultMessage ?? ""
};
}

View file

@ -39,7 +39,7 @@ public override bool CheckConfig(UploadersConfig config)
public override void ShareURL(string url, UploadersConfig config)
{
using (EmailForm emailForm = new EmailForm(config.EmailRememberLastTo ? config.EmailLastTo : string.Empty, config.EmailDefaultSubject, url))
using (EmailForm emailForm = new EmailForm(config.EmailRememberLastTo ? config.EmailLastTo : "", config.EmailDefaultSubject, url))
{
if (emailForm.ShowDialog() == DialogResult.OK)
{

View file

@ -88,7 +88,7 @@ public class Paste2Settings
public Paste2Settings()
{
TextFormat = "text";
Description = string.Empty;
Description = "";
}
}
}

View file

@ -69,7 +69,7 @@ public override UploadResult UploadText(string text, string fileName)
Dictionary<string, string> arguments = new Dictionary<string, string>();
arguments.Add("key", APIKey);
arguments.Add("description", string.Empty);
arguments.Add("description", "");
arguments.Add("paste", text);
arguments.Add("format", "simple");
arguments.Add("return", "link");

View file

@ -121,13 +121,13 @@ public class PastebinCaSettings
public PastebinCaSettings()
{
Author = string.Empty;
Description = string.Empty;
Tags = string.Empty;
Author = "";
Description = "";
Tags = "";
TextFormat = "1";
ExpireTime = "1 month";
Encrypt = false;
EncryptPassword = string.Empty;
EncryptPassword = "";
}
}
}

View file

@ -86,7 +86,7 @@ public override string ToString()
return URL;
}
return string.Empty;
return "";
}
public string ErrorsToString()

View file

@ -55,9 +55,9 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// TinyPic
public AccountType TinyPicAccountType = AccountType.Anonymous;
public string TinyPicRegistrationCode = string.Empty;
public string TinyPicUsername = string.Empty;
public string TinyPicPassword = string.Empty;
public string TinyPicRegistrationCode = "";
public string TinyPicUsername = "";
public string TinyPicPassword = "";
public bool TinyPicRememberUserPass = false;
// Flickr
@ -73,7 +73,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// Picasa
public OAuth2Info PicasaOAuth2Info = null;
public string PicasaAlbumID = string.Empty;
public string PicasaAlbumID = "";
// Chevereto
@ -82,12 +82,12 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// SomeImage
public string SomeImageAPIKey = string.Empty;
public string SomeImageAPIKey = "";
public bool SomeImageDirectURL = true;
// vgy.me
public string VgymeUserKey = string.Empty;
public string VgymeUserKey = "";
#endregion Image uploaders
@ -110,7 +110,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// uPaste
public string UpasteUserKey = string.Empty;
public string UpasteUserKey = "";
public bool UpasteIsPublic = false;
// Hastebin
@ -120,8 +120,8 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// OneTimeSecret
public string OneTimeSecretAPIKey = string.Empty;
public string OneTimeSecretAPIUsername = string.Empty;
public string OneTimeSecretAPIKey = "";
public string OneTimeSecretAPIUsername = "";
#endregion Text uploaders
@ -153,13 +153,13 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
public OAuth2Info GoogleDriveOAuth2Info = null;
public bool GoogleDriveIsPublic = true;
public bool GoogleDriveUseFolder = false;
public string GoogleDriveFolderID = string.Empty;
public string GoogleDriveFolderID = "";
// SendSpace
public AccountType SendSpaceAccountType = AccountType.Anonymous;
public string SendSpaceUsername = string.Empty;
public string SendSpacePassword = string.Empty;
public string SendSpaceUsername = "";
public string SendSpacePassword = "";
// Minus
@ -178,8 +178,8 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// Localhostr
public string LocalhostrEmail = string.Empty;
public string LocalhostrPassword = string.Empty;
public string LocalhostrEmail = "";
public string LocalhostrPassword = "";
public bool LocalhostrDirectURL = true;
// FTP Server
@ -201,10 +201,9 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
public string EmailSmtpServer = "smtp.gmail.com";
public int EmailSmtpPort = 587;
public string EmailFrom = "...@gmail.com";
public string EmailPassword = string.Empty;
public string EmailPassword = "";
public bool EmailRememberLastTo = true;
public bool EmailConfirmSend = true;
public string EmailLastTo = string.Empty;
public string EmailLastTo = "";
public string EmailDefaultSubject = "Sending email from ShareX";
public string EmailDefaultBody = "Screenshot is attached.";
@ -267,7 +266,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// s-ul
public string SulAPIKey = string.Empty;
public string SulAPIKey = "";
// Seafile
@ -298,7 +297,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// bit.ly
public OAuth2Info BitlyOAuth2Info = null;
public string BitlyDomain = string.Empty;
public string BitlyDomain = "";
// Google URL Shortener
@ -308,20 +307,20 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
// yourls.org
public string YourlsAPIURL = "http://yoursite.com/yourls-api.php";
public string YourlsSignature = string.Empty;
public string YourlsUsername = string.Empty;
public string YourlsPassword = string.Empty;
public string YourlsSignature = "";
public string YourlsUsername = "";
public string YourlsPassword = "";
// adf.ly
public string AdFlyAPIKEY = string.Empty;
public string AdFlyAPIUID = string.Empty;
public string AdFlyAPIKEY = "";
public string AdFlyAPIUID = "";
// coinurl.com
public string CoinURLUUID = string.Empty;
public string CoinURLUUID = "";
// polr
public string PolrAPIHostname = string.Empty;
public string PolrAPIKey = string.Empty;
public string PolrAPIHostname = "";
public string PolrAPIKey = "";
#endregion URL shorteners
@ -332,7 +331,7 @@ public class UploadersConfig : SettingsBase<UploadersConfig>
public List<OAuthInfo> TwitterOAuthInfoList = new List<OAuthInfo>();
public int TwitterSelectedAccount = 0;
public bool TwitterSkipMessageBox = false;
public string TwitterDefaultMessage = string.Empty;
public string TwitterDefaultMessage = "";
#endregion URL sharing services

View file

@ -83,7 +83,7 @@ public ApplicationConfig()
#region Paths
public bool UseCustomScreenshotsPath = false;
public string CustomScreenshotsPath = string.Empty;
public string CustomScreenshotsPath = "";
public string SaveImageSubFolderPattern = "%y-%mo";
#endregion Paths

View file

@ -178,7 +178,7 @@ private void OnInitCompleted()
if (InitCompleted != null)
{
RadioButton rbDestination = flp.Controls.OfType<RadioButton>().FirstOrDefault(x => x.Checked);
string currentDestination = string.Empty;
string currentDestination = "";
if (rbDestination != null)
{
currentDestination = rbDestination.Text;

View file

@ -242,7 +242,7 @@ public string GetLocalFilePathAsUri(string fp)
}
}
return string.Empty;
return "";
}
#endregion TaskInfo helper methods

View file

@ -134,7 +134,7 @@ private void UpdateControls()
cbProxyMethod.SelectedIndex = (int)Program.Settings.ProxySettings.ProxyMethod;
txtProxyUsername.Text = Program.Settings.ProxySettings.Username;
txtProxyPassword.Text = Program.Settings.ProxySettings.Password;
txtProxyHost.Text = Program.Settings.ProxySettings.Host ?? string.Empty;
txtProxyHost.Text = Program.Settings.ProxySettings.Host ?? "";
nudProxyPort.SetValue(Program.Settings.ProxySettings.Port);
UpdateProxyControls();
@ -577,7 +577,7 @@ private void cbProxyMethod_SelectedIndexChanged(object sender, EventArgs e)
if (Program.Settings.ProxySettings.ProxyMethod == ProxyMethod.Automatic)
{
Program.Settings.ProxySettings.IsValidProxy();
txtProxyHost.Text = Program.Settings.ProxySettings.Host ?? string.Empty;
txtProxyHost.Text = Program.Settings.ProxySettings.Host ?? "";
nudProxyPort.SetValue(Program.Settings.ProxySettings.Port);
}

View file

@ -65,7 +65,7 @@ private string GetNewFilename()
return newFilename + Path.GetExtension(Filepath);
}
return string.Empty;
return "";
}
private void btnNewName_Click(object sender, EventArgs e)
@ -99,7 +99,7 @@ private void btnUniqueName_Click(object sender, EventArgs e)
private void btnCancel_Click(object sender, EventArgs e)
{
Filepath = string.Empty;
Filepath = "";
Close();
}
}

View file

@ -59,7 +59,7 @@ public ScreenColorPicker()
private void CopyToClipboard(object sender, EventArgs e)
{
string text = string.Empty;
string text = "";
if (sender is NumericUpDown)
{

View file

@ -59,7 +59,7 @@ public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
}
else
{
tbDescription.Text = TaskSettings.Description ?? string.Empty;
tbDescription.Text = TaskSettings.Description ?? "";
cbUseDefaultAfterCaptureSettings.Checked = TaskSettings.UseDefaultAfterCaptureJob;
cbUseDefaultAfterUploadSettings.Checked = TaskSettings.UseDefaultAfterUploadJob;
cbUseDefaultDestinationSettings.Checked = TaskSettings.UseDefaultDestinations;

View file

@ -130,7 +130,7 @@ public HotkeyInfo(Keys hotkey, ushort id) : this(hotkey)
public override string ToString()
{
string text = string.Empty;
string text = "";
if (Control)
{

View file

@ -52,7 +52,7 @@ public override string ToString()
return string.Format("Hotkey: {0}, Description: {1}, Job: {2}", HotkeyInfo, TaskSettings, TaskSettings.Job);
}
return string.Empty;
return "";
}
}
}

View file

@ -503,14 +503,14 @@ public static string ReadPersonalPathConfig()
return File.ReadAllText(PersonalPathConfigFilePath, Encoding.UTF8).Trim();
}
return string.Empty;
return "";
}
public static void WritePersonalPathConfig(string path)
{
if (path == null)
{
path = string.Empty;
path = "";
}
else
{

View file

@ -381,7 +381,7 @@ public static string CheckFilePath(string folder, string filename, TaskSettings
filepath = Helpers.GetUniqueFilePath(filepath);
break;
case FileExistAction.Cancel:
filepath = string.Empty;
filepath = "";
break;
}
}

View file

@ -62,7 +62,7 @@ public string FilePath
if (string.IsNullOrEmpty(filePath))
{
FileName = string.Empty;
FileName = "";
}
else
{
@ -122,7 +122,7 @@ public string UploaderHost
}
}
return string.Empty;
return "";
}
}

View file

@ -189,12 +189,12 @@ private static void CreateListViewItem(WorkerTask task)
else
{
lvi.SubItems.Add(Resources.TaskManager_CreateListViewItem_In_queue);
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add("");
}
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add("");
lvi.SubItems.Add("");
lvi.SubItems.Add("");
if (task.Status == TaskStatus.History)
{
@ -203,7 +203,7 @@ private static void CreateListViewItem(WorkerTask task)
}
else
{
lvi.SubItems.Add(string.Empty);
lvi.SubItems.Add("");
lvi.ImageIndex = 3;
}
@ -298,7 +298,7 @@ private static void task_TaskCompleted(WorkerTask task)
if (lvi != null)
{
lvi.SubItems[1].Text = Resources.TaskManager_task_UploadCompleted_Error;
lvi.SubItems[6].Text = string.Empty;
lvi.SubItems[6].Text = "";
lvi.ImageIndex = 1;
}

View file

@ -45,7 +45,7 @@ public class TaskSettings
[JsonIgnore]
public TaskSettings TaskSettingsReference { get; private set; }
public string Description = string.Empty;
public string Description = "";
public HotkeyType Job = HotkeyType.None;

View file

@ -932,7 +932,7 @@ private UploadResult GetInvalidConfigResult(IUploaderService uploaderService)
private bool DownloadAndUpload()
{
string url = Info.Result.URL.Trim();
Info.Result.URL = string.Empty;
Info.Result.URL = "";
Info.FilePath = TaskHelpers.CheckFilePath(Info.TaskSettings.CaptureFolder, Info.FileName, Info.TaskSettings);
if (!string.IsNullOrEmpty(Info.FilePath))