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

« back to all changes in this revision

Viewing changes to external/maccore/src/AddressBook/ABGroup.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:
2
2
// ABGroup.cs: Implements the managed ABGroup
3
3
//
4
4
// Authors: Mono Team
 
5
//          Marek Safar (marek.safar@gmail.com)
5
6
//     
6
7
// Copyright (C) 2009 Novell, Inc
 
8
// Copyright (C) 2012 Xamarin Inc.
7
9
//
8
10
// Permission is hereby granted, free of charge, to any person obtaining
9
11
// a copy of this software and associated documentation files (the
65
67
                extern static IntPtr ABGroupCreate ();
66
68
 
67
69
                public ABGroup ()
68
 
                        : base (ABGroupCreate (), null)
 
70
                        : base (ABGroupCreate (), true)
69
71
                {
70
72
                        InitConstants.Init ();
71
73
                }
72
74
 
 
75
                [DllImport (Constants.AddressBookLibrary)]
 
76
                extern static IntPtr ABGroupCreateInSource (IntPtr source);
 
77
 
 
78
                [Since (4,0)]
 
79
                public ABGroup (ABRecord source)
 
80
                        : base (IntPtr.Zero, true)
 
81
                {
 
82
                        if (source == null)
 
83
                                throw new ArgumentNullException ("source");
 
84
 
 
85
                        Handle = ABGroupCreateInSource (source.Handle);
 
86
                }
 
87
 
 
88
                internal ABGroup (IntPtr handle, bool owns)
 
89
                        : base (handle, owns)
 
90
                {
 
91
                }
 
92
 
73
93
                internal ABGroup (IntPtr handle, ABAddressBook addressbook)
74
 
                        : base (CFObject.CFRetain (handle), addressbook)
 
94
                : base (handle, false)
75
95
                {
 
96
                        AddressBook = addressbook;
76
97
                }
77
98
 
78
99
                public string Name {
81
102
                }
82
103
 
83
104
                [DllImport (Constants.AddressBookLibrary)]
 
105
                extern static IntPtr ABGroupCopySource (IntPtr group);
 
106
 
 
107
                [Since (4,0)]
 
108
                public ABRecord Source {
 
109
                        get {
 
110
                                var h = ABGroupCopySource (Handle);
 
111
                                if (h == IntPtr.Zero)
 
112
                                        return null;
 
113
 
 
114
                                return FromHandle (h, null);
 
115
                        }
 
116
                }
 
117
 
 
118
                [DllImport (Constants.AddressBookLibrary)]
84
119
                extern static bool ABGroupAddMember (IntPtr group, IntPtr person, out IntPtr error);
85
120
                public void Add (ABRecord person)
86
121
                {