Skip to content

Commit

Permalink
Merge pull request #815 from lepoco/update/preview-9
Browse files Browse the repository at this point in the history
Format code & Bump version
  • Loading branch information
pomianowski authored Nov 13, 2023
2 parents e7ba446 + 15a55ae commit d9f9fa4
Show file tree
Hide file tree
Showing 42 changed files with 362 additions and 235 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<Version>3.0.0-preview.8</Version>
<Version>3.0.0-preview.9</Version>
<LangVersion>11.0</LangVersion>
<Deterministic>true</Deterministic>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/Hyperlink/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace RtfDocumentProcessors
using System.Linq;
using System.Web;
using System.Xml.Linq;

using Microsoft.DocAsCode.Plugins;
using Microsoft.DocAsCode.Utility;

Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/RtfBuildStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace RtfDocumentProcessors
using System.Composition;
using System.Threading.Tasks;
using System.Threading.Tasks.Schedulers;

using MarkupConverter;
using Microsoft.DocAsCode.Plugins;

Expand Down
1 change: 0 additions & 1 deletion docs/codesnippet/Rtf/RtfDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ namespace RtfDocumentProcessors
using System.Collections.Immutable;
using System.Composition;
using System.IO;

using Microsoft.DocAsCode.Common;
using Microsoft.DocAsCode.Plugins;

Expand Down
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Extension.Template.Compact/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global using System;
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using System;
global using System.Windows;
global using Wpf.Ui.Services;
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Extension.Template.Fluent/Usings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
global using System;
global using System.Windows;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.ComponentModel;
global using CommunityToolkit.Mvvm.Input;
global using System;
global using System.Windows;
global using Wpf.Ui.Services;
3 changes: 2 additions & 1 deletion src/Wpf.Ui.FontMapper/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ await httpClient.GetFromJsonAsync<IEnumerable<GitTag>>(
)
)
?.Last()
?.Ref.Replace("refs/tags/", String.Empty)
?.Ref
.Replace("refs/tags/", String.Empty)
.Trim() ?? throw new Exception("Unable to parse the version string");
}

Expand Down
11 changes: 7 additions & 4 deletions src/Wpf.Ui.Gallery/Controls/GalleryNavigationPresenter.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,13 @@ private void OnTemplateButtonClick(Type? pageType)
}

#if DEBUG
System.Diagnostics.Debug.WriteLine(
$"INFO | {nameof(GalleryNavigationPresenter)} navigated, ({pageType})",
"Wpf.Ui.Gallery"
);
System
.Diagnostics
.Debug
.WriteLine(
$"INFO | {nameof(GalleryNavigationPresenter)} navigated, ({pageType})",
"Wpf.Ui.Gallery"
);
#endif
}
}
13 changes: 8 additions & 5 deletions src/Wpf.Ui.Gallery/Controls/PageControlDocumentation.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,13 @@ private static void SwitchThemes()
{
var currentTheme = Wpf.Ui.Appearance.ApplicationThemeManager.GetAppTheme();

Wpf.Ui.Appearance.ApplicationThemeManager.Apply(
currentTheme == Wpf.Ui.Appearance.ApplicationTheme.Light
? Wpf.Ui.Appearance.ApplicationTheme.Dark
: Wpf.Ui.Appearance.ApplicationTheme.Light
);
Wpf.Ui
.Appearance
.ApplicationThemeManager
.Apply(
currentTheme == Wpf.Ui.Appearance.ApplicationTheme.Light
? Wpf.Ui.Appearance.ApplicationTheme.Dark
: Wpf.Ui.Appearance.ApplicationTheme.Light
);
}
}
3 changes: 2 additions & 1 deletion src/Wpf.Ui.Gallery/ControlsLookup/ControlPages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ static class ControlPages
public static IEnumerable<GalleryPage> All()
{
foreach (
var type in GalleryAssembly.Asssembly
var type in GalleryAssembly
.Asssembly
.GetTypes()
.Where(t => t.IsDefined(typeof(GalleryPageAttribute)))
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ public partial class MainWindowViewModel : ObservableObject
new NavigationViewItem("Expander", typeof(ExpanderPage)),
new NavigationViewItem("CardControl", typeof(CardControlPage))
},

},
#endif
new NavigationViewItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.

using Microsoft.Web.WebView2.Wpf;
using System.Windows.Threading;
using Microsoft.Web.WebView2.Wpf;
using Wpf.Ui.Gallery.Controllers;
using Wpf.Ui.Gallery.Models.Monaco;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
using Wpf.Ui.Gallery.ViewModels.Pages.Layout;

namespace Wpf.Ui.Gallery.Views.Pages.Layout;

/// <summary>
/// Interaction logic for CardControlPage.xaml
/// </summary>
Expand Down
6 changes: 3 additions & 3 deletions src/Wpf.Ui.Gallery/Views/Windows/SandboxWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public SandboxWindow(SandboxWindowViewModel viewModel)

