[reflection] Coop handles icalls in System.Reflection and System.RuntimeTypeHandle...
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Interaction / Services / ViewService.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="ViewService.cs" company="Microsoft">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 namespace System.Activities.Presentation.Services {
8
9     using System;
10     using System.Windows;
11     using System.Activities.Presentation.Model;
12
13     /// <summary>
14     /// This service allows you to move between the model and the view.
15     /// </summary>
16     public abstract class ViewService {
17
18         /// <summary>
19         /// Constructs a new ViewService.
20         /// </summary>
21         protected ViewService() {
22         }
23
24         /// <summary>
25         /// Returns the model corresponding to the view, or null if 
26         /// there is no model matching the view.
27         /// </summary>
28         /// <param name="view">
29         /// The view object you wish to find the model for.
30         /// </param>
31         /// <returns>
32         /// The corresponding model, or null if there is no model for the
33         /// given view object.
34         /// </returns>
35         /// <exception cref="ArgumentNullException">if view is null.</exception>
36         public abstract ModelItem GetModel(DependencyObject view);
37
38         /// <summary>
39         /// Returns the view corresponding to the given model.  This 
40         /// can return null if there is no view for the model.
41         /// </summary>
42         /// <param name="model">
43         /// The model to return the view object for.
44         /// </param>
45         /// <returns>
46         /// The view for this model, or null if there is no view.
47         /// </returns>
48         /// <exception cref="ArgumentNullException">if model is null.</exception>
49         /// <exception cref="ArgumentException">if model does not represent a valid model for this service.</exception>
50         public abstract DependencyObject GetView(ModelItem model);
51     }
52 }