@@ -18,6 +18,21 @@ namespace Parse {
18
18
/// configuration for the Parse library.
19
19
/// </summary>
20
20
public static partial class ParseClient {
21
+ /// <summary>
22
+ /// Represents the configuration of the Parse SDK.
23
+ /// </summary>
24
+ public struct Configuration {
25
+ /// <summary>
26
+ /// The Parse.com application ID of your app.
27
+ /// </summary>
28
+ public String ApplicationId { get ; set ; }
29
+
30
+ /// <summary>
31
+ /// The Parse.com .NET key for your app.
32
+ /// </summary>
33
+ public String WindowsKey { get ; set ; }
34
+ }
35
+
21
36
internal const string DateFormatString = "yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'" ;
22
37
23
38
private static readonly object mutex = new object ( ) ;
@@ -49,12 +64,13 @@ private static Type GetParseType(string name) {
49
64
internal static IPlatformHooks PlatformHooks { get { return platformHooks ; } }
50
65
51
66
private static readonly IParseCommandRunner commandRunner ;
52
- internal static IParseCommandRunner ParseCommandRunner { get { return commandRunner ; } }
53
-
67
+ internal static IParseCommandRunner ParseCommandRunner { get { return commandRunner ; } }
68
+
69
+ /// <summary>
70
+ /// The current configuration that parse has been initialized with.
71
+ /// </summary>
72
+ public static Configuration CurrentConfiguration { get ; internal set ; }
54
73
internal static Uri HostName { get ; set ; }
55
- internal static string MasterKey { get ; set ; }
56
- internal static string ApplicationId { get ; set ; }
57
- internal static string WindowsKey { get ; set ; }
58
74
59
75
internal static Version Version {
60
76
get {
@@ -81,10 +97,24 @@ internal static string VersionString {
81
97
/// <param name="dotnetKey">The .NET API Key provided in the Parse dashboard.
82
98
/// </param>
83
99
public static void Initialize ( string applicationId , string dotnetKey ) {
100
+ Initialize ( new Configuration {
101
+ ApplicationId = applicationId ,
102
+ WindowsKey = dotnetKey
103
+ } ) ;
104
+ }
105
+
106
+ /// <summary>
107
+ /// Authenticates this client as belonging to your application. This must be
108
+ /// called before your application can use the Parse library. The recommended
109
+ /// way is to put a call to <c>ParseFramework.Initialize</c> in your
110
+ /// Application startup.
111
+ /// </summary>
112
+ /// <param name="configuration">The configuration to initialze Parse with.
113
+ /// </param>
114
+ public static void Initialize ( Configuration configuration ) {
84
115
lock ( mutex ) {
85
116
HostName = HostName ?? new Uri ( "https://api.parse.com/1/" ) ;
86
- ApplicationId = applicationId ;
87
- WindowsKey = dotnetKey ;
117
+ CurrentConfiguration = configuration ;
88
118
89
119
ParseObject . RegisterSubclass < ParseUser > ( ) ;
90
120
ParseObject . RegisterSubclass < ParseInstallation > ( ) ;
0 commit comments