Skip to content

Commit

Permalink
Simplify names
Browse files Browse the repository at this point in the history
  • Loading branch information
davkean committed Nov 12, 2021
1 parent 242eea4 commit 9eea9c1
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public StartupServiceAttribute()
/// Gets or sets the priority in which the <see cref="IService"/> object's <see cref="IStartup.Startup"/> method
/// </summary>
/// <value>
/// An <see cref="Int32"/> containing the priority in which <see cref="IService"/> object's <see cref="IStartup.Startup"/> method is called. Lower is higher in priority.
/// An <see cref="int"/> containing the priority in which <see cref="IService"/> object's <see cref="IStartup.Startup"/> method is called. Lower is higher in priority.
/// </value>
public int Priority
{
Expand Down
2 changes: 1 addition & 1 deletion src/AudioSwitcher/Audio/AudioDeviceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public bool IsDefaultAudioDevice(AudioDevice device, AudioDeviceRole role)
if (defaultDevice == null)
return false;

return String.Equals(defaultDevice.Id, device.Id, StringComparison.OrdinalIgnoreCase);
return string.Equals(defaultDevice.Id, device.Id, StringComparison.OrdinalIgnoreCase);
}

public AudioDevice GetDefaultAudioDevice(AudioDeviceKind kind, AudioDeviceRole role)
Expand Down
2 changes: 1 addition & 1 deletion src/AudioSwitcher/Audio/Interop/MMAudio/PropVariant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public T[] GetBlobAsArrayOf<T>()
int structSize = Marshal.SizeOf(singleInstance);
if (blobByteLength%structSize != 0)
{
throw new InvalidDataException(String.Format("Blob size {0} not a multiple of struct size {1}", blobByteLength, structSize));
throw new InvalidDataException(string.Format("Blob size {0} not a multiple of struct size {1}", blobByteLength, structSize));
}
int items = blobByteLength/structSize;
var array = new T[items];
Expand Down
2 changes: 1 addition & 1 deletion src/AudioSwitcher/Presentation/Drawing/ShellIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static Icon ExtractIconByIdOrIndex(string fileNameAndIdOrIndex)
if (parts.Length == 1)
return ExtractIcon(parts[0]);

if (!Int32.TryParse(parts[1], out int index))
if (!int.TryParse(parts[1], out int index))
throw new FormatException();

if (index >= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void OnRenderToolStripBackground(ToolStripRenderEventArgs e)

protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
{
if (String.IsNullOrEmpty(e.Text)) // Separator
if (string.IsNullOrEmpty(e.Text)) // Separator
return;

string[] text = e.Text.Split(NewLine, 3, StringSplitOptions.None);
Expand All @@ -55,10 +55,10 @@ protected override void OnRenderItemText(ToolStripItemTextRenderEventArgs e)
Debug.Assert(text.Length == 3);

// First render the first line in normal menu text color
base.OnRenderItemText(new ToolStripItemTextRenderEventArgs(e.Graphics, e.Item, String.Concat(text[0], Environment.NewLine, Environment.NewLine), e.TextRectangle, e.TextColor, e.TextFont, e.TextFormat));
base.OnRenderItemText(new ToolStripItemTextRenderEventArgs(e.Graphics, e.Item, string.Concat(text[0], Environment.NewLine, Environment.NewLine), e.TextRectangle, e.TextColor, e.TextFont, e.TextFormat));

// Then render, the bottom two lines in gray text
TextRenderer.DrawText(e.Graphics, String.Concat(Environment.NewLine, text[1], Environment.NewLine, text[2]), e.TextFont, e.TextRectangle, SystemColors.GrayText, e.TextFormat);
TextRenderer.DrawText(e.Graphics, string.Concat(Environment.NewLine, text[1], Environment.NewLine, text[2]), e.TextFont, e.TextRectangle, SystemColors.GrayText, e.TextFormat);
}

protected override Rectangle GetBackgroundRectangle(ToolStripItem item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private bool IsRunAtWindowsStartup(RegistryKey root)
{
if (key.TryGetValue(RunAtWindowsStartupValueName, out string value))
{
return String.Equals(value, RunAtWindowsStartupValue, StringComparison.OrdinalIgnoreCase);
return string.Equals(value, RunAtWindowsStartupValue, StringComparison.OrdinalIgnoreCase);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/AudioSwitcher/UI/ViewModels/AudioDeviceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private string GetDeviceStateFriendlyName()
return Resources.DeviceState_Unplugged;
}

return String.Empty;
return string.Empty;
}

private Image GetImage(string iconPath)
Expand Down Expand Up @@ -209,10 +209,10 @@ private Image GetDeviceImage(string iconPath)

private Icon GetIconFromDeviceIconPath(string iconPath)
{
if (String.IsNullOrEmpty(iconPath))
if (string.IsNullOrEmpty(iconPath))
return null;

if (String.IsNullOrEmpty(iconPath) || !ShellIcon.TryExtractIconByIdOrIndex(iconPath, IconSize, out Icon icon))
if (string.IsNullOrEmpty(iconPath) || !ShellIcon.TryExtractIconByIdOrIndex(iconPath, IconSize, out Icon icon))
return new Icon(Resources.FallbackDevice, IconSize);

return icon;
Expand Down

0 comments on commit 9eea9c1

Please sign in to comment.