[amd64/tramp] hide interpreter specific trampoline behind ifdef
[mono.git] / mcs / class / referencesource / System.Activities.Presentation / System.Activities.Presentation / System / Activities / Presentation / Base / Core / ContextItem.cs
1 //----------------------------------------------------------------
2 // Copyright (c) Microsoft Corporation.  All rights reserved.
3 //----------------------------------------------------------------
4
5 namespace System.Activities.Presentation 
6 {
7     using System.Diagnostics.CodeAnalysis;
8
9
10     using System;
11     using System.Collections.Generic;
12
13     // <summary>
14     // The ContextItem class is the base class from which all context items must derive.
15     // </summary>
16     public abstract class ContextItem 
17     {
18
19         // <summary>
20         // Creates a new ContextItem.
21         // </summary>
22         protected ContextItem() 
23         {
24         }
25
26         // <summary>
27         // Returns the item type for this editing context item.  Context items are
28         // considered unique based on their item type.  By using ItemType to identify
29         // a type of context item we allow several derived versions of context items to
30         // be cataloged under the same key in the editing context.
31         // </summary>
32         // <value></value>
33         public abstract Type ItemType 
34         { get; }
35
36         // <summary>
37         // This method is called on a context item before it is stored in the context item
38         // manager.  The previous item in the context item manager is passed.
39         // </summary>
40         // <param name="context">The editing context that is making this change.</param>
41         // <param name="previousItem">The previously active item in the context.  Because items must have default constructors a default item will be fabricated if an item is first passed into the context.</param>
42         // <returns></returns>
43         protected virtual void OnItemChanged(EditingContext context, ContextItem previousItem) 
44         {
45         }
46
47         //
48         // Internal API that calls OnItemChanged.  This is invoked from the
49         // abstract ContextItemManager class so deriving classes can still
50         // invoke it.
51         //
52         internal void InvokeOnItemChanged(EditingContext context, ContextItem previousItem) 
53         {
54             OnItemChanged(context, previousItem);
55         }
56     }
57 }