if (configurationBasedLogic)
{
MyTestNavigationView.MenuItems.Add(
new NavigationViewItem("Test", SymbolRegular.Home24, typeof(SamplePage2))
);
MyTestNavigationView
.MenuItems
.Add(new NavigationViewItem("Test", SymbolRegular.Home24, typeof(SamplePage2)));
}
};
}
Expand Down
86 changes: 50 additions & 36 deletions src/Wpf.Ui.SyntaxHighlight/Highlighter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ public static Paragraph FormatAsParagraph(
}
else if (codeMatched.Value.Contains("<") || codeMatched.Value.Contains(">"))
{
paragraph.Inlines.Add(
Line(codeMatched.Value, lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue)
);
paragraph
.Inlines
.Add(Line(codeMatched.Value, lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue));
}
else if (codeMatched.Value.Contains("\""))
{
Expand All @@ -98,26 +98,33 @@ public static Paragraph FormatAsParagraph(
{
for (int i = 0; i < attributeArray.Length; i += 2)
{
paragraph.Inlines.Add(
Line(
attributeArray[i],
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
paragraph.Inlines.Add(
Line("\"", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue)
);
paragraph
.Inlines
.Add(
Line(
attributeArray[i],
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
paragraph
.Inlines
.Add(Line("\"", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue));
paragraph.Inlines.Add(Line(attributeArray[i + 1], Brushes.Coral));
paragraph.Inlines.Add(
Line("\"", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue)
);
paragraph
.Inlines
.Add(Line("\"", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue));
}
}
else
{
paragraph.Inlines.Add(
Line(codeMatched.Value, lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke)
);
paragraph
.Inlines
.Add(
Line(
codeMatched.Value,
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
}
}
else if (codeMatched.Value.Contains("'"))
Expand All @@ -129,33 +136,40 @@ public static Paragraph FormatAsParagraph(
{
for (int i = 0; i < attributeArray.Length; i += 2)
{
paragraph.Inlines.Add(
Line(
attributeArray[i],
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
paragraph.Inlines.Add(
Line("'", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue)
);
paragraph
.Inlines
.Add(
Line(
attributeArray[i],
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
paragraph
.Inlines
.Add(Line("'", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue));
paragraph.Inlines.Add(Line(attributeArray[i + 1], Brushes.Coral));
paragraph.Inlines.Add(
Line("'", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue)
);
paragraph
.Inlines
.Add(Line("'", lightTheme ? Brushes.DarkCyan : Brushes.CornflowerBlue));
}
}
else
{
paragraph.Inlines.Add(
Line(codeMatched.Value, lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke)
);
paragraph
.Inlines
.Add(
Line(
codeMatched.Value,
lightTheme ? Brushes.DarkSlateGray : Brushes.WhiteSmoke
)
);
}
}
else
{
paragraph.Inlines.Add(
Line(codeMatched.Value, lightTheme ? Brushes.CornflowerBlue : Brushes.Aqua)
);
paragraph
.Inlines
.Add(Line(codeMatched.Value, lightTheme ? Brushes.CornflowerBlue : Brushes.Aqua));
}
}
}
Expand Down
27 changes: 15 additions & 12 deletions src/Wpf.Ui.Tray/Hicon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public static IntPtr FromApp()
catch (Exception e)
{
#if DEBUG
System.Diagnostics.Debug.WriteLine(
$"ERROR | Unable to get application hIcon - {e}",
"Wpf.Ui.Hicon"
);
System
.Diagnostics
.Debug
.WriteLine($"ERROR | Unable to get application hIcon - {e}", "Wpf.Ui.Hicon");
throw;
#else
return IntPtr.Zero;
Expand All @@ -72,10 +72,13 @@ public static IntPtr FromSource(ImageSource source)
if (bitmapSource == null)
{
#if DEBUG
System.Diagnostics.Debug.WriteLine(
$"ERROR | Unable to allocate hIcon, ImageSource is not a BitmapSource",
"Wpf.Ui.Hicon"
);
System
.Diagnostics
.Debug
.WriteLine(
$"ERROR | Unable to allocate hIcon, ImageSource is not a BitmapSource",
"Wpf.Ui.Hicon"
);
#endif
return IntPtr.Zero;
}
Expand All @@ -97,10 +100,10 @@ public static IntPtr FromSource(ImageSource source)
if (!gcHandle.IsAllocated)
{
#if DEBUG
System.Diagnostics.Debug.WriteLine(
$"ERROR | Unable to allocate hIcon, allocation failed.",
"Wpf.Ui.Hicon"
);
System
.Diagnostics
.Debug
.WriteLine($"ERROR | Unable to allocate hIcon, allocation failed.", "Wpf.Ui.Hicon");
#endif

return IntPtr.Zero;
Expand Down
Loading

0 comments on commit d9f9fa4

Please sign in to comment.