whitespace fixes

This commit is contained in:
tznind
2023-09-21 06:41:55 +01:00
parent 14fab61d35
commit 6989addd71
3 changed files with 23 additions and 23 deletions

View File

@@ -21,7 +21,7 @@ namespace Terminal.Gui {
/// Gets or sets the default value to use for <see cref="UseColors"/>.
/// This can be populated from .tui config files via <see cref="ConfigurationManager"/>
/// </summary>
[SerializableConfigurationProperty(Scope = typeof (SettingsScope))]
[SerializableConfigurationProperty (Scope = typeof (SettingsScope))]
public static bool DefaultUseColors { get; set; }
/// <summary>
@@ -42,20 +42,20 @@ namespace Terminal.Gui {
/// Gets or sets the class responsible for determining which symbol
/// to use to represent files and directories.
/// </summary>
public FileSystemIconProvider IconProvider { get; set;} = new FileSystemIconProvider();
public FileSystemIconProvider IconProvider { get; set; } = new FileSystemIconProvider ();
/// <summary>
/// Gets or sets the class thatis responsible for determining which color
/// to use to represent files and directories when <see cref="UseColors"/> is
/// <see langword="true"/>.
/// </summary>
public FileSystemColorProvider ColorProvider { get;set;} = new FileSystemColorProvider();
public FileSystemColorProvider ColorProvider { get; set; } = new FileSystemColorProvider ();
/// <summary>
/// Gets or sets the culture to use (e.g. for number formatting).
/// Defaults to <see cref="CultureInfo.CurrentUICulture"/>.
/// </summary>
public CultureInfo Culture {get;set;} = CultureInfo.CurrentUICulture;
public CultureInfo Culture { get; set; } = CultureInfo.CurrentUICulture;
/// <summary>
/// Gets or sets the header text displayed in the Filename column of the files table.
@@ -184,7 +184,7 @@ namespace Terminal.Gui {
}
private Dictionary<IDirectoryInfo,string> DefaultTreeRootGetter ()
private Dictionary<IDirectoryInfo, string> DefaultTreeRootGetter ()
{
var roots = new Dictionary<IDirectoryInfo, string> ();
try {
@@ -192,7 +192,7 @@ namespace Terminal.Gui {
var dir = _fileSystem.DirectoryInfo.New (d);
if (!roots.ContainsKey(dir)) {
if (!roots.ContainsKey (dir)) {
roots.Add (dir, d);
}
}
@@ -206,14 +206,14 @@ namespace Terminal.Gui {
try {
var path = Environment.GetFolderPath (special);
if(string.IsNullOrWhiteSpace (path)) {
if (string.IsNullOrWhiteSpace (path)) {
continue;
}
var dir = _fileSystem.DirectoryInfo.New (path);
if (!roots.ContainsKey (dir) && dir.Exists) {
roots.Add (dir, special.ToString());
roots.Add (dir, special.ToString ());
}
} catch (Exception) {
// Special file exists but contents are unreadable (permissions?)

View File

@@ -105,7 +105,7 @@ namespace Terminal.Gui {
private int currentSortColumn;
private bool currentSortIsAsc = true;
private Dictionary<IDirectoryInfo,string> _treeRoots = new Dictionary<IDirectoryInfo, string>();
private Dictionary<IDirectoryInfo, string> _treeRoots = new Dictionary<IDirectoryInfo, string> ();
/// <summary>
/// Event fired when user attempts to confirm a selection (or multi selection).
@@ -374,13 +374,13 @@ namespace Terminal.Gui {
{
var fsi = (IFileSystemInfo)o;
if(o is IDirectoryInfo dir && _treeRoots.ContainsKey(dir)) {
if (o is IDirectoryInfo dir && _treeRoots.ContainsKey (dir)) {
// Directory has a special name e.g. 'Pictures'
return _treeRoots [dir];
}
return (Style.IconProvider.GetIconWithOptionalSpace(fsi) + fsi.Name).Trim();
return (Style.IconProvider.GetIconWithOptionalSpace (fsi) + fsi.Name).Trim ();
}
private void OnTableViewMouseClick (object sender, MouseEventEventArgs e)
@@ -647,8 +647,8 @@ namespace Terminal.Gui {
this.btnForward.Text = this.GetForwardButtonText ();
this.btnToggleSplitterCollapse.Text = this.GetToggleSplitterText (false);
if(Style.FlipOkCancelButtonLayoutOrder) {
btnCancel.X = Pos.Function(this.CalculateOkButtonPosX);
if (Style.FlipOkCancelButtonLayoutOrder) {
btnCancel.X = Pos.Function (this.CalculateOkButtonPosX);
btnOk.X = Pos.Right (btnCancel) + 1;
@@ -1187,13 +1187,13 @@ namespace Terminal.Gui {
}
var color = Style.ColorProvider.GetTrueColor(stats.FileSystemInfo)
?? TrueColor.FromConsoleColor(Color.White);
var black = TrueColor.FromConsoleColor(Color.Black);
var color = Style.ColorProvider.GetTrueColor (stats.FileSystemInfo)
?? TrueColor.FromConsoleColor (Color.White);
var black = TrueColor.FromConsoleColor (Color.Black);
// TODO: Add some kind of cache for this
return new ColorScheme{
Normal = new Attribute (color,black),
return new ColorScheme {
Normal = new Attribute (color, black),
HotNormal = new Attribute (color, black),
Focus = new Attribute (black, color),
HotFocus = new Attribute (black, color),

View File

@@ -123,13 +123,13 @@ namespace UICatalog.Scenarios {
});
Win.Add (new Label ("Buttons") { X = x++, Y = y++ });
Win.Add(new Label("Ok Text:") { X = x, Y = y++ });
Win.Add (new Label ("Ok Text:") { X = x, Y = y++ });
tbOkButton = new TextField () { X = x, Y = y++, Width = 12 };
Win.Add (tbOkButton);
Win.Add (new Label ("Cancel Text:") { X = x, Y = y++ });
tbCancelButton = new TextField () { X = x, Y = y++, Width = 12 };
Win.Add (tbCancelButton);
cbFlipButtonOrder = new CheckBox ("Flip Order") { X = x, Y = y++};
cbFlipButtonOrder = new CheckBox ("Flip Order") { X = x, Y = y++ };
Win.Add (cbFlipButtonOrder);
var btn = new Button ($"Run Dialog") {
@@ -187,7 +187,7 @@ namespace UICatalog.Scenarios {
if (cbDrivesOnlyInTree.Checked ?? false) {
fd.Style.TreeRootGetter = () => {
return System.Environment.GetLogicalDrives ().ToDictionary(dirInfoFactory.New,k=>k);
return System.Environment.GetLogicalDrives ().ToDictionary (dirInfoFactory.New, k => k);
};
}
@@ -204,9 +204,9 @@ namespace UICatalog.Scenarios {
fd.Style.OkButtonText = tbOkButton.Text;
}
if (!string.IsNullOrWhiteSpace (tbCancelButton.Text)) {
fd.Style.CancelButtonText= tbCancelButton.Text;
fd.Style.CancelButtonText = tbCancelButton.Text;
}
if(cbFlipButtonOrder.Checked ?? false) {
if (cbFlipButtonOrder.Checked ?? false) {
fd.Style.FlipOkCancelButtonLayoutOrder = true;
}