2
// IBConnectionRecord.cs
5
// Michael Hutchinson <mhutchinson@novell.com>
7
// Copyright (c) 2009 Novell, Inc. (http://www.novell.com)
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:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
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
29
namespace MonoDevelop.MacDev.InterfaceBuilder
32
public class IBConnectionRecord : IBObject
34
public int ConnectionId { get; set; }
35
public IBObject Connection { get; set; }
37
protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
39
if (name == "connectionID")
40
ConnectionId = (int) value;
41
else if (name == "connection")
42
Connection = (IBObject) value;
44
base.OnPropertyDeserialized (name, value, resolver);
48
public abstract class IBConnection : IBObject
50
public string Label { get; set; }
51
public IBReference Source { get; set; }
52
public IBReference Destination { get; set; }
54
protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
57
Label = (string) value;
58
else if (name == "source")
59
Source = (IBReference) value;
60
else if (name == "destination")
61
Destination = (IBReference) value;
63
base.OnPropertyDeserialized (name, value, resolver);
67
public class IBOutletConnection : IBConnection
71
public class IBCocoaTouchOutletConnection : IBOutletConnection
75
public class IBCocoaTouchEventConnection : IBActionConnection
77
public int IBEventType { get; set; }
79
protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
81
if (name == "IBEventType")
82
IBEventType = (int) value;
84
base.OnPropertyDeserialized (name, value, resolver);
88
public class IBActionConnection : IBOutletConnection
92
public class IBClassDescriptionSource : IBObject
94
public string MajorKey { get; set; }
95
public string MinorKey { get; set; }
97
protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
99
if (name == "majorKey")
100
MajorKey = (string) value;
101
else if (name == "minorKey")
102
MinorKey = (string) value;
104
base.OnPropertyDeserialized (name, value, resolver);
108
public class IBPartialClassDescription : IBObject
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; }
118
protected override void OnPropertyDeserialized (string name, object value, IReferenceResolver resolver)
122
ClassName = (string) value;
124
case "superclassName":
125
SuperclassName = (string) value;
128
Actions = (NSMutableDictionary) value;
131
Outlets = (NSMutableDictionary) value;
133
case "sourceIdentifier":
134
SourceIdentifier = new Unref<IBClassDescriptionSource> (value);
136
case "toOneOutletInfosByName":
137
ToOneOutletInfosByName = (NSMutableDictionary) value;
139
case "actionInfosByName":
140
ActionInfosByName = (NSMutableDictionary) value;
143
base.OnPropertyDeserialized (name, value, resolver);