Skip to content

Commit

Permalink
Format code with csharpier (#1330)
Browse files Browse the repository at this point in the history
* Format code with csharpier

* Format code
  • Loading branch information
pomianowski authored Feb 1, 2025
1 parent 1b892e3 commit fc346b5
Show file tree
Hide file tree
Showing 110 changed files with 355 additions and 329 deletions.
2 changes: 1 addition & 1 deletion docs/codesnippet/Rtf/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public FileModel Load(FileAndType file, ImmutableDictionary<string, object> meta
EnvironmentContext.FileAbstractLayer.GetPhysicalPath(file.File)
);

return new FileModel(file, content) { LocalPathFromRoot = localPathFromRoot, };
return new FileModel(file, content) { LocalPathFromRoot = localPathFromRoot };
}
#endregion

Expand Down
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.Console/Views/Pages/DataPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void InitializeData()
(byte)random.Next(0, 250),
(byte)random.Next(0, 250)
)
)
),
}
);
}
Expand Down
17 changes: 8 additions & 9 deletions samples/Wpf.Ui.Demo.Dialogs/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ private async void OnShowDialogClick(object sender, RoutedEventArgs e)
private async Task ShowSampleDialogAsync()
{
// Defining dialog object
ContentDialog myDialog =
new()
{
Title = "My sample dialog",
Content = "Content of the dialog",
CloseButtonText = "Close button",
PrimaryButtonText = "Primary button",
SecondaryButtonText = "Secondary button"
};
ContentDialog myDialog = new()
{
Title = "My sample dialog",
Content = "Content of the dialog",
CloseButtonText = "Close button",
PrimaryButtonText = "Primary button",
SecondaryButtonText = "Secondary button",
};

// Setting the dialog container
myDialog.DialogHost = ContentPresenterForDialogs;
Expand Down
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.Mvvm/ViewModels/DataViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private void InitializeViewModel()
(byte)random.Next(0, 250),
(byte)random.Next(0, 250)
)
)
),
}
);
}
Expand Down
6 changes: 3 additions & 3 deletions samples/Wpf.Ui.Demo.Mvvm/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ private void InitializeViewModel()
{
Content = "Home",
Icon = new SymbolIcon { Symbol = SymbolRegular.Home24 },
TargetPageType = typeof(Views.Pages.DashboardPage)
TargetPageType = typeof(Views.Pages.DashboardPage),
},
new NavigationViewItem()
{
Content = "Data",
Icon = new SymbolIcon { Symbol = SymbolRegular.DataHistogram24 },
TargetPageType = typeof(Views.Pages.DataPage)
TargetPageType = typeof(Views.Pages.DataPage),
},
];

Expand All @@ -63,7 +63,7 @@ private void InitializeViewModel()
{
Content = "Settings",
Icon = new SymbolIcon { Symbol = SymbolRegular.Settings24 },
TargetPageType = typeof(Views.Pages.SettingsPage)
TargetPageType = typeof(Views.Pages.SettingsPage),
},
];

Expand Down
2 changes: 1 addition & 1 deletion samples/Wpf.Ui.Demo.Simple/Views/Pages/DataPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private void InitializeData()
(byte)random.Next(0, 250),
(byte)random.Next(0, 250)
)
)
),
}
);
}
Expand Down
7 changes: 4 additions & 3 deletions src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,12 @@ private void OnClick(string? param)

string navigationUrl = param switch
{
"doc" when GetDocumentationType(_page) is { } documentationType
=> CreateUrlForDocumentation(documentationType),
"doc" when GetDocumentationType(_page) is { } documentationType => CreateUrlForDocumentation(
documentationType
),
"xaml" => CreateUrlForGithub(_page.GetType(), ".xaml"),
"c#" => CreateUrlForGithub(_page.GetType(), ".xaml.cs"),
_ => string.Empty
_ => string.Empty,
};

if (string.IsNullOrEmpty(navigationUrl))
Expand Down
4 changes: 2 additions & 2 deletions src/Wpf.Ui.Gallery/Helpers/PaneDisplayModeToIndexConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public object Convert(object? value, Type targetType, object? parameter, Culture
NavigationViewPaneDisplayMode.LeftFluent => 1,
NavigationViewPaneDisplayMode.Top => 2,
NavigationViewPaneDisplayMode.Bottom => 3,
_ => 0
_ => 0,
};
}

