~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/addins/MonoDevelop.MacDev/MonoDevelop.MacDev.InterfaceBuilder/IBConnectionRecord.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// 
2
 
// IBConnectionRecord.cs
3
 
//  
4
 
// Author:
5
 
//       Michael Hutchinson <mhutchinson@novell.com>
6
 
// 
7
 
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
8
 
// 
9
 
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
 
// of this software and associated documentation files (the "Software"), to deal
11
 
// in the Software without restriction, including without limitation the rights
12
 
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
 
// copies of the Software, and to permit persons to whom the Software is
14
 
// furnished to do so, subject to the following conditions:
15
 
// 
16
 
// The above copyright notice and this permission notice shall be included in
17
 
// all copies or substantial portions of the Software.
18
 
// 
19
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
 
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
 
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
 
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
 
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
 
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
 
// THE SOFTWARE.
26
 
 
27
 
using System;
28
 
 
29
 
namespace MonoDevelop.MacDev.InterfaceBuilder
30
 
{
31
 
 
32
 
        public class IBConnectionRecord : IBObject
33
 
        {
34
 
                public int ConnectionId { get; set; }
35
 
                public IBObject Connection { get; set; }
36
 
                
37
 
                protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
38
 
                {
39
 
                        if (name == "connectionID")
40
 
                                ConnectionId = (int) value;
41
 
                        else if (name == "connection")
42
 
                                Connection = (IBObject) value;
43
 
                        else
44
 
                                base.OnPropertyDeserialized (name, value, resolver);
45
 
                }
46
 
        }
47
 
 
48
 
        public abstract class IBConnection : IBObject
49
 
        {
50
 
                public string Label { get; set; }
51
 
                public IBReference Source { get; set; }
52
 
                public IBReference Destination { get; set; }
53
 
                
54
 
                protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
55
 
                {
56
 
                        if (name == "label")
57
 
                                Label = (string) value;
58
 
                        else if (name == "source")
59
 
                                Source = (IBReference) value;
60
 
                        else if (name == "destination")
61
 
                                Destination = (IBReference) value;
62
 
                        else
63
 
                                base.OnPropertyDeserialized (name, value, resolver);
64
 
                }
65
 
        }
66
 
        
67
 
        public class IBOutletConnection : IBConnection
68
 
        {
69
 
        }
70
 
        
71
 
        public class IBCocoaTouchOutletConnection : IBOutletConnection
72
 
        {
73
 
        }
74
 
        
75
 
        public class IBCocoaTouchEventConnection : IBActionConnection
76
 
        {
77
 
                public int IBEventType { get; set; }
78
 
                
79
 
                protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
80
 
                {
81
 
                        if (name == "IBEventType")
82
 
                                IBEventType = (int) value;
83
 
                        else
84
 
                                base.OnPropertyDeserialized (name, value, resolver);
85
 
                }
86
 
        }
87
 
        
88
 
        public class IBActionConnection : IBOutletConnection
89
 
        {
90
 
        }
91
 
        
92
 
        public class IBClassDescriptionSource : IBObject
93
 
        {
94
 
                public string MajorKey { get; set; }
95
 
                public string MinorKey { get; set; }
96
 
                
97
 
                protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
98
 
                {
99
 
                        if (name == "majorKey")
100
 
                                MajorKey = (string) value;
101
 
                        else if (name == "minorKey")
102
 
                                MinorKey = (string) value;
103
 
                        else
104
 
                                base.OnPropertyDeserialized (name, value, resolver);
105
 
                }
106
 
        }
107
 
        
108
 
        public class IBPartialClassDescription : IBObject
109
 
        {
110
 
                public string ClassName { get; set; }
111
 
                public string SuperclassName { get; set; }
112
 
                public NSMutableDictionary Actions { get; set; }
113
 
                public NSMutableDictionary Outlets { get; set; }
114
 
                public Unref<IBClassDescriptionSource> SourceIdentifier { get; set; }
115
 
                public NSMutableDictionary ToOneOutletInfosByName { get; set; }
116
 
                public NSMutableDictionary ActionInfosByName { get; set; }
117
 
                
118
 
                protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
119
 
                {
120
 
                        switch (name) {
121
 
                        case "className":
122
 
                                ClassName = (string) value;
123
 
                                break;
124
 
                        case "superclassName":
125
 
                                SuperclassName = (string) value;
126
 
                                break;
127
 
                        case "actions":
128
 
                                Actions = (NSMutableDictionary) value;
129
 
                                break;
130
 
                        case "outlets":
131
 
                                Outlets = (NSMutableDictionary) value;
132
 
                                break;
133
 
                        case "sourceIdentifier":
134
 
                                SourceIdentifier = new Unref<IBClassDescriptionSource> (value);
135
 
                                break;
136
 
                        case "toOneOutletInfosByName":
137
 
                                ToOneOutletInfosByName = (NSMutableDictionary) value;
138
 
                                break;
139
 
                        case "actionInfosByName":
140
 
                                ActionInfosByName = (NSMutableDictionary) value;
141
 
                                break;
142
 
                        default:
143
 
                                base.OnPropertyDeserialized (name, value, resolver);
144
 
                                break;
145
 
                        }
146
 
                }
147
 
        }
148
 
}