-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDTIPhoneSimulatorApplicationSpecifier.cs
86 lines (76 loc) · 3.95 KB
/
DTIPhoneSimulatorApplicationSpecifier.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
using System;
using System.Runtime.InteropServices;
using MonoMac;
using MonoMac.Foundation;
using MonoMac.ObjCRuntime;
namespace IosSimulatorClientBinding
{
[Register("DTiPhoneSimulatorApplicationSpecifier", true)]
public class DTiPhoneSimulatorApplicationSpecifier : NSObject
{
#region selector handles
private static readonly IntPtr SelBundleIdHandle = Selector.GetHandle("bundleID");
private static readonly IntPtr SelSetBundleIdHandle = Selector.GetHandle("setBundleID:");
private static readonly IntPtr SelAppPathHandle = Selector.GetHandle("appPath");
private static readonly IntPtr SelSetAppPathHandle = Selector.GetHandle("setAppPath:");
private static readonly IntPtr SelSpecifierWithApplicationPathHandle = Selector.GetHandle("specifierWithApplicationPath:");
private static readonly IntPtr SelSpecifierWithApplicationBundleIdentifierHandle = Selector.GetHandle("specifierWithApplicationBundleIdentifier:");
private static readonly IntPtr ClassPtr = Class.GetHandle("DTiPhoneSimulatorApplicationSpecifier");
#endregion
public override IntPtr ClassHandle { get { return ClassPtr; } }
[Export("init")]
public DTiPhoneSimulatorApplicationSpecifier() : base(NSObjectFlag.Empty)
{
Handle = Messaging.IntPtr_objc_msgSend(Handle, Selector.Init);
}
[Export("initWithCoder:")]
public DTiPhoneSimulatorApplicationSpecifier(NSCoder coder) : base(NSObjectFlag.Empty)
{
Handle = Messaging.IntPtr_objc_msgSend_IntPtr(Handle, Selector.InitWithCoder, coder.Handle);
}
public DTiPhoneSimulatorApplicationSpecifier(NSObjectFlag t) : base(t) {}
public DTiPhoneSimulatorApplicationSpecifier(IntPtr handle) : base(handle) {}
public virtual string BundleId
{
[Export("bundleID")] get { return NSString.FromHandle(Messaging.IntPtr_objc_msgSend(Handle, SelBundleIdHandle)); }
[Export("setBundleID:")]
set
{
if (value == null) throw new ArgumentNullException("value");
var nsvalue = NSString.CreateNative(value);
Messaging.void_objc_msgSend_IntPtr(Handle, SelSetBundleIdHandle, nsvalue);
NSString.ReleaseNative(nsvalue);
}
}
public virtual string AppPath
{
[Export("appPath")] get { return NSString.FromHandle(Messaging.IntPtr_objc_msgSend(Handle, SelAppPathHandle)); }
[Export("setAppPath:")]
set
{
if (value == null) throw new ArgumentNullException("value");
var nsvalue = NSString.CreateNative(value);
Messaging.void_objc_msgSend_IntPtr(Handle, SelSetAppPathHandle, nsvalue);
NSString.ReleaseNative(nsvalue);
}
}
[Export("specifierWithApplicationPath:")]
public static DTiPhoneSimulatorApplicationSpecifier SpecifierWithApplicationPath(string appPath)
{
if (appPath == null) throw new ArgumentNullException("appPath");
var nsappPath = NSString.CreateNative(appPath);
var ret = Runtime.GetNSObject(Messaging.IntPtr_objc_msgSend_IntPtr(ClassPtr, SelSpecifierWithApplicationPathHandle, nsappPath));
NSString.ReleaseNative(nsappPath);
return ret as DTiPhoneSimulatorApplicationSpecifier;
}
[Export("specifierWithApplicationBundleIdentifier:")]
public static DTiPhoneSimulatorApplicationSpecifier SpecifierWithApplicationBundleIdentifier(string bundleID)
{
if (bundleID == null) throw new ArgumentNullException("bundleID");
var nsbundleId = NSString.CreateNative(bundleID);
var ret = Runtime.GetNSObject(Messaging.IntPtr_objc_msgSend_IntPtr(ClassPtr, SelSpecifierWithApplicationBundleIdentifierHandle, nsbundleId));
NSString.ReleaseNative(nsbundleId);
return ret as DTiPhoneSimulatorApplicationSpecifier;
}
}
}