Expand All @@ -27,7 +27,7 @@ public object ConvertBack(object? value, Type targetType, object? parameter, Cul
1 => NavigationViewPaneDisplayMode.LeftFluent,
2 => NavigationViewPaneDisplayMode.Top,
3 => NavigationViewPaneDisplayMode.Bottom,
_ => NavigationViewPaneDisplayMode.Left
_ => NavigationViewPaneDisplayMode.Left,
};
}
}
2 changes: 1 addition & 1 deletion src/Wpf.Ui.Gallery/Models/Unit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public enum Unit
{
Grams,
Kilograms,
Milliliters
Milliliters,
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public partial class AllControlsViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
.OrderBy(x => x.Name)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class BasicInputViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ private void OnSingleChecked(string option)
bool allUnchecked =
!OptionOneCheckBoxChecked && !OptionTwoCheckBoxChecked && !OptionThreeCheckBoxChecked;

SelectAllCheckBoxChecked = allChecked
? true
: allUnchecked
? false
: (bool?)null;
SelectAllCheckBoxChecked =
allChecked ? true
: allUnchecked ? false
: (bool?)null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public partial class ComboBoxViewModel : ViewModel
"Arial",
"Comic Sans MS",
"Segoe UI",
"Times New Roman"
"Times New Roman",
];

[ObservableProperty]
Expand All @@ -32,6 +32,6 @@ public partial class ComboBoxViewModel : ViewModel
28,
36,
48,
72
72,
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ThumbRateState ThumbRateState
{
ThumbRateState.Liked => "Liked",
ThumbRateState.Disliked => "Disliked",
_ => "None"
_ => "None",
};

ThumRateStateCodeText = $"<ui:ThumbRate State=\"{ThumRateStateText}\" />";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class CollectionsViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private static ObservableCollection<Product> GenerateProducts()
Unit = units[random.Next(0, units.Length)],
UnitPrice = Math.Round(random.NextDouble() * 20.0, 3),
UnitsInStock = random.Next(0, 100),
IsVirtual = random.Next(0, 2) == 1
IsVirtual = random.Next(0, 2) == 1,
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ public partial class ListBoxViewModel : ViewModel
"Comic Sans MS",
"Courier New",
"Segoe UI",
"Times New Roman"
"Times New Roman",
];
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private static ObservableCollection<Person> GeneratePersons()
"Arielle",
"Arielle",
"Jamie",
"Alexzander"
"Alexzander",
};
var surnames = new[]
{
Expand All @@ -64,7 +64,7 @@ private static ObservableCollection<Person> GeneratePersons()
"Banks",
"Hood",
"Fry",
"Carroll"
"Carroll",
};
var companies = new[]
{
Expand All @@ -74,7 +74,7 @@ private static ObservableCollection<Person> GeneratePersons()
"Megabyte Computers Inc",
"Roude Mics",
"XD Projekt Red S.A.",
"Lepo.co"
"Lepo.co",
};

for (int i = 0; i < 50; i++)
Expand All @@ -97,7 +97,7 @@ private void UpdateListViewSelectionMode(int selectionModeIndex)
{
1 => SelectionMode.Multiple,
2 => SelectionMode.Extended,
_ => SelectionMode.Single
_ => SelectionMode.Single,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class DateAndTimeViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public IconsViewModel()
Name = iconName,
Icon = icon,
Symbol = ((char)icon).ToString(),
Code = ((int)icon).ToString("X4")
Code = ((int)icon).ToString("X4"),
}
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private async Task OnShowDialog(object content)
{
ContentDialogResult.Primary => "User saved their work",
ContentDialogResult.Secondary => "User did not save their work",
_ => "User cancelled the dialog"
_ => "User cancelled the dialog",
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class DialogsAndFlyoutsViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ private void UpdateSnackbarAppearance(int appearanceIndex)
6 => ControlAppearance.Light,
7 => ControlAppearance.Dark,
8 => ControlAppearance.Transparent,
_ => ControlAppearance.Primary
_ => ControlAppearance.Primary,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class LayoutViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class MediaViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class BreadcrumbBarViewModel : ViewModel
"Images",
"Folder1",
"Folder2",
"Folder3"
"Folder3",
];

[ObservableProperty]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public partial class NavigationViewModel : ViewModel
Name = x.Name,
Icon = x.Icon,
Description = x.Description,
PageType = x.PageType
PageType = x.PageType,
})
);
}
Loading

0 comments on commit fc346b5

Please sign in to comment.