@@ -28,6 +28,20 @@ public static partial class ParseClient {
28
28
"yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'f'Z'" ,
29
29
} ;
30
30
31
+ /// <summary>
32
+ /// Represents the configuration of the Parse SDK.
33
+ /// </summary>
34
+ public struct Configuration {
35
+ /// <summary>
36
+ /// The Parse.com application ID of your app.
37
+ /// </summary>
38
+ public String ApplicationId { get ; set ; }
39
+
40
+ /// <summary>
41
+ /// The Parse.com .NET key for your app.
42
+ /// </summary>
43
+ public String WindowsKey { get ; set ; }
44
+ }
31
45
32
46
private static readonly object mutex = new object ( ) ;
33
47
private static readonly string [ ] assemblyNames = {
@@ -60,10 +74,11 @@ private static Type GetParseType(string name) {
60
74
private static readonly IParseCommandRunner commandRunner ;
61
75
internal static IParseCommandRunner ParseCommandRunner { get { return commandRunner ; } }
62
76
77
+ /// <summary>
78
+ /// The current configuration that parse has been initialized with.
79
+ /// </summary>
80
+ public static Configuration CurrentConfiguration { get ; internal set ; }
63
81
internal static Uri HostName { get ; set ; }
64
- internal static string MasterKey { get ; set ; }
65
- internal static string ApplicationId { get ; set ; }
66
- internal static string WindowsKey { get ; set ; }
67
82
68
83
internal static Version Version {
69
84
get {
@@ -90,10 +105,24 @@ internal static string VersionString {
90
105
/// <param name="dotnetKey">The .NET API Key provided in the Parse dashboard.
91
106
/// </param>
92
107
public static void Initialize ( string applicationId , string dotnetKey ) {
108
+ Initialize ( new Configuration {
109
+ ApplicationId = applicationId ,
110
+ WindowsKey = dotnetKey
111
+ } ) ;
112
+ }
113
+
114
+ /// <summary>
115
+ /// Authenticates this client as belonging to your application. This must be
116
+ /// called before your application can use the Parse library. The recommended
117
+ /// way is to put a call to <c>ParseFramework.Initialize</c> in your
118
+ /// Application startup.
119
+ /// </summary>
120
+ /// <param name="configuration">The configuration to initialze Parse with.
121
+ /// </param>
122
+ public static void Initialize ( Configuration configuration ) {
93
123
lock ( mutex ) {
94
124
HostName = HostName ?? new Uri ( "https://api.parse.com/1/" ) ;
95
- ApplicationId = applicationId ;
96
- WindowsKey = dotnetKey ;
125
+ CurrentConfiguration = configuration ;
97
126
98
127
ParseObject . RegisterSubclass < ParseUser > ( ) ;
99
128
ParseObject . RegisterSubclass < ParseInstallation > ( ) ;
0 commit comments