Files
UnrealEngineUWP/Engine/Source/Programs/UnrealVS/ProvideSolutionProperties.cs
Joe Kirchoff d6fd9814f7 UnrealVS: Update NuGet to use PackageReference instead of package.config
https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference

Fix Code Analysis warnings
Set warnings as errors
Format all documents & remove unused usings

#rb Joakim.Lindqvist

[CL 16021915 by Joe Kirchoff in ue5-main branch]
2021-04-15 11:28:23 -04:00

51 lines
1.3 KiB
C#

// Copyright Epic Games, Inc. All Rights Reserved.
using Microsoft.VisualStudio.Shell;
using System;
using System.Globalization;
namespace UnrealVS
{
/// <summary>
/// This attribute registers the package as a solution property parser
/// </summary>
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
internal sealed class ProvideSolutionPropertiesAttribute : RegistrationAttribute
{
private readonly string _propName;
public ProvideSolutionPropertiesAttribute(string propName)
{
_propName = propName;
}
public override void Register(RegistrationContext context)
{
context.Log.WriteLine(string.Format(CultureInfo.InvariantCulture, "ProvideSolutionProps: ({0} = {1})", context.ComponentType.GUID.ToString("B"), PropName));
Key childKey = null;
try
{
childKey = context.CreateKey(string.Format(CultureInfo.InvariantCulture, "{0}\\{1}", "SolutionPersistence", PropName));
childKey.SetValue(string.Empty, context.ComponentType.GUID.ToString("B").ToUpperInvariant());
}
finally
{
if (childKey != null) childKey.Close();
}
}
public override void Unregister(RegistrationContext context)
{
context.RemoveKey(string.Format(CultureInfo.InvariantCulture, "{0}\\{1}", "SolutionPersistence", PropName));
}
public string PropName
{
get { return _propName; }
}
}
}