mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-21 23:34:07 +02:00
Address code analysis issues and fix unused parameter in CombinedFileStream.WriteToFile
This commit is contained in:
parent
f38b188046
commit
b2cc5d50bd
1
Core/FormBrowser.Designer.cs
generated
1
Core/FormBrowser.Designer.cs
generated
@ -24,7 +24,6 @@ protected override void Dispose(bool disposing) {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent() {
|
private void InitializeComponent() {
|
||||||
this.components = new System.ComponentModel.Container();
|
this.components = new System.ComponentModel.Container();
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormBrowser));
|
|
||||||
this.trayIcon = new TweetDck.Core.TrayIcon();
|
this.trayIcon = new TweetDck.Core.TrayIcon();
|
||||||
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
|
||||||
this.SuspendLayout();
|
this.SuspendLayout();
|
||||||
|
1
Core/Other/FormSettings.Designer.cs
generated
1
Core/Other/FormSettings.Designer.cs
generated
@ -23,7 +23,6 @@ protected override void Dispose(bool disposing) {
|
|||||||
/// the contents of this method with the code editor.
|
/// the contents of this method with the code editor.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitializeComponent() {
|
private void InitializeComponent() {
|
||||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormSettings));
|
|
||||||
this.btnClose = new System.Windows.Forms.Button();
|
this.btnClose = new System.Windows.Forms.Button();
|
||||||
this.labelTip = new System.Windows.Forms.Label();
|
this.labelTip = new System.Windows.Forms.Label();
|
||||||
this.tabPanel = new TweetDck.Core.Controls.TabPanel();
|
this.tabPanel = new TweetDck.Core.Controls.TabPanel();
|
||||||
|
@ -89,8 +89,11 @@ public void WriteToFile(string path){
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void WriteToFile(string path, bool createDirectory){
|
public void WriteToFile(string path, bool createDirectory){
|
||||||
// ReSharper disable once AssignNullToNotNullAttribute
|
if (createDirectory){
|
||||||
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
// ReSharper disable once AssignNullToNotNullAttribute
|
||||||
|
Directory.CreateDirectory(Path.GetDirectoryName(path));
|
||||||
|
}
|
||||||
|
|
||||||
File.WriteAllBytes(path, contents);
|
File.WriteAllBytes(path, contents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,9 @@ public bool Export(bool includeSession){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (split.Length == 3){
|
else if (split.Length == 3){
|
||||||
if (split[2].Equals(".meta", StringComparison.InvariantCultureIgnoreCase) ||
|
if (split[2].Equals(".meta", StringComparison.OrdinalIgnoreCase) ||
|
||||||
split[2].Equals("browser.js", StringComparison.InvariantCultureIgnoreCase) ||
|
split[2].Equals("browser.js", StringComparison.OrdinalIgnoreCase) ||
|
||||||
split[2].Equals("notification.js", StringComparison.InvariantCultureIgnoreCase)){
|
split[2].Equals("notification.js", StringComparison.OrdinalIgnoreCase)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public static int AddToDictionary(string args, IDictionary<string, string> dicti
|
|||||||
value = matchValue.Substring(indexEquals+1).Trim('"');
|
value = matchValue.Substring(indexEquals+1).Trim('"');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key != string.Empty){
|
if (key.Length != 0){
|
||||||
dictionary[key] = value;
|
dictionary[key] = value;
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public PluginControl(PluginManager pluginManager, Plugin plugin) : this(){
|
|||||||
this.labelName.ForeColor = Color.DarkRed;
|
this.labelName.ForeColor = Color.DarkRed;
|
||||||
this.btnToggleState.Enabled = false;
|
this.btnToggleState.Enabled = false;
|
||||||
}
|
}
|
||||||
else if (labelDescription.Text == string.Empty){
|
else if (labelDescription.Text.Length == 0){
|
||||||
labelDescription.Visible = false;
|
labelDescription.Visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public PluginControl(PluginManager pluginManager, Plugin plugin) : this(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void panelDescription_Resize(object sender, EventArgs e){
|
private void panelDescription_Resize(object sender, EventArgs e){
|
||||||
if (labelDescription.Text == string.Empty){
|
if (labelDescription.Text.Length == 0){
|
||||||
Height = MinimumSize.Height;
|
Height = MinimumSize.Height;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -93,7 +93,7 @@ private static bool LoadEnvironments(string path, Plugin plugin, out string erro
|
|||||||
if (environment != PluginEnvironment.None){
|
if (environment != PluginEnvironment.None){
|
||||||
plugin.Environments |= environment;
|
plugin.Environments |= environment;
|
||||||
}
|
}
|
||||||
else if (!file.StartsWith("user.")){
|
else if (!file.StartsWith("user.", StringComparison.OrdinalIgnoreCase)){
|
||||||
error = "Unknown script file: "+file+". All custom script files have to be in the following naming style: user."+file;
|
error = "Unknown script file: "+file+". All custom script files have to be in the following naming style: user."+file;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ public string ReadFile(int token, string path, bool cache){
|
|||||||
public void DeleteFile(int token, string path){
|
public void DeleteFile(int token, string path){
|
||||||
string fullPath = GetFullPathIfSafe(token, path);
|
string fullPath = GetFullPathIfSafe(token, path);
|
||||||
|
|
||||||
if (fullPath == string.Empty){
|
if (fullPath.Length == 0){
|
||||||
throw new Exception("File path has to be relative to the plugin folder.");
|
throw new Exception("File path has to be relative to the plugin folder.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ public void DeleteFile(int token, string path){
|
|||||||
public bool CheckFileExists(int token, string path){
|
public bool CheckFileExists(int token, string path){
|
||||||
string fullPath = GetFullPathIfSafe(token, path);
|
string fullPath = GetFullPathIfSafe(token, path);
|
||||||
|
|
||||||
if (fullPath == string.Empty){
|
if (fullPath.Length == 0){
|
||||||
throw new Exception("File path has to be relative to the plugin folder.");
|
throw new Exception("File path has to be relative to the plugin folder.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user