-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathCustomDisplayDialog.cs
More file actions
37 lines (32 loc) · 1.4 KB
/
Copy pathCustomDisplayDialog.cs
File metadata and controls
37 lines (32 loc) · 1.4 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
// Unity C# reference source
// Copyright (c) Unity Technologies. For terms of use, see
// https://unity3d.com/legal/licenses/Unity_Reference_Only_License
using System;
using System.Diagnostics.CodeAnalysis;
namespace UnityEditor.PackageManager.UI.Internal
{
internal interface ICustomDisplayDialog : IService
{
DialogResult Show(CustomDialogArgsBase args);
}
[ExcludeFromCodeCoverage]
internal class CustomDisplayDialog : BaseService<ICustomDisplayDialog>, ICustomDisplayDialog
{
private readonly IApplicationProxy m_ApplicationProxy;
private readonly IResourceLoader m_ResourceLoader;
public CustomDisplayDialog(IApplicationProxy applicationProxy, IResourceLoader resourceLoader)
{
m_ApplicationProxy = RegisterDependency(applicationProxy);
m_ResourceLoader = RegisterDependency(resourceLoader);
}
public DialogResult Show(CustomDialogArgsBase args)
{
if (args == null)
throw new ArgumentNullException(nameof(args));
var content = new CustomDisplayDialogContent(m_ApplicationProxy, m_ResourceLoader, args);
if (ModalWindowContainer.ShowModal(content))
PackageManagerDialogAnalytics.SendEvent(content.args.idForAnalytics, content.windowTitle, content.args.bodyText, content.result.ToString());
return content.result;
}
}
}