-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathQueryFactory.cs
More file actions
37 lines (35 loc) · 1.21 KB
/
QueryFactory.cs
File metadata and controls
37 lines (35 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// <copyright file="QueryFactory.cs" company="Microsoft Corporation">
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt in the project root for license information.
// </copyright>
namespace Microsoft.VisualStudio.Setup
{
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Setup.Configuration;
/// <summary>
/// Factory class used to create instances of <see cref="ISetupConfiguration2"/>.
/// </summary>
internal static class QueryFactory
{
/// <summary>
/// Creates an instance of a class implementing <see cref="ISetupConfiguration2"/>.
/// </summary>
/// <returns>An instance of a class implementing <see cref="ISetupConfiguration2"/>.</returns>
public static ISetupConfiguration2 Create()
{
try
{
return new SetupConfiguration();
}
catch (COMException ex) when (ex.ErrorCode == NativeMethods.REGDB_E_CLASSNOTREG)
{
return null;
}
catch (FileNotFoundException)
{
return null;
}
}
}
}