Skip to content

Commit

Permalink
MAUI support related notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlacey committed Feb 5, 2025
1 parent 7c90d75 commit 43fa77e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Support for Visual Studio 2022.
- Combined in to a single VSIX package.
- Now works with MAUI, WinUI, & WPF.
- Removed UWP & Xamarin.Forms specific functionality.

## 0.14.1

Expand Down
22 changes: 11 additions & 11 deletions VSIX/RapidXaml.Utils/ProjectTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,17 @@ public static string GetDescription(this ProjectType source)
return source.ToString();
}

public static bool Matches(this ProjectType source, ProjectType comparewith)
public static bool Matches(this ProjectType source, ProjectType compareWith)
{
return (source & comparewith) == comparewith;
return (source & compareWith) == compareWith;
}

public static ProjectType AsProjectTypeEnum(this string source)
{
if (ProjectType.Uwp.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.Uwp;
}
else if (ProjectType.Wpf.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
if (ProjectType.Wpf.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.Wpf;
}
else if (ProjectType.XamarinForms.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.XamarinForms;
}
else if (ProjectType.WinUI.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.WinUI;
Expand All @@ -53,6 +45,14 @@ public static ProjectType AsProjectTypeEnum(this string source)
{
return ProjectType.MAUI;
}
else if (ProjectType.XamarinForms.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.XamarinForms;
}
else if (ProjectType.Uwp.GetDescription().Equals(source, StringComparison.InvariantCultureIgnoreCase))
{
return ProjectType.Uwp;
}
else
{
return ProjectType.Unknown;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public string GetActiveDocumentFilePath()
return this.Dte.ActiveDocument.FullName;
}

// TODO: check support for detecting MAUI
// TODO: check support for detecting WinUI
public ProjectType GetProjectType(EnvDTE.Project project)
{
Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
Expand Down

0 comments on commit 43fa77e

Please sign in to comment.