FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
MapWindow5/src/MW5.Tools/Helpers/ToolDialogHelper.cs at develop · MapWindow/MapWindow5 · GitHub
MapWindow
/
MapWindow5
Public
Notifications
You must be signed in to change notification settings
Fork
102
Star
308
Code
Issues
14
Pull requests
12
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
MapWindow5
/
src
/
MW5.Tools
/
Helpers
/
ToolDialogHelper.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
34 lines (31 loc) · 1.17 KB
Breadcrumbs
MapWindow5
/
src
/
MW5.Tools
/
Helpers
/
ToolDialogHelper.cs
Copy path
File metadata and controls
34 lines (31 loc) · 1.17 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
// -------------------------------------------------------------------------------------------
// <copyright file="ToolDialogHelper.cs" company="MapWindow OSS Team - www.mapwindow.org">
// MapWindow OSS Team - 2015
// </copyright>
// -------------------------------------------------------------------------------------------
using
MW5
.
Plugins
.
Interfaces
;
using
MW5
.
Plugins
.
Mvp
;
using
MW5
.
Shared
;
using
MW5
.
Tools
.
Model
;
using
MW5
.
Tools
.
Views
;
namespace
MW5
.
Tools
.
Helpers
{
/// <summary>
/// Extension methods for choosing UI to set parameters of the GIS tool.
/// </summary>
public
static
class
ToolDialogHelper
{
/// <summary>
/// Gets MVP presenter to display UI for the tool.
/// </summary>
public
static
IPresenter
<
ToolViewModel
>
GetPresenter
(
this
ITool
tool
,
IAppContext
context
)
{
var
attr
=
AttributeHelper
.
GetAttribute
<
GisToolAttribute
>
(
tool
.
GetType
(
)
)
;
if
(
attr
.
PresenterType
!=
null
)
{
return
context
.
Container
.
GetInstance
(
attr
.
PresenterType
)
as
IPresenter
<
ToolViewModel
>
;
}
return
context
.
Container
.
GetInstance
<
ToolPresenter
>
(
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL